lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 26 Mar 2024 08:53:39 +0100
From: Johannes Berg <johannes@...solutions.net>
To: Dan Carpenter <dan.carpenter@...aro.org>
Cc: Boqun Feng <boqun.feng@...il.com>, rcu@...r.kernel.org, 
 linux-kernel@...r.kernel.org, "Paul E. McKenney" <paulmck@...nel.org>, 
 Frederic Weisbecker <frederic@...nel.org>, Josh Triplett
 <josh@...htriplett.org>, Peter Zijlstra <peterz@...radead.org>
Subject: Re: [PATCH] rcu: mollify sparse with RCU guard

On Tue, 2024-03-26 at 10:39 +0300, Dan Carpenter wrote:
> On Mon, Mar 25, 2024 at 07:43:18PM +0100, Johannes Berg wrote:
> > On Mon, 2024-03-25 at 21:28 +0300, Dan Carpenter wrote:
> > > On Mon, Mar 25, 2024 at 05:41:22PM +0100, Johannes Berg wrote:
> > > > Also __acquire()/__release() are just empty macros without __CHECKER__.
> > > > So not sure the indirection really is warranted for this special case.
> > > > 
> > > > I can add a comment in there, I guess, something like
> > > > 
> > > >  /* sparse doesn't actually "call" cleanup functions */
> > > > 
> > > > perhaps. That reminds me I forgot to CC Dan ...
> > > > 
> > > 
> > > These are Sparse warnings, not Smatch warning... Smatch doesn't use any
> > > of the Sparse locking annotations.
> > 
> > Sure, of course. I just saw that you added cleanup stuff to sparse to
> > allow using it in smatch.
> > 
> > > Smatch handles cleanup basically correctly at this point.
> > 
> > Do you "run" / "emit" the cleanup function calls there?
> 
> Yes.

I see. I guess that doesn't work for sparse. You write:

   This shouldn't really have been needed if I had written the parse.c
   code correctly to create new scopes for every __cleanup__.

Would that maybe be a way to handle it in sparse? Though not sure how to
return then.

> > I briefly look
> > at doing that in sparse but it felt ... complicated, and then I saw the
> > condition in the cleanup function which I thought sparse could probably
> > not see through anyway.
> 
> The if (_T->lock) statements are a problem.  For those, I have to
> manually add them to check_locking.c as an unlock function and to
> check_preempt.c as a decrement the preempt count function.

OK, no fun.

I think overall it's still easier to go with this patch :)

And maybe we should think about replacing what we need sparse for...

johannes

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ