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]
Message-ID: <CANpmjNOQDgmyXQZGbHoPJi+Mr0rkZ=SH3NMkbRSfhueNyDAhog@mail.gmail.com>
Date: Sat, 8 Feb 2025 00:19:11 +0100
From: Marco Elver <elver@...gle.com>
To: Bart Van Assche <bvanassche@....org>
Cc: Christoph Hellwig <hch@....de>, Peter Zijlstra <peterz@...radead.org>, Will Deacon <will@...nel.org>, 
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>, Nick Desaulniers <ndesaulniers@...gle.com>, 
	Nathan Chancellor <nathan@...nel.org>, Kees Cook <kees@...nel.org>, Jann Horn <jannh@...gle.com>, 
	linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...hat.com>, 
	Boqun Feng <boqun.feng@...il.com>, Waiman Long <longman@...hat.com>
Subject: Re: [PATCH RFC 03/33] locking: Introduce <linux/thread_safety.h>

On Fri, 7 Feb 2025 at 23:34, Bart Van Assche <bvanassche@....org> wrote:
[...]
> > Those are all nasty shouting names, without and good prefixing.
> >
> > But more importantly ACQUIRE() and RELEASE() seems to duplicate the
> > existing __acquires/__releases annotations from sparse.  We really need
> > to find away to unify them instead of duplicating the annotations.
>
> I think that we are better off to drop support for the sparse locking
> annotations. Linus added the macro __cond_acquires() two years ago in

+1 to dropping Sparse support -- although we can retain the same keywords.

[...]
> * The argument of __acquire() and __release() can be a "capability" or
>    the address of a synchronization object. A few examples where the
>    argument represents a capability:

Not a problem, and can be solved by introducing "token" instances...

>    __acquire(RCU);
>    __acquire(RCU_BH);
>    __acquire(RCU_SCHED);

For RCU: https://lore.kernel.org/lkml/20250206181711.1902989-16-elver@google.com/

>    __acquire(bitlock);

For bitlock: https://lore.kernel.org/lkml/20250206181711.1902989-15-elver@google.com/

>    An example where the argument represents the address of a
>    synchronization object:
>
>    static inline void do_raw_spin_lock(raw_spinlock_t *lock)
>          __acquires(lock)
>    {
>         __acquire(lock);
>         arch_spin_lock(&lock->raw_lock);
>         mmiowb_spin_lock();
>    }
>
>    If __acquire() and __release() would have to be supported for both
>    sparse and Clang, that would probably involve modifying all instances
>    of these two macros across the entire kernel tree and making it
>    explicit whether the argument is a capability or the address of a
>    synchronization object.

This is not a problem as I have demonstrated with my approach. Using
token instances is also the way we'd be able to support things like
preempt-disable-enable, irq-disable-enable, etc.

In general I'm in favor of dropping Sparse support, but the majority
of existing annotations can be reused, simplifying our work.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ