diff options
author | Stephen Smalley <stephen.smalley.work@gmail.com> | 2025-06-13 15:37:05 -0400 |
---|---|---|
committer | Paul Moore <paul@paul-moore.com> | 2025-06-16 19:02:22 -0400 |
commit | 86c8db86af43f52f682e53a0f2f0828683be1e52 (patch) | |
tree | 4e0c6ab77af89f180f2af818cd211b431ad93652 /kernel/bpf/arraymap.c | |
parent | e04c78d86a9699d136910cfc0bdcf01087e3267e (diff) |
selinux: fix selinux_xfrm_alloc_user() to set correct ctx_len
We should count the terminating NUL byte as part of the ctx_len.
Otherwise, UBSAN logs a warning:
UBSAN: array-index-out-of-bounds in security/selinux/xfrm.c:99:14
index 60 is out of range for type 'char [*]'
The allocation itself is correct so there is no actual out of bounds
indexing, just a warning.
Cc: stable@vger.kernel.org
Suggested-by: Christian Göttsche <cgzones@googlemail.com>
Link: https://lore.kernel.org/selinux/CAEjxPJ6tA5+LxsGfOJokzdPeRomBHjKLBVR6zbrg+_w3ZZbM3A@mail.gmail.com/
Signed-off-by: Stephen Smalley <stephen.smalley.work@gmail.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'kernel/bpf/arraymap.c')
0 files changed, 0 insertions, 0 deletions