linux-yocto/security
Stephen Smalley 6500f360a4 selinux: fix selinux_xfrm_alloc_user() to set correct ctx_len
commit 86c8db86af upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-06-27 11:05:34 +01:00
..
apparmor apparmor: test: Fix memory leak for aa_unpack_strdup() 2024-12-14 19:51:14 +01:00
bpf bpf: lsm: Set bpf_lsm_blob_sizes.lbs_task to 0 2024-10-17 15:11:18 +02:00
integrity ima: Fix use-after-free on a dentry's dname.name 2024-12-14 19:51:45 +01:00
keys security/keys: fix slab-out-of-bounds in key_task_permission 2024-11-14 13:13:36 +01:00
landlock landlock: Add the errata interface 2025-05-02 07:44:20 +02:00
loadpin LoadPin: Ignore the "contents" argument of the LSM hooks 2022-12-31 13:14:45 +01:00
lockdown
safesetid safesetid: check size of policy writes 2025-03-13 12:50:17 +01:00
selinux selinux: fix selinux_xfrm_alloc_user() to set correct ctx_len 2025-06-27 11:05:34 +01:00
smack smack: recognize ipv4 CIPSO w/o categories 2025-06-04 14:38:02 +02:00
tomoyo tomoyo: don't emit warning in tomoyo_write_control() 2025-03-13 12:50:18 +01:00
yama
commoncap.c capabilities: fix potential memleak on error path from vfs_getxattr_alloc() 2022-11-10 18:15:39 +01:00
device_cgroup.c device_cgroup: Roll back to original exceptions after copy failure 2023-01-12 11:58:59 +01:00
inode.c
Kconfig proc: add config & param to block forcing mem writes 2024-10-17 15:11:27 +02:00
Kconfig.hardening security: Restrict CONFIG_ZERO_CALL_USED_REGS to gcc or clang > 15.0.6 2022-12-31 13:14:46 +01:00
lsm_audit.c
Makefile
min_addr.c
security.c ima: Avoid blocking in RCU read-side critical section 2024-07-18 13:07:34 +02:00