Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3029840ybb; Mon, 6 Apr 2020 00:06:55 -0700 (PDT) X-Google-Smtp-Source: APiQypKBcCYxtY+dDv+P5qwI6qPr39bTokvXwcu+10BT4MoX/PrsYlr4x4hnivWJ9u0Ty3AQTp39 X-Received: by 2002:a9d:644:: with SMTP id 62mr14745866otn.177.1586156814993; Mon, 06 Apr 2020 00:06:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586156814; cv=none; d=google.com; s=arc-20160816; b=nnxPtqfQnzeFvpUkp3viyH2QrJIZtkZyeqWFJqxlLngfqa6YdbSy7rDvcgkgb+n1fR zm4BVSZ/3slRvkQ2RRhJG/MaHFlpHPcFB5oG7O0aXakFsVte6wEw/1nkoYKGTCktrIEt om5rdlNEQ747oTwMcmQPWrq1tn3Pna927mGDFlJ0CKTZ5++Cg1zxMyc0rWby1Aha1lE2 AevuevTpvStoF58YHcYYe0/XJf1YRHky7MSNPxm3Px5BcVrk42u7bwSyyrCezloYhG/X 1ua9+PrX2wEmNs9ij84cYS1q0CYZiYtCnrbskRJkF/x7W2f28geuPQQdejiTl4R8vKD/ aY2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=RqJfBxc+5hEXzJUkSWB0gPw7NrIyI3K3Pr3732qHYAQ=; b=NPSq4LqIuv/b9SbrG8ygHIcVJ3G8qMFqNI0eB406LVVvILz4Sxr8XPA6iMfN+pNmea 3o3P+kOVQwohueSFxljT/uWYso10t97jA90QynzTJqysZFCZaQu6cbWKgcgTwH69ec6T gANtPkKMDFHcggIzAic+XmlMBfQCgutf9Uy9CYmXRRmeMYST2iNXmwWHZUjrMhO0HhH/ tQ3eq2EkGyOLuPnaHBEn7A5ijsGG94O4Kja9Tp3lXyofOgAGbF78g+E8JQVh3wxM+V3t 6PlvuIAna20+f8kSZFgA3stL/YEPeCrETZsSaYAKwVC6feF36/X1+b2VSM0ul/lfulQr vAzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fUl+6I4x; 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 7si6984258ooy.80.2020.04.06.00.06.42; Mon, 06 Apr 2020 00:06:54 -0700 (PDT) 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=fUl+6I4x; 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 S1726605AbgDFHG0 (ORCPT + 99 others); Mon, 6 Apr 2020 03:06:26 -0400 Received: from mail-pj1-f68.google.com ([209.85.216.68]:35848 "EHLO mail-pj1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726486AbgDFHGZ (ORCPT ); Mon, 6 Apr 2020 03:06:25 -0400 Received: by mail-pj1-f68.google.com with SMTP id nu11so6064516pjb.1; Mon, 06 Apr 2020 00:06:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=RqJfBxc+5hEXzJUkSWB0gPw7NrIyI3K3Pr3732qHYAQ=; b=fUl+6I4x7XwQcdmoCTE2Z0XeWKNZEAvwwQhxESe8sRcEQ6vn+AfhNO23bXM8aiWdRe wVnHoSlX0U3b04JnkGrI5Ay7r0HfzNA0pKXN6fKs/gP6RV4tnDNoiDyKyGKhADiOl43n F+mF6OdX/tADPC9HmEUR2PJJhzbFPdsXHduQuuFTWnIM3HbbkxMv3OvuJKYbTAl42H8N 1djGWbVFtbtxKYMtodVAdgw7d1ViLwhPqusfpHjBZmhP8Wby1fHN6KWDj01D0FRMHbs2 40LctGPDNwQdiPuTkW3RvZYYmwy5GjBoAHY3eo1S34N7o4Y+/bM9ACEMqEVOAq1Y+/ZZ d+Tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=RqJfBxc+5hEXzJUkSWB0gPw7NrIyI3K3Pr3732qHYAQ=; b=GCOKNDwRQ6oPwdsISBwc3Ccs2EyJR0gJjOeSzMRphCCQxoQqy6U3mLimza2FQ1i9PY Bs0qzgOGKuUM+XbjwPaFoUmsxW7+OKCbf+7ELoJOMA7gr9HrdszmqHB1EQaOVbC1BpcP fImoGj0VdvYj4w3TCJh7zsRq4RhKH5/tCOeYrZ8jGtnZia4Bo2yUVpyXYVu5jgUN/PxO jc8K+9enhl/4BmWOUd9dkmCxBzDYiAaFb9mwQEt7Lt7ENM5BTj8yaeC+GbMYxtLd9Ubx lMjivOwNlL4aIm1LCbeQgHBYTbJcryybWFSyygoBvDLAOFsgecIGyzlLncSWaCbaXrJr +k1Q== X-Gm-Message-State: AGi0PubBiffcWLft+F3M/nvSKrBEaHC7eXxnmtFmyQOM6+JF3Q+ot2uQ wH+7yzLxRa1z+EQLLfx0svI= X-Received: by 2002:a17:902:507:: with SMTP id 7mr19209367plf.42.1586156784681; Mon, 06 Apr 2020 00:06:24 -0700 (PDT) Received: from workstation-LAP.localdomain ([103.87.57.178]) by smtp.gmail.com with ESMTPSA id m2sm11318884pjk.4.2020.04.06.00.06.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 Apr 2020 00:06:23 -0700 (PDT) Date: Mon, 6 Apr 2020 12:36:12 +0530 From: Amol Grover To: "David S . Miller" Cc: netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Pablo Neira Ayuso , Jozsef Kadlecsik , Florian Westphal , Jakub Kicinski , Jeremy Sowden , Florent Fourcot , Kate Stewart , Johannes Berg , linux-kernel-mentees@lists.linuxfoundation.org, Joel Fernandes , Madhuparna Bhowmik , "Paul E . McKenney" Subject: Re: [PATCH] netfilter: ipset: Pass lockdep expression to RCU lists Message-ID: <20200406070612.GA240@workstation-LAP.localdomain> References: <20200216172653.19772-1-frextrite@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200216172653.19772-1-frextrite@gmail.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Feb 16, 2020 at 10:56:54PM +0530, Amol Grover wrote: > 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 > --- Hi David Could you please go through this patch aswell? This patch was directed to preemptively fix the _suspicious RCU usage_ warning which is now also being reported by Kernel Test Robot. [ 11.654186] ============================= [ 11.654619] WARNING: suspicious RCU usage [ 11.655022] 5.6.0-rc1-00179-gdb4ead2cd5253 #1 Not tainted [ 11.655583] ----------------------------- [ 11.656001] net/netfilter/ipset/ip_set_core.c:89 RCU-list traversed in non-reader section!! Thanks Amol > 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 >