Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3943634ybv; Sun, 16 Feb 2020 09:32:51 -0800 (PST) X-Google-Smtp-Source: APXvYqwGWXH3x2f63uoO4j7IPH8886U3GgD/loYfS+e0kquFee3fuJRqHskz81/EFUY4+xWVtsDY X-Received: by 2002:a9d:4f02:: with SMTP id d2mr9120380otl.368.1581874371741; Sun, 16 Feb 2020 09:32:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581874371; cv=none; d=google.com; s=arc-20160816; b=UW6lturosv0N6BRYiSjxj1kyseLBkfzGQEjC1KLkPNhqjKX9YkzWoW1gCSvgSktS48 K3bUCJyZ1mMLE7v7VToj825LTP0lRSK8KXaWd4FhUYdutadXXbTcapPCALBLjxS0pXIG Gt5qPRvqPsRlMWUdgu+Z+c0MQlrP+uelbtUzsuJhGzgyDXMBgL1ZZwndZIxbyhPE4W9N 9Pg14XozLCMnxeLsN/iCyYkkR4CstUESoVXtvd8d6qDn5gyIJtVAS05TSzHa2ebjt39w yChAjJLr47/roSaVlldKmUNBFxw9pkSSeJUjjhf0AAkQXl6JywJ8s8A16Mh2OYT2LvYG 0QLQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=li9wRD+trYzeYRrIDTG7VErShRh4YzHNS/3QPJhsHYs=; b=1H/Eve98V8MDAovkgaxPbzLYLzSTk4SN63wa7m5U+1IJGuv2VD9EeCEz+tosAu3wWc Rwh61wTyfhQ+70WW00YQ6XBBb6V9aoIDNSb7rxLVEmOXmo9c0raN7756Cy8Ul9vmUPH3 3/jIO1dUiCWB0Pzvq+28evyigpRP2Vba2r1X2SaUyxo2mTuueykW9RdUFpzUbOdb/AaT +8OW88Jlu4Am32XzMabRKdk+AcC0+0DRgwSmYiNZ5zIrRVy19EsVnm4CB5PlredVlM0R hvGFAoxUnFXZDcH3KojMt0GsE+EEwOYTlrw2D3w0NZzJMWob0qT/scuMUV8Obqvx1obl ed8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=R9a6Mac4; 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 h26si5039204otm.303.2020.02.16.09.32.26; Sun, 16 Feb 2020 09:32:51 -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=R9a6Mac4; 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 S1728551AbgBPR2V (ORCPT + 99 others); Sun, 16 Feb 2020 12:28:21 -0500 Received: from mail-pl1-f194.google.com ([209.85.214.194]:35284 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728496AbgBPR2U (ORCPT ); Sun, 16 Feb 2020 12:28:20 -0500 Received: by mail-pl1-f194.google.com with SMTP id g6so5773993plt.2; Sun, 16 Feb 2020 09:28:19 -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:mime-version :content-transfer-encoding; bh=li9wRD+trYzeYRrIDTG7VErShRh4YzHNS/3QPJhsHYs=; b=R9a6Mac428S9opSV3aq/ZhqE30jY6lafTCf7S2d1eJ1E99RSCGWcpDXTeZ3Vg3+GyD ihz21YJzlyYeM3anV69vpMgMV6lksRliQJ0HCBJbYfSLI+6QzXpoQOwW0aU0izce8Ky+ BvU/CsSiIhoznN0iXSXvbX23to+afL5HRUjQ/g0BjQj+mjhbeXlEqW0wLFe15ZHEn8Ip VZjDKptRZCNYMvxaU/Ngrb0Ps89+DO1AkcGFEVdK/ApL+P+Exqzjhlh3gNRNjQnnyuqJ MzGQYvNnAP301j1JSOtlVfkSF9EnxwP70stmA832B99N7jjUloV4FBtKk5SXhWB1f6Wf EL2w== 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:mime-version :content-transfer-encoding; bh=li9wRD+trYzeYRrIDTG7VErShRh4YzHNS/3QPJhsHYs=; b=iaA5Q+1xyKP1pbhr56lv/UDb+60N4WfU2CkhyiesjpEZk1tNfwoxgk7Co294bNA1Fa f1aYZYX6knoLVyAnRBCI2D2/3HQHIys3fXFm9Nxgkd6J5V2ehz9lke7yrtZ92yirtLWU qaB0VViWdipKJS00h8ZF20SHyzN2w6Kyamh8c2njePoxrgzM7l4lRPcpe6gXn/qNxOll T6HcPL0+BAxwXw+X8r0vm2AKtEi4JT0rtGwqZSi00LKHBb+kq86aaYsDulG0YG9utp5k f67y46QBBbPlSKrZ0KWpAbIZf0xj1tikg3gQ8xmWYOBtA2LAjY4w/NQzKbjGwq77cI+q kdNA== X-Gm-Message-State: APjAAAXWiJqvZEWHExDCv4HSVatTIy+Af+9sAu0Xc5nTNNOs2cJ+QR7i unvrGnFXO6s/K8jZBjXGvX4= X-Received: by 2002:a17:902:6a88:: with SMTP id n8mr12421746plk.265.1581874098693; Sun, 16 Feb 2020 09:28:18 -0800 (PST) Received: from localhost.localdomain ([103.211.17.250]) by smtp.googlemail.com with ESMTPSA id iq22sm13836213pjb.9.2020.02.16.09.28.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Feb 2020 09:28:18 -0800 (PST) From: Amol Grover To: Pablo Neira Ayuso , Jozsef Kadlecsik , Florian Westphal , "David S . Miller" , Jakub Kicinski , Jeremy Sowden , Florent Fourcot , Kate Stewart , Johannes Berg 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] netfilter: ipset: Pass lockdep expression to RCU lists Date: Sun, 16 Feb 2020 22:56:54 +0530 Message-Id: <20200216172653.19772-1-frextrite@gmail.com> X-Mailer: git-send-email 2.24.1 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 ip_set_type_list is traversed using list_for_each_entry_rcu outside an RCU read-side critical section but under the protection of ip_set_type_mutex. Hence, add corresponding lockdep expression to silence false-positive warnings, and harden RCU lists. Signed-off-by: Amol Grover --- net/netfilter/ipset/ip_set_core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/netfilter/ipset/ip_set_core.c b/net/netfilter/ipset/ip_set_core.c index cf895bc80871..97c851589160 100644 --- a/net/netfilter/ipset/ip_set_core.c +++ b/net/netfilter/ipset/ip_set_core.c @@ -86,7 +86,8 @@ find_set_type(const char *name, u8 family, u8 revision) { struct ip_set_type *type; - list_for_each_entry_rcu(type, &ip_set_type_list, list) + list_for_each_entry_rcu(type, &ip_set_type_list, list, + lockdep_is_held(&ip_set_type_mutex)) if (STRNCMP(type->name, name) && (type->family == family || type->family == NFPROTO_UNSPEC) && -- 2.24.1