Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3645216pxb; Mon, 24 Jan 2022 14:17:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJxQPRrnBJsdSvyDmf9PoeqYxn8K477hZB9Atk23eRNoLYZuaDohbPohjsQ7v6QA/scGF25m X-Received: by 2002:a05:6a00:841:b0:4bf:325:de2f with SMTP id q1-20020a056a00084100b004bf0325de2fmr15641632pfk.7.1643062659525; Mon, 24 Jan 2022 14:17:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643062659; cv=none; d=google.com; s=arc-20160816; b=LB6w6CKy26LxTHLfD0U0OsTEfgqTnnjcQbomikt3pWq/fkvdquwzROqn2pc13zfra/ 2EbaHuCmgd3hvaqisdtPpnQKWzAlyNXtCMuHE7X9HFTQurENuHOSPS/q4Gd3mdGs2Gxk KWI67i5g+oaNmkljAPBzbeJi6B9N/PKbIe4BkrHE7mqKsYl5SLqVFX/IJ7axRqe7WbJM 8yw2QVRc+I5OEgDDeTHCzY/daQ4E0ZxJe/0mlU7d29f+dN1LrCOiUwry2yXaTSrJycEv 4iuoGzLXQ//b0XLwNWHEnimQ9M/MtaDSjl5yNNkQpuSr5KqxSuHBwLLIQ987akC3dbZg 1S+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=pthFYLiuXDn1jPwBMaYpKIfaY5PEOSnXtnfd95TLlA4=; b=JOTEO8B8KxQJyjgveI82QiHntA0XqSerL2XO/uOVdCgJ4pSQaZoazkJaXRl8ccMUBw pJD4PcGhEPWbVaIZhD2xT87nAzumv6Y1ydjs2pmKPogundipqSqiAEm0oCWc40oc9qeE k/AwfUuzQFe8JRgcjjSBye/WLOcVSrHLYjdSwpYqk27kz+z3RCNUJiZAbpYlLG9pi16u ngIeWIWr9tcJUgKwLn/xnalUHnvod7z2K/oTWc8Eti3eNZURJn3VXAQD6hWAL028o8e8 LGFhf/HkPhwvrL9URBWHHAd8SkeYaIrzp8K2lEneA+wLRt4bQEU/8E/xPTJo0hjC4QT1 3UNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=MmxxWRaB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hk2si632702pjb.80.2022.01.24.14.17.25; Mon, 24 Jan 2022 14:17:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=MmxxWRaB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1581004AbiAXWLF (ORCPT + 99 others); Mon, 24 Jan 2022 17:11:05 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:34150 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1449188AbiAXVPI (ORCPT ); Mon, 24 Jan 2022 16:15:08 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 6D33BB81142; Mon, 24 Jan 2022 21:15:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 93C72C340E5; Mon, 24 Jan 2022 21:14:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643058899; bh=sSDFp/4Isibgx+viCawhWzXdWhERJeA4CwQLf+j1haA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MmxxWRaBLW1EP7oynW0cNk2ETT9/es42GK4g9MWY3xj96QIr4g6prRS8JlKCushyr BXGD/Q8FwRccdQDM3tJ2EmezlWE0+txwL4XgACb3auCah5jL9TsuKbAzzY+OzGAvqU hb84dVtCuukFnlmxB00Uq1Y3THvec//5KBPka3v8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Florian Westphal , Pablo Neira Ayuso , Sasha Levin Subject: [PATCH 5.16 0437/1039] netfilter: egress: avoid a lockdep splat Date: Mon, 24 Jan 2022 19:37:06 +0100 Message-Id: <20220124184139.986966049@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Florian Westphal [ Upstream commit 6316136ec6e3dd1c302f7e7289a9ee46ecc610ae ] include/linux/netfilter_netdev.h:97 suspicious rcu_dereference_check() usage! 2 locks held by sd-resolve/1100: 0: ..(rcu_read_lock_bh){1:3}, at: ip_finish_output2 1: ..(rcu_read_lock_bh){1:3}, at: __dev_queue_xmit __dev_queue_xmit+0 .. The helper has two callers, one uses rcu_read_lock, the other rcu_read_lock_bh(). Annotate the dereference to reflect this. Fixes: 42df6e1d221dd ("netfilter: Introduce egress hook") Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso Signed-off-by: Sasha Levin --- include/linux/netfilter_netdev.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/netfilter_netdev.h b/include/linux/netfilter_netdev.h index b71b57a83bb4f..b4dd96e4dc8dc 100644 --- a/include/linux/netfilter_netdev.h +++ b/include/linux/netfilter_netdev.h @@ -94,7 +94,7 @@ static inline struct sk_buff *nf_hook_egress(struct sk_buff *skb, int *rc, return skb; #endif - e = rcu_dereference(dev->nf_hooks_egress); + e = rcu_dereference_check(dev->nf_hooks_egress, rcu_read_lock_bh_held()); if (!e) return skb; -- 2.34.1