[PATCH v8] KEYS: Add a list for unreferenced keys

Jarkko Sakkinen jarkko at kernel.org
Tue Apr 8 16:01:47 UTC 2025


On Mon, Apr 07, 2025 at 03:58:01PM +0300, Jarkko Sakkinen wrote:
> From: Jarkko Sakkinen <jarkko.sakkinen at opinsys.com>
> 
> Add an isolated list of unreferenced keys to be queued for deletion, and
> try to pin the keys in the garbage collector before processing anything.
> Skip unpinnable keys.
> 
> Use this list for blocking the reaping process during the teardown:
> 
> 1. First off, the keys added to `keys_graveyard` are snapshotted, and the
>    list is flushed. This the very last step in `key_put()`.
> 2. `key_put()` reaches zero. This will mark key as busy for the garbage
>    collector.
> 3. `key_garbage_collector()` will try to increase refcount, which won't go
>    above zero. Whenever this happens, the key will be skipped.
> 
> Cc: stable at vger.kernel.org # v6.1+
> Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen at opinsys.com>

This version is my master branch now:

https://web.git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd.git/log/

For the time being not in next.

BR, Jarkko



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