[PATCH bpf-next v2 1/3] keys: add KEY_SPEC_DM_VERITY_KEYRING

sashiko-bot at kernel.org sashiko-bot at kernel.org
Thu Oct 8 21:04:34 UTC 2026


> The .dm-verity keyring is not linked into any process keyring, so
> request_key() and KEYCTL_SEARCH cannot find it. Userspace has to scrape
> /proc/keys for the serial to use.
> 
> That's not great, one could put in a bogus description containing
> a newline to confuse userspace further. For example, thanks to AI
> models, which I run as root but you could show off as any old user:
> 
>     # DESC=$'.dm-verity: 1\n0badf00d I--Q---     1 perm 082f0000     0     0 keyring   .dm-verity'
>     # k=$(echo -n "1234567" | keyctl padd user "$DESC" @s)
>     # keyctl setperm "$k" 0x3f010001
> 
>     # cat /proc/keys | grep dm-verity
>     10402023 I------     2 perm 082f0000     0     0 keyring   .dm-verity: empty
>     12e0bee6 I--Q---     1 perm 3f010001     0     0 user      .dm-verity: 1
> [ ... ]
> 
> Suggested-by: Christian Brauner (Amutable) <brauner at kernel.org>
> Reviewed-by: Jarkko Sakkinen <jarkko at kernel.org>
> Reviewed-by: Christian Brauner (Amutable) <brauner at kernel.org>
> Signed-off-by: Andrew Halaney <andrew at amutable.com>

Sashiko has reviewed this patch and found no issues. It looks great!

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261008-ajhalaney-dmverity-key-identifier-v2-0-008456d189cb@amutable.com?part=1




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