[PATCH v11 5/6] KEYS: Replace assoc_array with rhashtable

sashiko-bot at kernel.org sashiko-bot at kernel.org
Sat Nov 14 16:32:21 UTC 2026


> The keyrings subsystem is the sole user of assoc_array. It has over 1700
> lines of code, no test suite, and a long history of bugs, with LLMs now
> finding more.
> 
> This unfortunate outcome has evolved over time by large from the shortage
> of in-kernel callers, time bandwidth and 3rd party contributors.
> 
> What the keyrings needs is just a generic key-value store, which performs
> well with sparse key sets.
> 
> Replace struct assoc_array in struct key with struct keyring_index:
> 
> - keyring_index: holds an rhashtable for direct lookups, an RCU-protected
>   list of keyring_link entries for stable walks, the active link count, and
>   an rcu_work item for deferred teardown.
> [ ... ]
> Suggested-by: Eric Biggers <ebiggers at kernel.org>
> Co-developed-by: Linus Torvalds <torvalds at linux-foundation.org>
> Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
> Reviewed-by: Eric Biggers <ebiggers at kernel.org>
> Signed-off-by: Jarkko Sakkinen <jarkko at kernel.org>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261114161211.376859-1-jarkko@kernel.org?part=5




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