Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp596343ybl; Mon, 2 Dec 2019 15:35:40 -0800 (PST) X-Google-Smtp-Source: APXvYqzKV6j6aDu0Kx+3clhXNNPPYPTVrvEdMeymCIkxNbIkXr2LbvLu1trm5ZPd0UqHkT5Q3w3U X-Received: by 2002:a9d:1e88:: with SMTP id n8mr1253611otn.369.1575329740201; Mon, 02 Dec 2019 15:35:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575329740; cv=none; d=google.com; s=arc-20160816; b=MTC4/pFz9297YPsI7Coi1jjl6bq5mHzb1ZMeXA4wk/7WL7O69+4lOGvhk+//0NQtZC CnANxFGihXjYXgNgPl0FIZqgObXQeqb0Oae2I4nC5nOfjN7CukfizxxBqlVZfKWI/a5G cLIdOy4Mc+vaKS7P0Xw6Ea3UdhWvQ5SzgI+MEqSTXnr+8HnyVCqH9OmzCb4lxfsXoHUL yed2+LECy/IX7CGw09+7n1QtqDdUTBDICPlToDLjXIEshYCAhrHLaT7BWNoYs0v29bBm F4Rb0brZ44RwssfNVCWLRBjmZNc08TIIL93dC5Gk2Eg8RLkw1bSJawdmM/abs/jum0Ww txrw== 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=NqtaB9MKOQhSliHwumWMYNqfR+eF1LGGZAxjF3ljDPg=; b=Gz0K2yBZr7mVRBV8CZ+CAmQd5LsUR7f2JUzlnAjP34RctPJNrZ3LtoooGUU3sfobQq Dxuz1273gZTHDzZFaXSrsU/cWCMDex+o46oRbKCToIm979ELP9QQq5QHTYzHYTpaupdY ERybDcbcY3ej8s75bgKfc8orxkzlpkK7Mk5xKwZJsUaDGNoZVYvY69zh5lrUTkx3JRZW 0BQ1+ZGGC8lZrtNPYlPdIjU5Eu+S/VLz5ZbdOLKWMjwRyESWh/K/yA3HMNSNyBR6vUol b2QbxAkx3i0+TjdBsWFeydzp5nbdpxavHw9W5lX0dMHI19j6XNIvfU7Il+JlaSuAOCp4 Yq5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=hRuf95R5; 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 y23si307656oti.65.2019.12.02.15.35.27; Mon, 02 Dec 2019 15:35:40 -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=hRuf95R5; 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 S1726114AbfLBXfB (ORCPT + 99 others); Mon, 2 Dec 2019 18:35:01 -0500 Received: from mail-pl1-f194.google.com ([209.85.214.194]:37012 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725834AbfLBXfB (ORCPT ); Mon, 2 Dec 2019 18:35:01 -0500 Received: by mail-pl1-f194.google.com with SMTP id bb5so761468plb.4 for ; Mon, 02 Dec 2019 15:35:00 -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=NqtaB9MKOQhSliHwumWMYNqfR+eF1LGGZAxjF3ljDPg=; b=hRuf95R5Q6W5esJSAoe7/lzgpx0Qx+VAvNE1tzQ0cBJ4fEhgxAIRCF1FrGjy7QIa39 BqZ7RMIsqyVEki1+/pZIUo3SXoEWrgnGK4poCpb1GtfT1a1AtuQWRBwlBemwyCB3eS9x 6A46kaANsw1PWgvxCCt3gUZeNPfJkb0t7JDrA= 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=NqtaB9MKOQhSliHwumWMYNqfR+eF1LGGZAxjF3ljDPg=; b=Syp+K3j/1stRUJc12FqOSZgCNkDMpfimwYoZatiRAuRmsdLJp3PKGtX2iW7bMKlXc4 r1KbzxFeAZR8dGZOAeapUPmZoX7N5k+X7lrRw09vmj4E2srBOqN0b3rwL4ownzjJR8PV zumD1YUq+L8yUlB81G2aTDUNGaFSW6ANh8l6i3rlUz9QNiU2e4eussP8g2/bKwnIhYju DQ8qYSzmM8iKj3nT1xJkn1XxCvEVwlCzQRhO3EYchaQaz0Xt5pq02InsCp1Kq+yJ59CH Fz5o1PGI+6BlspPIOQp+YJAaU0Q05pAGCe27Yr6DBt99V+G7+GiKQMk1+H6pbL5GeqzZ kvpw== X-Gm-Message-State: APjAAAX5jtrzMNJDlQ1ggdncJEgxpzAelxRzM0dDXAYqP+DQPS5PCNw2 MVVkbxeF2O9uxQVS/wcbCcHuAA== X-Received: by 2002:a17:902:b20c:: with SMTP id t12mr1790521plr.191.1575329700251; Mon, 02 Dec 2019 15:35:00 -0800 (PST) Received: from localhost ([2620:15c:6:12:9c46:e0da:efbf:69cc]) by smtp.gmail.com with ESMTPSA id h9sm596572pfo.139.2019.12.02.15.34.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Dec 2019 15:34:59 -0800 (PST) Date: Mon, 2 Dec 2019 18:34:58 -0500 From: Joel Fernandes To: Paul Moore Cc: Amol Grover , 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: <20191202233458.GN17234@google.com> References: <20191201183347.18122-1-frextrite@gmail.com> <20191202211915.GF17234@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 On Mon, Dec 02, 2019 at 06:24:29PM -0500, Paul Moore wrote: > On Mon, Dec 2, 2019 at 4:19 PM Joel Fernandes wrote: > > 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. > > FWIW, this looks reasonable to me, but I don't see this as a critical > fix that needs to go in during the merge window. Unless I see any > objections, I'll plan on merging this into audit/next once the merge > window closes. Sounds good, thanks! - Joel > > 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 > > > > > > > -- > paul moore > www.paul-moore.com