Re: [PATCH net] rxrpc: Fix overread of short key descriptions
From: Lin Ma
Date: Sun Nov 22 2026 - 21:13:15 EST
Hi,
Found by code inspection/static analysis while auditing rxrpc key
handling. I did exercise the path at runtime: add_key("rxrpc", "a",
NULL, 0, ...) followed by keyctl_read() reaches the
memcmp(key->description, "afs@", 4) and returns -EOPNOTSUPP.
It is only a C-level overread: kmalloc rounds the 2-byte description up
to an 8-byte object, the inlined 4-byte load is not KASAN-instrumented,
and the extra bytes are slab padding. There is no crash, no KASAN
report and no user-visible effect, so this is a small correctness/UB
fix rather than a runtime-triggered bug.
Thanks,
Lin Ma