================================================================== BUG: KASAN: slab-out-of-bounds in do_jit.isra.0+0x4c35/0x5630 arch/x86/net/bpf_jit_comp.c:966 Read of size 4 at addr ffff88808bef897c by task syz-executor.1/24167 CPU: 1 PID: 24167 Comm: syz-executor.1 Not tainted 5.2.0+ #41 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+0x172/0x1f0 lib/dump_stack.c:113 print_address_description.cold+0xd4/0x306 mm/kasan/report.c:351 __kasan_report.cold+0x1b/0x36 mm/kasan/report.c:482 kasan_report+0x12/0x20 mm/kasan/common.c:612 __asan_report_load4_noabort+0x14/0x20 mm/kasan/generic_report.c:131 do_jit.isra.0+0x4c35/0x5630 arch/x86/net/bpf_jit_comp.c:966 bpf_int_jit_compile+0x374/0xda0 arch/x86/net/bpf_jit_comp.c:1132 bpf_prog_select_runtime+0x4cd/0x7d0 kernel/bpf/core.c:1726 bpf_prog_load+0xe9b/0x1670 kernel/bpf/syscall.c:1702 __do_sys_bpf+0xa46/0x42f0 kernel/bpf/syscall.c:2849 __se_sys_bpf kernel/bpf/syscall.c:2808 [inline] __x64_sys_bpf+0x73/0xb0 kernel/bpf/syscall.c:2808 do_syscall_64+0xfd/0x6a0 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x459829 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:00007f7a5d912c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000141 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000459829 RDX: 0000000000000048 RSI: 0000000020000200 RDI: 0000000000000005 RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f7a5d9136d4 R13: 00000000004bfc7c R14: 00000000004d1918 R15: 00000000ffffffff Allocated by task 8863: save_stack+0x23/0x90 mm/kasan/common.c:69 set_track mm/kasan/common.c:77 [inline] __kasan_kmalloc mm/kasan/common.c:487 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:460 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:501 __do_kmalloc mm/slab.c:3655 [inline] __kmalloc+0x163/0x780 mm/slab.c:3664 kmalloc include/linux/slab.h:557 [inline] kzalloc include/linux/slab.h:748 [inline] tomoyo_get_name+0x23e/0x490 security/tomoyo/memory.c:173 tomoyo_write_env security/tomoyo/environ.c:102 [inline] tomoyo_write_misc+0x128/0x1f0 security/tomoyo/environ.c:121 tomoyo_write_domain2+0x111/0x1d0 security/tomoyo/common.c:1150 tomoyo_add_entry security/tomoyo/common.c:2040 [inline] tomoyo_supervisor+0xc0b/0xef0 security/tomoyo/common.c:2101 tomoyo_audit_env_log security/tomoyo/environ.c:36 [inline] tomoyo_env_perm+0x18e/0x210 security/tomoyo/environ.c:63 tomoyo_environ security/tomoyo/domain.c:670 [inline] tomoyo_find_next_domain+0x1354/0x1f6c security/tomoyo/domain.c:876 tomoyo_bprm_check_security security/tomoyo/tomoyo.c:107 [inline] tomoyo_bprm_check_security+0x124/0x1b0 security/tomoyo/tomoyo.c:97 security_bprm_check+0x63/0xb0 security/security.c:750 search_binary_handler+0x71/0x570 fs/exec.c:1645 exec_binprm fs/exec.c:1701 [inline] __do_execve_file.isra.0+0x1333/0x2340 fs/exec.c:1821 do_execveat_common fs/exec.c:1868 [inline] do_execve fs/exec.c:1885 [inline] __do_sys_execve fs/exec.c:1961 [inline] __se_sys_execve fs/exec.c:1956 [inline] __x64_sys_execve+0x8f/0xc0 fs/exec.c:1956 do_syscall_64+0xfd/0x6a0 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 7405: save_stack+0x23/0x90 mm/kasan/common.c:69 set_track mm/kasan/common.c:77 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:449 kasan_slab_free+0xe/0x10 mm/kasan/common.c:457 __cache_free mm/slab.c:3425 [inline] kfree+0x10a/0x2c0 mm/slab.c:3756 security_task_free+0x90/0xf0 security/security.c:1480 __put_task_struct+0xf3/0x4e0 kernel/fork.c:731 put_task_struct include/linux/sched/task.h:114 [inline] delayed_put_task_struct+0x220/0x370 kernel/exit.c:182 __rcu_reclaim kernel/rcu/rcu.h:222 [inline] rcu_do_batch kernel/rcu/tree.c:2114 [inline] rcu_core+0x67f/0x1580 kernel/rcu/tree.c:2314 rcu_core_si+0x9/0x10 kernel/rcu/tree.c:2323 __do_softirq+0x262/0x98c kernel/softirq.c:292 The buggy address belongs to the object at ffff88808bef8900 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 60 bytes to the right of 64-byte region [ffff88808bef8900, ffff88808bef8940) The buggy address belongs to the page: page:ffffea00022fbe00 refcount:1 mapcount:0 mapping:ffff8880aa400380 index:0x0 flags: 0x1fffc0000000200(slab) raw: 01fffc0000000200 ffffea0002888008 ffffea000284ad48 ffff8880aa400380 raw: 0000000000000000 ffff88808bef8000 0000000100000020 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88808bef8800: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88808bef8880: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff88808bef8900: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ^ ffff88808bef8980: 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc ffff88808bef8a00: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ==================================================================