linux-yocto/security/selinux
Stephen Smalley 2753481c40 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:08:59 +01:00
..
include ima: Avoid blocking in RCU read-side critical section 2024-07-11 12:49:18 +02:00
ss selinux: ignore unknown extended permissions 2025-01-09 13:31:54 +01:00
.gitignore
avc.c selinux: add the processing of the failure of avc_add_xperms_decision() 2024-08-29 17:33:15 +02:00
hooks.c selinux,smack: don't bypass permissions check in inode_setsecctx hook 2024-09-04 13:28:24 +02:00
ibpkey.c selinux: stop passing selinux_state pointers and their offspring 2023-03-14 15:22:45 -04:00
ima.c selinux: adjust typos in comments 2023-05-08 16:44:01 -04:00
Kconfig selinux: introduce SECURITY_SELINUX_DEBUG configuration 2023-07-20 16:21:52 -04:00
Makefile selinux: fix Makefile for versions of make < v4.3 2023-06-02 15:34:29 -04:00
netif.c selinux: avoid implicit conversions in the netif code 2023-07-18 18:29:48 -04:00
netlabel.c selinux: prevent KMSAN warning in selinux_inet_conn_request() 2023-08-15 18:23:22 -04:00
netlink.c
netnode.c selinux: stop passing selinux_state pointers and their offspring 2023-03-14 15:22:45 -04:00
netport.c selinux: stop passing selinux_state pointers and their offspring 2023-03-14 15:22:45 -04:00
nlmsgtab.c selinux: use unsigned iterator in nlmsgtab code 2023-08-09 19:07:49 -04:00
selinuxfs.c selinux: improve error checking in sel_write_load() 2024-11-01 01:58:33 +01:00
status.c selinux: avoid implicit conversions regarding enforcing status 2023-07-18 18:29:50 -04:00
xfrm.c selinux: fix selinux_xfrm_alloc_user() to set correct ctx_len 2025-06-27 11:08:59 +01:00