Re: [PATCH] KEYS: Use acquire when reading state in keyring search
Jarkko Sakkinen <[email protected]> Mon, 8 Jun 2026 06:48:58 +0300
| Newsgroups | org.kernel.vger.keyrings,org.kernel.vger.linux-kernel,org.kernel.vger.linux-security-module |
|---|---|
| Message-ID | <[email protected]> |
On Tue, Jun 02, 2026 at 05:42:26PM +0800, Gui-Dong Han wrote: > On Sat, May 30, 2026 at 9:02 AM Jarkko Sakkinen <[email protected]> wrote: > > > > On Fri, May 29, 2026 at 11:34:06AM +0800, Gui-Dong Han wrote: > > > The negative-key race fix added release/acquire ordering for key use. > > > > > > Publish payload before state; read state before payload. > > > > > > keyring_search_iterator() still uses READ_ONCE() before match callbacks. > > > An asymmetric match callback calls asymmetric_key_ids(), which reads > > > key->payload.data[asym_key_ids]. > > > > > > Use key_read_state() there to complete that ordering. > > > > OK, so... I'm having a bit trouble understanding the exact concurrency > > scenario you're trying to describe despite I think I get the fix itself > > i.e. it is not pairing with mark_key_instantiated? > > Yes, it is intended to pair with mark_key_instantiated(). OK, right. I'll apply this. Reviewed-by: Jarkko Sakkinen <[email protected]> BR, Jarkko