================================================================== BUG: KASAN: slab-out-of-bounds in do_jit.isra.2+0x44c6/0x5770 /arch/x86/net/bpf_jit_comp.c:997 Read of size 4 at addr ffff888089a42cfc by task syz-executor.2/7570 CPU: 1 PID: 7570 Comm: syz-executor.2 Not tainted 5.2.0-rc2+ #1 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack /lib/dump_stack.c:77 [inline] dump_stack+0x115/0x167 /lib/dump_stack.c:113 print_address_description.cold.5+0x9/0x1ff /mm/kasan/report.c:188 __kasan_report.cold.6+0x1b/0x39 /mm/kasan/report.c:317 kasan_report+0x12/0x20 /mm/kasan/common.c:614 __asan_report_load4_noabort+0x14/0x20 /mm/kasan/generic_report.c:131 do_jit.isra.2+0x44c6/0x5770 /arch/x86/net/bpf_jit_comp.c:997 bpf_int_jit_compile+0x302/0xb21 /arch/x86/net/bpf_jit_comp.c:1168 bpf_prog_select_runtime+0x43e/0x850 /kernel/bpf/core.c:1730 bpf_prog_load+0xaeb/0x1200 /kernel/bpf/syscall.c:1700 __do_sys_bpf+0x90a/0x3330 /kernel/bpf/syscall.c:2830 __se_sys_bpf /kernel/bpf/syscall.c:2789 [inline] __x64_sys_bpf+0x6e/0xb0 /kernel/bpf/syscall.c:2789 do_syscall_64+0xd0/0x530 /arch/x86/entry/common.c:301 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x459819 Code: fd b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 cb b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007fb097662c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000141 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000459819 RDX: 0000000000000046 RSI: 0000000020000180 RDI: 0000000000000005 RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007fb0976636d4 R13: 00000000004bfc7c R14: 00000000004d16d8 R15: 00000000ffffffff Allocated by task 7294: save_stack+0x21/0x90 /mm/kasan/common.c:71 set_track /mm/kasan/common.c:79 [inline] __kasan_kmalloc.constprop.8+0xc7/0xd0 /mm/kasan/common.c:489 kasan_kmalloc+0x9/0x10 /mm/kasan/common.c:503 __do_kmalloc /mm/slab.c:3660 [inline] __kmalloc+0x15d/0x740 /mm/slab.c:3669 kmalloc /./include/linux/slab.h:552 [inline] kzalloc /./include/linux/slab.h:742 [inline] tomoyo_encode2.part.2+0x97/0x360 /security/tomoyo/realpath.c:44 tomoyo_encode2 /security/tomoyo/realpath.c:30 [inline] tomoyo_encode+0x1c/0x30 /security/tomoyo/realpath.c:79 tomoyo_realpath_from_path+0x168/0x790 /security/tomoyo/realpath.c:316 tomoyo_get_realpath /security/tomoyo/file.c:151 [inline] tomoyo_path_perm+0x203/0x380 /security/tomoyo/file.c:822 tomoyo_inode_getattr+0x13/0x20 /security/tomoyo/tomoyo.c:129 security_inode_getattr+0xb0/0x100 /security/security.c:1183 vfs_getattr+0x1c/0x40 /fs/stat.c:115 vfs_statx+0xd8/0x150 /fs/stat.c:191 vfs_fstatat /./include/linux/fs.h:3204 [inline] __do_sys_newfstatat+0x7d/0xd0 /fs/stat.c:368 __se_sys_newfstatat /fs/stat.c:362 [inline] __x64_sys_newfstatat+0x92/0xf0 /fs/stat.c:362 do_syscall_64+0xd0/0x530 /arch/x86/entry/common.c:301 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 7294: save_stack+0x21/0x90 /mm/kasan/common.c:71 set_track /mm/kasan/common.c:79 [inline] __kasan_slab_free+0x102/0x150 /mm/kasan/common.c:451 kasan_slab_free+0xe/0x10 /mm/kasan/common.c:459 __cache_free /mm/slab.c:3432 [inline] kfree+0xcf/0x210 /mm/slab.c:3755 tomoyo_path_perm+0x218/0x380 /security/tomoyo/file.c:842 tomoyo_inode_getattr+0x13/0x20 /security/tomoyo/tomoyo.c:129 security_inode_getattr+0xb0/0x100 /security/security.c:1183 vfs_getattr+0x1c/0x40 /fs/stat.c:115 vfs_statx+0xd8/0x150 /fs/stat.c:191 vfs_fstatat /./include/linux/fs.h:3204 [inline] __do_sys_newfstatat+0x7d/0xd0 /fs/stat.c:368 __se_sys_newfstatat /fs/stat.c:362 [inline] __x64_sys_newfstatat+0x92/0xf0 /fs/stat.c:362 do_syscall_64+0xd0/0x530 /arch/x86/entry/common.c:301 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff888089a42cc0 which belongs to the cache kmalloc-32 of size 32 The buggy address is located 28 bytes to the right of 32-byte region [ffff888089a42cc0, ffff888089a42ce0) The buggy address belongs to the page: page:ffffea0002269080 refcount:1 mapcount:0 mapping:ffff8880aa4001c0 index:0xffff888089a42fc1 flags: 0x1fffc0000000200(slab) raw: 01fffc0000000200 ffffea0002a56b48 ffffea00027ea408 ffff8880aa4001c0 raw: ffff888089a42fc1 ffff888089a42000 000000010000003f 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888089a42b80: fb fb fb fb fc fc fc fc 00 01 fc fc fc fc fc fc ffff888089a42c00: 00 00 06 fc fc fc fc fc fb fb fb fb fc fc fc fc >ffff888089a42c80: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc ^ ffff888089a42d00: 00 00 fc fc fc fc fc fc 00 00 00 00 fc fc fc fc ffff888089a42d80: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc ==================================================================