linux/security
Sachin Grover 1fade11efe selinux: KASAN: slab-out-of-bounds in xattr_getsecurity
commit efe3de79e0 upstream.

Call trace:
 [<ffffff9203a8d7a8>] dump_backtrace+0x0/0x428
 [<ffffff9203a8dbf8>] show_stack+0x28/0x38
 [<ffffff920409bfb8>] dump_stack+0xd4/0x124
 [<ffffff9203d187e8>] print_address_description+0x68/0x258
 [<ffffff9203d18c00>] kasan_report.part.2+0x228/0x2f0
 [<ffffff9203d1927c>] kasan_report+0x5c/0x70
 [<ffffff9203d1776c>] check_memory_region+0x12c/0x1c0
 [<ffffff9203d17cdc>] memcpy+0x34/0x68
 [<ffffff9203d75348>] xattr_getsecurity+0xe0/0x160
 [<ffffff9203d75490>] vfs_getxattr+0xc8/0x120
 [<ffffff9203d75d68>] getxattr+0x100/0x2c8
 [<ffffff9203d76fb4>] SyS_fgetxattr+0x64/0xa0
 [<ffffff9203a83f70>] el0_svc_naked+0x24/0x28

If user get root access and calls security.selinux setxattr() with an
embedded NUL on a file and then if some process performs a getxattr()
on that file with a length greater than the actual length of the string,
it would result in a panic.

To fix this, add the actual length of the string to the security context
instead of the length passed by the userspace process.

Signed-off-by: Sachin Grover <sgrover@codeaurora.org>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
History 2018-10-21 08:46:21 +01:00
..
apparmor apparmor: ensure that undecidable profile attachments fail 2018-02-13 18:42:27 +00:00
integrity ima: relax requiring a file signature for new files with zero length 2018-06-16 22:21:43 +01:00
keys KEYS: add missing permission check for request_key() destination 2018-01-01 20:52:12 +00:00
selinux selinux: KASAN: slab-out-of-bounds in xattr_getsecurity 2018-10-21 08:46:21 +01:00
smack security: let security modules use PTRACE_MODE_* with bitmasks 2018-01-01 20:52:10 +00:00
tomoyo get rid of pointless checks for NULL ->i_op 2014-04-01 23:19:16 -04:00
yama security: let security modules use PTRACE_MODE_* with bitmasks 2018-01-01 20:52:10 +00:00
capability.c Merge tag 'keys-20140314' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs into next 2014-04-14 11:42:49 +10:00
commoncap.c ptrace: use fsuid, fsgid, effective creds for fs access checks 2017-09-15 18:30:17 +01:00
device_cgroup.c device_cgroup: use css_has_online_children() instead of has_children() 2014-05-16 13:22:52 -04:00
inode.c sysfs: Create mountpoints with sysfs_create_mount_point 2015-08-20 18:24:03 +01:00
Kconfig KPTI: Rename to PAGE_TABLE_ISOLATION 2018-01-09 00:35:20 +00:00
lsm_audit.c audit: anchor all pid references in the initial pid namespace 2014-03-20 10:11:55 -04:00
Makefile security: cleanup Makefiles to use standard syntax for specifying sub-directories 2014-02-17 11:08:04 +11:00
min_addr.c mmap_min_addr check CAP_SYS_RAWIO only for write 2010-04-23 08:56:31 +10:00
security.c vfs: Commit to never having exectuables on proc and sysfs. 2017-04-04 22:21:56 +01:00