Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1551902ybv; Sun, 23 Feb 2020 09:21:24 -0800 (PST) X-Google-Smtp-Source: APXvYqxyjJ3SUdX9AAxH5X04p/M1xsw0lkn2NKkvSUregbcifqnCtPgcbTErPV0p/iab41QRB/eN X-Received: by 2002:a9d:638d:: with SMTP id w13mr35987308otk.220.1582478484804; Sun, 23 Feb 2020 09:21:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582478484; cv=none; d=google.com; s=arc-20160816; b=0O99sJpRwiVUC0zh8E1Mg9Y1BQtk2wv93/lH1fKmeMI1+JXm1W8/D91ekrDGPrrDLY GMHu/dz6cfBgHPfSRcQhHTA5bAcL+sBBC4+FGwxsw7Q5sLw1cAJCPGbwR4CWjiE5d/gv sphRUEUVeS5znFKETeDJc0b10Ifl/8FJraEdjFvojGPUYsTGTyTUEqKtfvsTdaKTbLtr 2GrGvcxz8pDejjdt1JkpzX0zJyk3BmvMWrYGjHDX0tsqWpwkH3fONb6mTkBKvcB7D+H/ p1ws4y9IF1Z4KK+CBuP6f3KFAZVcRBD9XPsuilAPwOKnTVHKon1K1RhCPJN7SCWsqCug adZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=xM5ras975p0Tzn0AuQOvcenknUI3u0IBL1jh0ZA+WuQ=; b=veAaRFsCw+6oBcsph71rNkkt052rokSYAdFeYraKkATJ8NWbqpAJl/KZuP3rQkSf6y K4NmpqlELoBMhj+1o7ZQRGtHkaupndqFpYi1uSk3QWuZmEeyy5Tz9c7qdye/8mjyCbab 0ko9qX6Rbq4SUkClZG+wE4IAMUQzfseJ2ukhXCVKxxFWP1pnwNIFmTMM6FRmT44QfiZ5 BqTtM/aocKHCXNt89gFM6BKWGZa8MoYKQAhWwRRR4wZDgEyIXcou3kzGRtSE5hK9hhk8 5dFZBKH3ABbuIhkVE8MuVb5ynmCxGJ4BgthifyBAX2QNQNZNPhpUdzAt/VTMlp9Sj36Y ZfdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=cNzhGR+x; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d83si4118528oib.166.2020.02.23.09.21.13; Sun, 23 Feb 2020 09:21:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=cNzhGR+x; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727149AbgBWRUZ (ORCPT + 99 others); Sun, 23 Feb 2020 12:20:25 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:41910 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726208AbgBWRUY (ORCPT ); Sun, 23 Feb 2020 12:20:24 -0500 Received: by mail-pl1-f195.google.com with SMTP id t14so3013393plr.8; Sun, 23 Feb 2020 09:20:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xM5ras975p0Tzn0AuQOvcenknUI3u0IBL1jh0ZA+WuQ=; b=cNzhGR+x91SUFBvtXojwfDzu/7qK3SG6d+HdeMkmTDaOCAeTuN/7OrYOWaJ5TNp3jv nxH8krORBX1l+0cI2mTSjCpqLGxuBmaOvfoi2eNHIE2sWnFgqhv8V+BZmmd6HJ6HtW5A 7lrRptjJNIo9aCxh+dRgWonVLM8JmvES0w0G5obacQzr5y7hVuJx5YbxUarmb6Ity/Am J2vjWDjxKOilrz2sDExP2gLmkC/aRHhLputa1s2dKuGJUCdke4Qq8MJwngpedGOfMUIU MRC3bnah4NLrS1LC/jzDXN0PqPCCYG6AlNfXlG5723V/RGkiZoEe32cMqpwRxcEvL5eR B/CQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xM5ras975p0Tzn0AuQOvcenknUI3u0IBL1jh0ZA+WuQ=; b=XgkWafjbG8qgxHVFNEnDup14R78eMYjqUuOzYDTHSSFjUxI+IuleR0SvVwdt4/u0Ca mWxrB4bZ0bgUDWSo5+vxkCdhpCYSF07CIRrC7h7KjC7kFflfwsHRZhbpTsTfmX0Mbtk6 LKm4R65Z37mhcqL5FERMCiIp3k3uSwtP+TI+55hmMVQtu3DpjKKmmEFgUp/fvmA1ZBQI b3oYoUVmjjGp5aIbfgeyJGi8NZgSWXTBMc9AR5vgTfQ5VEZeTH4EeeqyJrrxeOGRNhXv pMQ3ElcZQH1lXETjcCP0obWMiVCMbdt43t0fbwJBfsRP0VfFz9DU9ixplJOaVeMYEbdD fFPQ== X-Gm-Message-State: APjAAAVuV8BkSiSuWJesEQd4xVWV1r+nlTPQRlw2DaSmp4tGpX0V5TPO tuTY75BLie9Fqd7LBerYDrM= X-Received: by 2002:a17:902:463:: with SMTP id 90mr48781720ple.213.1582478423623; Sun, 23 Feb 2020 09:20:23 -0800 (PST) Received: from localhost.localdomain ([103.87.57.33]) by smtp.googlemail.com with ESMTPSA id 13sm9505424pfj.68.2020.02.23.09.20.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Feb 2020 09:20:23 -0800 (PST) From: Amol Grover To: Pablo Neira Ayuso , Jozsef Kadlecsik , Florian Westphal , "David S . Miller" , Jakub Kicinski Cc: netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, Joel Fernandes , Madhuparna Bhowmik , "Paul E . McKenney" , Amol Grover Subject: [PATCH 2/2] netfilter: Pass lockdep expression to instance_lookup traversal Date: Sun, 23 Feb 2020 22:49:46 +0530 Message-Id: <20200223171945.11391-2-frextrite@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200223171945.11391-1-frextrite@gmail.com> References: <20200223171945.11391-1-frextrite@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org q->instance_table[] may be traversed outside an RCU read-side critical section but under the protection of q->instances_lock. Hence, add the corresponding lockdep expression to silence false-positive lockdep warnings. Signed-off-by: Amol Grover --- net/netfilter/nfnetlink_queue.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/netfilter/nfnetlink_queue.c b/net/netfilter/nfnetlink_queue.c index feabdfb22920..5aef41847774 100644 --- a/net/netfilter/nfnetlink_queue.c +++ b/net/netfilter/nfnetlink_queue.c @@ -105,7 +105,8 @@ instance_lookup(struct nfnl_queue_net *q, u_int16_t queue_num) struct nfqnl_instance *inst; head = &q->instance_table[instance_hashfn(queue_num)]; - hlist_for_each_entry_rcu(inst, head, hlist) { + hlist_for_each_entry_rcu(inst, head, hlist, + lockdep_is_held(&q->instances_lock)) { if (inst->queue_num == queue_num) return inst; } -- 2.24.1