Re: [PATCH v2] keys: Fix UAF in key_put()
From: Linus Torvalds
Date: Wed Mar 19 2025 - 14:16:45 EST
On Wed, 19 Mar 2025 at 09:31, Oleg Nesterov <oleg@xxxxxxxxxx> wrote:
>
> Can't resist, smp_mb__before_atomic() should equally work,
> but this doesn't really matter, please forget.
We really should have "test_bit_acquire()" and "set_bit_release()".
Well, we do have the test_bit_acquire().
We just don't have the set_bit side, because we only have the bit
clearing version (and it's called "clear_bit_unlock()" for historical
reasons).
Annoying.
Linus