android_kernel_sony_sdm845/security
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Ondrej Mosnacek 6b655dcbba UPSTREAM: selinux: fix context string corruption in convert_context()
string_to_context_struct() may garble the context string, so we need to
copy back the contents again from the old context struct to avoid
storing the corrupted context.

Since string_to_context_struct() tokenizes (and therefore truncates) the
context string and we are later potentially copying it with kstrdup(),
this may eventually cause pieces of uninitialized kernel memory to be
disclosed to userspace (when copying to userspace based on the stored
length and not the null character).

How to reproduce on Fedora and similar:
    # dnf install -y memcached
    # systemctl start memcached
    # semodule -d memcached
    # load_policy
    # load_policy
    # systemctl stop memcached
    # ausearch -m AVC
    type=AVC msg=audit(1570090572.648:313): avc:  denied  { signal } for  pid=1 comm="systemd" scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:unlabeled_t:s0 tclass=process permissive=0 trawcon=73797374656D5F75007400000000000070BE6E847296FFFF726F6D000096FFFF76

Cc: stable@vger.kernel.org
Reported-by: Milos Malik <mmalik@redhat.com>
Fixes: ee1a84fdfeed ("selinux: overhaul sidtab to fix bug and improve performance")
Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: Paul Moore <paul@paul-moore.com>

Change-Id: I08e0cad37589060c09e3a2d19fdecaad998e06d3
(cherry picked from commit 2a5243937c700ffe6a28e6557a4562a9ab0a17a4)
Bug: 140252993
Signed-off-by: Jeff Vander Stoep <jeffv@google.com>
Signed-off-by: Rapherion Rollerscaperers <rapherion@raphielgang.org>
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
Signed-off-by: Sorayukii <sorayukii69@gmail.com>
2026-05-15 18:06:59 +07:00
..
apparmor UPSTREAM: proc,security: move restriction on writing /proc/pid/attr nodes to proc 2026-05-15 18:02:34 +07:00
integrity BACKPORT: audit: use inline function to get audit context 2026-05-15 17:59:18 +07:00
keys This is the 4.9.259 stable release 2021-03-03 18:08:08 +01:00
loadpin UPSTREAM: LSM: Add /sys/kernel/security/lsm 2026-05-15 17:59:05 +07:00
pfe ICE, pfk: fix to set dio_inode precisely 2022-11-30 02:21:44 +02:00
selinux UPSTREAM: selinux: fix context string corruption in convert_context() 2026-05-15 18:06:59 +07:00
smack UPSTREAM: proc,security: move restriction on writing /proc/pid/attr nodes to proc 2026-05-15 18:02:34 +07:00
tomoyo UPSTREAM: LSM: Add /sys/kernel/security/lsm 2026-05-15 17:59:05 +07:00
yama UPSTREAM: LSM: Add /sys/kernel/security/lsm 2026-05-15 17:59:05 +07:00
commoncap.c UPSTREAM: LSM: Add /sys/kernel/security/lsm 2026-05-15 17:59:05 +07:00
device_cgroup.c device_cgroup: prepare code for bpf-based device controller 2026-05-15 17:55:40 +07:00
inode.c UPSTREAM: LSM: Add /sys/kernel/security/lsm 2026-05-15 17:59:05 +07:00
Kconfig Resolve merge conflict and enable HW FBE for ext4 fs 2018-05-22 12:58:05 +05:30
lsm_audit.c BACKPORT: audit: use inline function to get audit context 2026-05-15 17:59:18 +07:00
Makefile Resolve merge conflict and enable HW FBE for ext4 fs 2018-05-22 12:58:05 +05:30
min_addr.c
security.c UPSTREAM: proc,security: move restriction on writing /proc/pid/attr nodes to proc 2026-05-15 18:02:34 +07:00