audit: type=1400 audit(1514736440.301:7): avc: denied { map } for pid=3144 comm="syzkaller665937" path="/root/syzkaller665937188" dev="sda1" ino=16481 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:user_home_t:s0 tclass=file permissive=1 ================================================================== BUG: KASAN: slab-out-of-bounds in cap_inode_getsecurity+0x621/0x7d0 security/commoncap.c:408 Read of size 4 at addr ffff8801ca4628c0 by task syzkaller665937/3144 CPU: 1 PID: 3144 Comm: syzkaller665937 Not tainted 4.15.0-rc4-mm1+ #49 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x194/0x257 lib/dump_stack.c:53 print_address_description+0x73/0x250 mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:355 [inline] kasan_report+0x23b/0x360 mm/kasan/report.c:413 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report.c:433 cap_inode_getsecurity+0x621/0x7d0 security/commoncap.c:408 security_inode_getsecurity+0xcd/0x110 security/security.c:809 xattr_getsecurity+0xd3/0x1f0 fs/xattr.c:244 vfs_getxattr+0xc8/0x110 fs/xattr.c:333 getxattr+0x116/0x2a0 fs/xattr.c:540 path_getxattr+0xed/0x170 fs/xattr.c:568 SYSC_getxattr fs/xattr.c:580 [inline] SyS_getxattr+0x33/0x40 fs/xattr.c:577 entry_SYSCALL_64_fastpath+0x1f/0x96 RIP: 0033:0x43fd09 RSP: 002b:00007fff1c00e9d8 EFLAGS: 00000217 ORIG_RAX: 00000000000000bf RAX: ffffffffffffffda RBX: 0030656c69662f2e RCX: 000000000043fd09 RDX: 0000000020227f74 RSI: 0000000020b29f57 RDI: 000000002072d000 RBP: 00000000006ca018 R08: 0000000000000000 R09: 0000000000000000 R10: 000000000000008c R11: 0000000000000217 R12: 0000000000401670 R13: 0000000000401700 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 3144: save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:551 __do_kmalloc mm/slab.c:3705 [inline] __kmalloc_track_caller+0x15e/0x760 mm/slab.c:3720 __do_krealloc mm/slab_common.c:1449 [inline] krealloc+0x65/0xc0 mm/slab_common.c:1496 vfs_getxattr_alloc+0x177/0x270 fs/xattr.c:290 cap_inode_getsecurity+0xfa/0x7d0 security/commoncap.c:399 security_inode_getsecurity+0xcd/0x110 security/security.c:809 xattr_getsecurity+0xd3/0x1f0 fs/xattr.c:244 vfs_getxattr+0xc8/0x110 fs/xattr.c:333 getxattr+0x116/0x2a0 fs/xattr.c:540 path_getxattr+0xed/0x170 fs/xattr.c:568 SYSC_getxattr fs/xattr.c:580 [inline] SyS_getxattr+0x33/0x40 fs/xattr.c:577 entry_SYSCALL_64_fastpath+0x1f/0x96 Freed by task 1647: save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_slab_free+0x71/0xc0 mm/kasan/kasan.c:524 __cache_free mm/slab.c:3485 [inline] kfree+0xd6/0x260 mm/slab.c:3800 sel_write_context+0x1bd/0x340 security/selinux/selinuxfs.c:574 selinux_transaction_write+0xd1/0x130 security/selinux/selinuxfs.c:735 __vfs_write+0xef/0x970 fs/read_write.c:480 vfs_write+0x189/0x510 fs/read_write.c:544 SYSC_write fs/read_write.c:589 [inline] SyS_write+0xef/0x220 fs/read_write.c:581 entry_SYSCALL_64_fastpath+0x1f/0x96 The buggy address belongs to the object at ffff8801ca4628c0 which belongs to the cache kmalloc-32 of size 32 The buggy address is located 0 bytes inside of 32-byte region [ffff8801ca4628c0, ffff8801ca4628e0) The buggy address belongs to the page: page:ffffea0007291880 count:1 mapcount:0 mapping:ffff8801ca462000 index:0xffff8801ca462fc1 flags: 0x2fffc0000000100(slab) raw: 02fffc0000000100 ffff8801ca462000 ffff8801ca462fc1 000000010000003f raw: ffffea000725de20 ffffea00072e12e0 ffff8801dac001c0 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801ca462780: 00 00 00 fc fc fc fc fc fb fb fb fb fc fc fc fc ffff8801ca462800: 00 00 00 fc fc fc fc fc fb fb fb fb fc fc fc fc >ffff8801ca462880: fb fb fb fb fc fc fc fc 01 fc fc fc fc fc fc fc ^ ffff8801ca462900: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc ffff8801ca462980: fb fb fb fb fc fc fc fc 00 00 01 fc fc fc fc fc ==================================================================