# Re: \[PATCH v2 2/6\] KEYS: Reject descriptions larger than KEY\_MAX\_DESC\_SIZE

- From: sashiko-bot@kernel.org
- Date: 2026-10-23 12:38:30 
- List: linux-security-module
- Page: https://ratatoskr.run/linux-security-module/2026/10/17793370
- Thread: https://ratatoskr.run/linux-security-module/2026/10/17793224/t.md

```text
> 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: <redacted>
> Assisted-by: LLM
> Fixes: f771fde82051 ("keys: Simplify key description management")
> Reviewed-by: David Howells <dhowells@redhat.com>
> Reviewed-by: Eric Biggers <ebiggers@kernel.org>
> Link: https://lore.kernel.org/r/20261020174325.2229448-3-jarkko@kernel.org
> Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>

Sashiko has reviewed this patch and found no issues.

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

```
