Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp598724ybl; Mon, 2 Dec 2019 15:38:00 -0800 (PST) X-Google-Smtp-Source: APXvYqzkvg5s4UmYgLvWN7giZCuR6G/6Me5jwXf0CRzYj7olDKxJUHX4+La4hf9b3T4eVLJKCmSj X-Received: by 2002:aa7:c701:: with SMTP id i1mr2135946edq.247.1575329880701; Mon, 02 Dec 2019 15:38:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575329880; cv=none; d=google.com; s=arc-20160816; b=scocRtrg9o2orzMPgDVrWhYvMjMqB4D/3Eo9n4MWLvHKFNvuOPMgKoHObsnEIaGvfA P2xDI0xUo00ALuI+Z4dfGAlYbm5I+S353f3IcYqyqwmBeZCqzYzEerAUDZ+DRjByjgCu lvl/Uksej26fk7JS/ic3HBhgrAQpMKJfAlzY7s/8JiedeG6IK1ViyidF77oxWwPPoPQP uWpPzubFWsDEH1kNQtq6WXSAPxU/zjTxEZmwXaEno9XonG81TWFUtUrMf3B5cHarQRRt gJOkHAuRzT7+kxgUg/yk3vTj5snDIF63cGdES6pR6dNCSHTHVbR8WQDphu2jOyl2fw5o 4lRg== 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=Z3rcMZkJZGj62FT1K1YiTzywyH6333nfY23ubK0gAps=; b=Sqv3SlG0Z1jQDDdEjHzQj9LgpqlGBm4ojgLG72k/cFLJHCc5CqogcLY9/YRlWbZGi0 2Qe5d/tFewhoMhriO8daN02tfKxrlup/bu5QgJXRdfnuQYJMldtlR/MI5x9p8OyJ+WfS I2SAlU8zPytk5Or3IuLE3c+BKQU5WnyhJel/jGzo2vUc1YjUJeSt939p1v3rXmDlhX5I 5fQHLgcGlgkK1g9/QzWSxTVDMtauZ8O/pTQJye76snwLTPEsUPDUt64t61jgC2gPKDEu YOS+5AUNvjvs5o2ApTJeJevSF8eW2UvfgjHVPTH3HboilLmT8bd5pTp3oB0UEBiO7Vkp j53w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=DlQBanX7; 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 r15si860435edw.296.2019.12.02.15.37.36; Mon, 02 Dec 2019 15:38:00 -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=DlQBanX7; 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 S1726060AbfLBXee (ORCPT + 99 others); Mon, 2 Dec 2019 18:34:34 -0500 Received: from mail-pj1-f66.google.com ([209.85.216.66]:46174 "EHLO mail-pj1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725874AbfLBXee (ORCPT ); Mon, 2 Dec 2019 18:34:34 -0500 Received: by mail-pj1-f66.google.com with SMTP id z21so548464pjq.13 for ; Mon, 02 Dec 2019 15:34:34 -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=Z3rcMZkJZGj62FT1K1YiTzywyH6333nfY23ubK0gAps=; b=DlQBanX7XJUT9sN8nElYX0zHDgV759OWftBOocBhB1kN7kPYUUl/oD2UVC8y2Dk0sz h9Hn455e9FjDObkfMID44wWUG7qhj6n70RPn2JgNrgS39TQ01A/IfJ6v36jTRdVwRFdq vWn/SzPcaUP88D0FOc9ujYpHcYcn1tXqrbIOk= 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=Z3rcMZkJZGj62FT1K1YiTzywyH6333nfY23ubK0gAps=; b=d+MxrqwCAtgjQtpR/suVEJqKQc46RlshUIRm0hVqBHu1Xdi4DVQc7I9LWy8UxIJR0X HeB2pD9eY3epvC2m84OGDMzZxeYwul/n9IAfKeJ0M4gmEW8FbiM0i/MwysL4M7rsGBA4 8WP8/oTkH5oU15KvqX3/ThYQPE3US/6cnSzYOIhgc7kqAnN4TdP//5ueamicKlvxw1ec SwF/3H1JR24rAf7gB/MJfedlbxegWhI0TSY0L75r4czDG00MKyAlsz88duo6OtjVKpuZ Eb0vaKPWYxTSWoVltj1uiyxwmB/Z77sSRJw+WEjd1a0QQlNzheCvQRWRhbX4ZtzrCGyB yMMA== X-Gm-Message-State: APjAAAX0vh6bLx81FlnjxVVPCmPgOngh0XZrFTIHi2y8Iyf7aCzvCAU5 Bdk1a18RY0VzygfJFMhi2IhLUTFCe7E= X-Received: by 2002:a17:902:54f:: with SMTP id 73mr1882143plf.213.1575329673560; Mon, 02 Dec 2019 15:34:33 -0800 (PST) Received: from localhost ([2620:15c:6:12:9c46:e0da:efbf:69cc]) by smtp.gmail.com with ESMTPSA id f13sm617154pfa.57.2019.12.02.15.34.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Dec 2019 15:34:32 -0800 (PST) Date: Mon, 2 Dec 2019 18:34:31 -0500 From: Joel Fernandes To: Steven Rostedt 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: <20191202233431.GM17234@google.com> References: <20191201183347.18122-1-frextrite@gmail.com> <20191202211915.GF17234@google.com> <20191202172639.1c9ad544@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191202172639.1c9ad544@gandalf.local.home> 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 05:26:39PM -0500, Steven Rostedt wrote: > 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 ;-) Yes true :) Thanks for taking a look. - Joel > > -- 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 > > > >