Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp455972ybl; Mon, 2 Dec 2019 13:20:33 -0800 (PST) X-Google-Smtp-Source: APXvYqzwomoLwH1Z6JbUmZweodFKMHuB9+l25Fdd0iMXuEJLsve+SenYwlztNj99ZxsnOAf9Jhvm X-Received: by 2002:a9d:7642:: with SMTP id o2mr776154otl.177.1575321633191; Mon, 02 Dec 2019 13:20:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575321633; cv=none; d=google.com; s=arc-20160816; b=PwE0WYgivzX7B4S3TMiaBEyPjBieXEYhTKIdGPz28BqPckIGVJsw+8A0vBt1SxDFQE MhfoW+oJqnCrcoc2jg9k2OzPDJBIFDFeONuFvGopgqH1thKpXfs+2cEUpNy5+syhTQJV /fZki8NlX4bVVjWcwHIt6bK/ZJfp4F7j4p8s5fWT2WoBu6joE+Ce2xMg1m+oiUR2fMgF +QrO0obZ0pplG2LMFK4X7CoUrL3U4e4aLiZVizAO835DGhtS0dsqPM/q7wj3c5+Vk4iE +QYAz1Ge8MU9IjQsj/S4ZQf9QxVfR757rDDQDdDcdf81JXT46QLYXazQjtS51Ou+9MlG HssA== 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=BDFi2KtUfHoxYhQyKwF8j1ECcKUBGo4/hE4QVcfZiuY=; b=kh9mmgYgpL7xtmgotMHPHbXeqHPx5wFrzq7L1p8eh2Aj4qNAd7hTmNze8uZ8jB5QOn lfJ/6HY07LjFVAE7o/39B4T7E6enrDQ/yfAlBzyLyICjP2GpYdokdfbUO/BTHpjgBz81 d0duT6O62xXgTdmyydd1MphlBIanl1WI53rXfQpFRgfop8l+5SWhYy7k9msACiA9nV6u FhC2FlMsPxkWtg3wsP7WF0itHYqVr5L8NiA0gvxoV2387mRT8aJzqu8I2BhAqFqZvvFA St2Azy4E8JVJ1Me/JJXKdEsFuLcwU1RWFZuk2h66HRm6n9nbgCF1ZqxyWP7LFc2HUaap jwGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=k5OBlfOU; 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 n11si156210otq.112.2019.12.02.13.20.19; Mon, 02 Dec 2019 13:20:33 -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=@joelfernandes.org header.s=google header.b=k5OBlfOU; 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 S1726888AbfLBVTU (ORCPT + 99 others); Mon, 2 Dec 2019 16:19:20 -0500 Received: from mail-pf1-f196.google.com ([209.85.210.196]:44260 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726074AbfLBVTT (ORCPT ); Mon, 2 Dec 2019 16:19:19 -0500 Received: by mail-pf1-f196.google.com with SMTP id d199so369450pfd.11 for ; Mon, 02 Dec 2019 13:19:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=BDFi2KtUfHoxYhQyKwF8j1ECcKUBGo4/hE4QVcfZiuY=; b=k5OBlfOUiouOhGL4KZyw41pLaH30PzkB5d3ZDqtGV/Ol3dKliwN57h0InITL0WL2vX Ss72U23D08CWmhSmsy1She1V1pEOZy2IVux+qSo1YzkuqPk88MpxiAZbVyHawT8fqQWi pcmXULt3qf+94Pauot0hTlG85A4cOlnm+Fscg= 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=BDFi2KtUfHoxYhQyKwF8j1ECcKUBGo4/hE4QVcfZiuY=; b=gFzI/F5mwtjhGsjmhCE1BTi46PsqqhIBtZHq5EUesrM8PRrk6SJeRS780njigoz0D6 fSwVtYMskV0aP3URNCj2BHEM9g8L3CStka8yV0KT5qiGkWRL2k2ovADd8dWMcKf8YifP 4nlMw1LU6RJvJr6V57a/BNE66hhiiEN0WBvcFqQ457+V1yUQEdD3dnrPMJkfKlgbQ6CF Sv8IihvWKcwrXYS+WhcPdjydLxGox2FfxHGa0n6Lva+eYrsdULS+ntB9JAzAfBrwRNfR xxbC4OaGDZZyi3ZPyDqZJmzkKbrfXwXs9TXQtZnrp6UdA1XSbyACTk/D24dPH0VUEUvw epuA== X-Gm-Message-State: APjAAAWkuEovH2yKtPs2H4iLntDIcqsT/fOm8HAjppz7Q2hkfz53ZyQS rwXiCXftbpNP3OoUqsglJKPjzA== X-Received: by 2002:a62:5807:: with SMTP id m7mr743978pfb.180.1575321558967; Mon, 02 Dec 2019 13:19:18 -0800 (PST) Received: from localhost ([2620:15c:6:12:9c46:e0da:efbf:69cc]) by smtp.gmail.com with ESMTPSA id a26sm398874pff.155.2019.12.02.13.19.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Dec 2019 13:19:16 -0800 (PST) Date: Mon, 2 Dec 2019 16:19:15 -0500 From: Joel Fernandes To: Amol Grover Cc: 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: <20191202211915.GF17234@google.com> References: <20191201183347.18122-1-frextrite@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191201183347.18122-1-frextrite@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Good idea to CC the following on RCU patches: Paul McKenney Steven Rostedt (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 >