[PATCH v3 2/6] KEYS: Reject descriptions larger than KEY_MAX_DESC_SIZE
sashiko-bot at kernel.org
sashiko-bot at kernel.org
Sun Oct 25 00:53:08 UTC 2026
> KEY_MAX_DESC_SIZE includes the trailing NULL character. Descriptions
> generated from payloads and in-kernel paths bypass the userspace limit.
>
> Reject descriptions at or above KEY_MAX_DESC_SIZE with -EINVAL at the
> following sites:
>
> - key_alloc(): before quota calculation
> - __key_create_or_update(): before key_set_index_key()
> - keyring_search(): before match_preparse
> - request_key_and_link(): before match_preparse
> - request_key_rcu(): before check_cached_key()
>
> Cc: stable at vger.kernel.org
> Fixes: f771fde82051 ("keys: Simplify key description management")
> Reviewed-by: David Howells <dhowells at redhat.com>
> Reviewed-by: Eric Biggers <ebiggers at kernel.org>
> Link: https://lore.kernel.org/r/20261020174325.2229448-3-jarkko@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/20261025001105.1824178-1-jarkko@kernel.org?part=2
More information about the Linux-security-module-archive
mailing list