================================================================== BUG: KASAN: slab-out-of-bounds in cap_inode_getsecurity+0x597/0x6e0 security/commoncap.c:408 Read of size 4 at addr ffff8801c3cc9f40 by task syz-executor2/6272 CPU: 0 PID: 6272 Comm: syz-executor2 Not tainted 4.15.0-rc6-mm1+ #50 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+0x137/0x198 lib/dump_stack.c:53 print_address_description+0x73/0x250 mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report+0x23b/0x360 mm/kasan/report.c:412 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report.c:432 cap_inode_getsecurity+0x597/0x6e0 security/commoncap.c:408 security_inode_getsecurity+0xcd/0x110 security/security.c:809 xattr_getsecurity+0x119/0x130 fs/xattr.c:240 vfs_getxattr+0xc8/0x110 fs/xattr.c:333 getxattr+0x232/0x2a0 fs/xattr.c:540 path_getxattr+0xcb/0x130 fs/xattr.c:568 SYSC_getxattr fs/xattr.c:580 [inline] SyS_getxattr+0x33/0x40 fs/xattr.c:577 entry_SYSCALL_64_fastpath+0x23/0x9a RIP: 0033:0x452ac9 RSP: 002b:00007fe966ce0c58 EFLAGS: 00000212 ORIG_RAX: 00000000000000bf RAX: ffffffffffffffda RBX: 00007fe966ce1700 RCX: 0000000000452ac9 RDX: 0000000020227f74 RSI: 0000000020b29f57 RDI: 0000000020fb6000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000212 R12: 0000000000000000 R13: 0000000000a2f7ef R14: 00007fe966ce19c0 R15: 0000000000000000 Allocated by task 6272: 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:552 __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+0xe1/0x6e0 security/commoncap.c:399 security_inode_getsecurity+0xcd/0x110 security/security.c:809 xattr_getsecurity+0x119/0x130 fs/xattr.c:240 vfs_getxattr+0xc8/0x110 fs/xattr.c:333 getxattr+0x232/0x2a0 fs/xattr.c:540 path_getxattr+0xcb/0x130 fs/xattr.c:568 SYSC_getxattr fs/xattr.c:580 [inline] SyS_getxattr+0x33/0x40 fs/xattr.c:577 entry_SYSCALL_64_fastpath+0x23/0x9a Freed by task 3592: save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] __kasan_slab_free+0x11a/0x170 mm/kasan/kasan.c:520 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:527 __cache_free mm/slab.c:3485 [inline] kfree+0xd9/0x260 mm/slab.c:3800 selinux_cred_free+0x48/0x70 security/selinux/hooks.c:3815 security_cred_free+0x48/0x80 security/security.c:995 put_cred_rcu+0x62/0x2c0 kernel/cred.c:117 __rcu_reclaim kernel/rcu/rcu.h:172 [inline] rcu_do_batch kernel/rcu/tree.c:2675 [inline] invoke_rcu_callbacks kernel/rcu/tree.c:2934 [inline] __rcu_process_callbacks kernel/rcu/tree.c:2901 [inline] rcu_process_callbacks+0x5cf/0x1200 kernel/rcu/tree.c:2918 __do_softirq+0x23f/0x99f kernel/softirq.c:285 The buggy address belongs to the object at ffff8801c3cc9f40 which belongs to the cache kmalloc-32 of size 32 The buggy address is located 0 bytes inside of 32-byte region [ffff8801c3cc9f40, ffff8801c3cc9f60) The buggy address belongs to the page: page:ffffea00070f3240 count:1 mapcount:0 mapping:ffff8801c3cc9000 index:0xffff8801c3cc9fc1 flags: 0x2fffc0000000100(slab) raw: 02fffc0000000100 ffff8801c3cc9000 ffff8801c3cc9fc1 000000010000003c raw: ffffea0006f64820 ffffea000711d020 ffff8801db0001c0 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801c3cc9e00: 00 00 01 fc fc fc fc fc fb fb fb fb fc fc fc fc ffff8801c3cc9e80: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc >ffff8801c3cc9f00: fb fb fb fb fc fc fc fc 01 fc fc fc fc fc fc fc ^ ffff8801c3cc9f80: 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc ffff8801c3cca000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================