[PATCH v13 6/7] KEYS: Replace assoc_array with rhashtable

Jarkko Sakkinen jarkko at kernel.org
Sat Nov 14 20:38:10 UTC 2026


On Sat, Nov 14, 2026 at 08:24:27PM +0000, bot+bpf-ci at kernel.org wrote:
> > + * The walk is RCU-protected, so the keyring's semaphore is not required.  A
> > + * keyring modified concurrently may list a key twice or miss one, but it can
> > + * never have a link freed under the walk.
> 
> Could the comment instead say that the caller holds the keyring's semaphore,
> which keeps the list and the link count stable across the walk and the
> length calculation, with RCU only keeping the walk itself memory-safe?

If I did not miss anything, this is the only remark.

Hmm...

I think this is enough prose to capture the preconditions:

	/*
	 * The list and link count are stable across the walk as the caller
	 * holds keyring->sem.
	 */

Br, Jarkko



More information about the Linux-security-module-archive mailing list