Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp526034ybl; Mon, 2 Dec 2019 14:28:05 -0800 (PST) X-Google-Smtp-Source: APXvYqz/ki2hG4NXo/1xrDZMjmrb+0tNJcRvgFQQkRA26zVIg/SUsYvc0IFgNgZGj01khCtLDeEr X-Received: by 2002:a50:e68c:: with SMTP id z12mr1796823edm.53.1575325685026; Mon, 02 Dec 2019 14:28:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575325685; cv=none; d=google.com; s=arc-20160816; b=gQwVolJaTmdbmWsxcGAFLN64pl+rYeumo90d8IsRXEOrNOUABDgf8p9IHSsHqCXjI8 H/OIdLhW2uyU+JtCIYt361J7SpVQz1e3hzDKMBfxpX2ou/zA43xzr2Pyg4EtJC2daPC2 XpO5xPNaDuYHARIeJwXIzuqPip9ll3qsePZY9Ds3kDf6heD2cSwJ7pXUiVLlg2twXHDf al4BM+rGKdSelkATJa66BJ+cLchoqW/P7HaFoRO4qDoJN0Gh7rvTmofaaslLDrt8QBD8 xi8u5f7CPAz1LuNmryAMTBg/qsHqmIpiL0o6uxkvD2CDerfn3JqC2GKBERiWvyX5Fb6w KvYQ== 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:subject:cc:to:from:date; bh=XsEzjN93HxQiedLXbJamYR56wici8S3nsID+tgJiMe8=; b=oCyMEzRh8mBezeN3aq4m2rQId0eTxZ7an/5ClEozMPhset2dUQ9yrZU2sm8Urzj8lQ L7DdvLOu/juxqExBy6R59EE4LS4qanwj/MSlh7hpWL1fM+1s8ekpu7XN1g+1A7mdYqqW pC6JhVteV+84DotoAeQ8wR/ElZKuUOOcHPvqnEZ/pXIh1BJUViRFPsTnkrwNnm7htwqP C+kyvvpv0/bwML3gFfSY8kP0K1Eyr2e9HcdF0mI/E1+OQGX7UhgXyRokaDmqWCgPzT5E 50ThAOdtSlrmysDYBDRlbQLobaJWH/KE+b5Cj1ncoLbsn4FB5Xa8DYeBySq5J++UfauW Ubyg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e17si705533ejd.249.2019.12.02.14.27.40; Mon, 02 Dec 2019 14:28:05 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726087AbfLBW0n (ORCPT + 99 others); Mon, 2 Dec 2019 17:26:43 -0500 Received: from mail.kernel.org ([198.145.29.99]:50422 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725834AbfLBW0n (ORCPT ); Mon, 2 Dec 2019 17:26:43 -0500 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (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 45A1A2073C; Mon, 2 Dec 2019 22:26:41 +0000 (UTC) Date: Mon, 2 Dec 2019 17:26:39 -0500 From: Steven Rostedt To: Joel Fernandes Cc: Amol Grover , Paul Moore , Eric Paris , linux-audit@redhat.com, linux-kernel@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, Shuah Khan , paulmck@kernel.org, rcu@vger.kernel.org, rostedt@kernel.org Subject: Re: [PATCH v3] kernel: audit.c: Add __rcu annotation to RCU pointer Message-ID: <20191202172639.1c9ad544@gandalf.local.home> In-Reply-To: <20191202211915.GF17234@google.com> References: <20191201183347.18122-1-frextrite@gmail.com> <20191202211915.GF17234@google.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2 Dec 2019 16:19:15 -0500 Joel Fernandes wrote: > Good idea to CC the following on RCU patches: > Paul McKenney > Steven Rostedt I'm fine with this if it doesn't cause any rcu splats with sparse. Not sure if use cases of RCU requires RCU maintainers Cc'd. Although we can usually keep people from misusing it ;-) -- Steve > (Any others on the RCU maintainers list). > And, the list: rcu@vger.kernel.org > > Could anyone Ack the patch? Looks safe and straight forward. > > On Mon, Dec 02, 2019 at 12:03:48AM +0530, Amol Grover wrote: > > Add __rcu annotation to RCU-protected global pointer auditd_conn. > > > > auditd_conn is an RCU-protected global pointer,i.e., accessed > > via RCU methods rcu_dereference() and rcu_assign_pointer(), > > hence it must be annotated with __rcu for sparse to report > > warnings/errors correctly. > > > > Fix multiple instances of the sparse error: > > error: incompatible types in comparison expression > > (different address spaces) > > > > Reviewed-by: Joel Fernandes (Google) > > Signed-off-by: Amol Grover > > --- > > v3: > > - update changelog to be more descriptive > > > > v2: > > - fix erroneous RCU pointer initialization > > > > kernel/audit.c | 5 +++-- > > 1 file changed, 3 insertions(+), 2 deletions(-) > > > > diff --git a/kernel/audit.c b/kernel/audit.c > > index da8dc0db5bd3..ff7cfc61f53d 100644 > > --- a/kernel/audit.c > > +++ b/kernel/audit.c > > @@ -102,12 +102,13 @@ struct audit_net { > > * This struct is RCU protected; you must either hold the RCU lock for reading > > * or the associated spinlock for writing. > > */ > > -static struct auditd_connection { > > +struct auditd_connection { > > struct pid *pid; > > u32 portid; > > struct net *net; > > struct rcu_head rcu; > > -} *auditd_conn = NULL; > > +}; > > +static struct auditd_connection __rcu *auditd_conn; > > static DEFINE_SPINLOCK(auditd_conn_lock); > > > > /* If audit_rate_limit is non-zero, limit the rate of sending audit records > > -- > > 2.24.0 > >