From patchwork Mon Oct 12 13:31:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 270287 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8EBD4C433E7 for ; Mon, 12 Oct 2020 13:51:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4B9412074F for ; Mon, 12 Oct 2020 13:51:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602510705; bh=98IodN3bwtoZU6ziWbtwzDOTtjghWYF7SO6Q6eeFQZ4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=u2yqH0MAi15RcYIOg5SJwAgAoZvnVdc3FSligMRNZEo+WkIQZLBouR9eayTcjdaqf mG1U/6pqCswlVrRQqr3jO/Ynitbb0J8wNY36vpUpq1hIWe5roySNSu5SsZ3pLC+boz SCoWYz1tiCLgwL15IhvaZjRhZpb4x/wgZCnCGHAM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390111AbgJLNvo (ORCPT ); Mon, 12 Oct 2020 09:51:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:55744 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731832AbgJLNsN (ORCPT ); Mon, 12 Oct 2020 09:48:13 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AC7C122258; Mon, 12 Oct 2020 13:47:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602510441; bh=98IodN3bwtoZU6ziWbtwzDOTtjghWYF7SO6Q6eeFQZ4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gEko0OrPklMtrXpyzN+LARZy+YuS0NH8eAR/8BPwx6FmpHOmG1PJyG7TU6GIDurpJ jOfmOrNIvU6vh49WKCZkcJ2nRZMvyuLuZ7P3IyrBvVbF4YOendE+JiDa+49x8Cgqjd kYb89I8TvsRlZeQF0nWQFOysbHDAPSUEfATRE478= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, David Howells , Sasha Levin Subject: [PATCH 5.8 101/124] rxrpc: Fix some missing _bh annotations on locking conn->state_lock Date: Mon, 12 Oct 2020 15:31:45 +0200 Message-Id: <20201012133151.747499050@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201012133146.834528783@linuxfoundation.org> References: <20201012133146.834528783@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: David Howells [ Upstream commit fa1d113a0f96f9ab7e4fe4f8825753ba1e34a9d3 ] conn->state_lock may be taken in softirq mode, but a previous patch replaced an outer lock in the response-packet event handling code, and lost the _bh from that when doing so. Fix this by applying the _bh annotation to the state_lock locking. Fixes: a1399f8bb033 ("rxrpc: Call channels should have separate call number spaces") Signed-off-by: David Howells Signed-off-by: Sasha Levin --- net/rxrpc/conn_event.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/rxrpc/conn_event.c b/net/rxrpc/conn_event.c index 447f55ca68860..6e972b4823efa 100644 --- a/net/rxrpc/conn_event.c +++ b/net/rxrpc/conn_event.c @@ -340,18 +340,18 @@ static int rxrpc_process_event(struct rxrpc_connection *conn, return ret; spin_lock(&conn->channel_lock); - spin_lock(&conn->state_lock); + spin_lock_bh(&conn->state_lock); if (conn->state == RXRPC_CONN_SERVICE_CHALLENGING) { conn->state = RXRPC_CONN_SERVICE; - spin_unlock(&conn->state_lock); + spin_unlock_bh(&conn->state_lock); for (loop = 0; loop < RXRPC_MAXCALLS; loop++) rxrpc_call_is_secure( rcu_dereference_protected( conn->channels[loop].call, lockdep_is_held(&conn->channel_lock))); } else { - spin_unlock(&conn->state_lock); + spin_unlock_bh(&conn->state_lock); } spin_unlock(&conn->channel_lock);