================================================================== BUG: KASAN: use-after-free in __read_once_size include/linux/compiler.h:199 [inline] BUG: KASAN: use-after-free in __lt_find include/linux/rbtree_latch.h:118 [inline] BUG: KASAN: use-after-free in latch_tree_find include/linux/rbtree_latch.h:208 [inline] BUG: KASAN: use-after-free in bpf_prog_kallsyms_find kernel/bpf/core.c:674 [inline] BUG: KASAN: use-after-free in bpf_prog_kallsyms_find+0x2a9/0x2c0 kernel/bpf/core.c:667 Read of size 8 at addr ffff88808d042d88 by task syz-executor332/14131 CPU: 0 PID: 14131 Comm: syz-executor332 Not tainted 5.4.0-rc1+ #0 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.constprop.0.cold+0xd4/0x30b mm/kasan/report.c:374 __kasan_report.cold+0x1b/0x41 mm/kasan/report.c:506 kasan_report+0x12/0x20 mm/kasan/common.c:634 __asan_report_load8_noabort+0x14/0x20 mm/kasan/generic_report.c:132 __read_once_size include/linux/compiler.h:199 [inline] __lt_find include/linux/rbtree_latch.h:118 [inline] latch_tree_find include/linux/rbtree_latch.h:208 [inline] bpf_prog_kallsyms_find kernel/bpf/core.c:674 [inline] bpf_prog_kallsyms_find+0x2a9/0x2c0 kernel/bpf/core.c:667 is_bpf_text_address+0x78/0x170 kernel/bpf/core.c:709 kernel_text_address+0x73/0xf0 kernel/extable.c:147 __kernel_text_address+0xd/0x40 kernel/extable.c:102 unwind_get_return_address arch/x86/kernel/unwind_frame.c:19 [inline] unwind_get_return_address+0x61/0xa0 arch/x86/kernel/unwind_frame.c:14 arch_stack_walk+0x97/0xf0 arch/x86/kernel/stacktrace.c:26 stack_trace_save+0xac/0xe0 kernel/stacktrace.c:123 save_stack+0x23/0x90 mm/kasan/common.c:69 set_track mm/kasan/common.c:77 [inline] __kasan_kmalloc mm/kasan/common.c:510 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:483 kasan_slab_alloc+0xf/0x20 mm/kasan/common.c:518 slab_post_alloc_hook mm/slab.h:584 [inline] slab_alloc mm/slab.c:3319 [inline] __do_kmalloc mm/slab.c:3653 [inline] __kmalloc+0x14c/0x770 mm/slab.c:3664 kmalloc include/linux/slab.h:557 [inline] tomoyo_realpath_from_path+0xcd/0x7b0 security/tomoyo/realpath.c:277 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_check_open_permission+0x2a8/0x3f0 security/tomoyo/file.c:771 tomoyo_file_open security/tomoyo/tomoyo.c:319 [inline] tomoyo_file_open+0xa9/0xd0 security/tomoyo/tomoyo.c:314 security_file_open+0x71/0x300 security/security.c:1497 do_dentry_open+0x37a/0x1380 fs/open.c:784 vfs_open+0xa0/0xd0 fs/open.c:914 do_last fs/namei.c:3408 [inline] path_openat+0x10e9/0x46d0 fs/namei.c:3525 do_filp_open+0x1a1/0x280 fs/namei.c:3555 do_sys_open+0x3fe/0x5d0 fs/open.c:1097 __do_sys_open fs/open.c:1115 [inline] __se_sys_open fs/open.c:1110 [inline] __x64_sys_open+0x7e/0xc0 fs/open.c:1110 do_syscall_64+0xfa/0x760 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x4011a0 Code: 01 f0 ff ff 0f 83 c0 0b 00 00 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 83 3d 2d 15 2d 00 00 75 14 b8 02 00 00 00 0f 05 <48> 3d 01 f0 ff ff 0f 83 94 0b 00 00 c3 48 83 ec 08 e8 fa 00 00 00 RSP: 002b:00007ffc0b253458 EFLAGS: 00000246 ORIG_RAX: 0000000000000002 RAX: ffffffffffffffda RBX: 00007ffc0b253484 RCX: 00000000004011a0 RDX: 00007ffc0b25348a RSI: 0000000000080001 RDI: 00000000004a2422 RBP: 00007ffc0b253480 R08: 0000000000000000 R09: 0000000000000004 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000004021c0 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 14130: save_stack+0x23/0x90 mm/kasan/common.c:69 set_track mm/kasan/common.c:77 [inline] __kasan_kmalloc mm/kasan/common.c:510 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:483 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:524 kmem_cache_alloc_trace+0x158/0x790 mm/slab.c:3550 kmalloc include/linux/slab.h:552 [inline] kzalloc include/linux/slab.h:686 [inline] bpf_prog_alloc_no_stats+0xe6/0x2b0 kernel/bpf/core.c:88 jit_subprogs kernel/bpf/verifier.c:8769 [inline] fixup_call_args kernel/bpf/verifier.c:8898 [inline] bpf_check+0x6b3d/0x99c0 kernel/bpf/verifier.c:9402 bpf_prog_load+0xe68/0x1660 kernel/bpf/syscall.c:1709 __do_sys_bpf+0xa44/0x3350 kernel/bpf/syscall.c:2866 __se_sys_bpf kernel/bpf/syscall.c:2825 [inline] __x64_sys_bpf+0x73/0xb0 kernel/bpf/syscall.c:2825 do_syscall_64+0xfa/0x760 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 10621: save_stack+0x23/0x90 mm/kasan/common.c:69 set_track mm/kasan/common.c:77 [inline] kasan_set_free_info mm/kasan/common.c:332 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:471 kasan_slab_free+0xe/0x10 mm/kasan/common.c:480 __cache_free mm/slab.c:3425 [inline] kfree+0x10a/0x2c0 mm/slab.c:3756 __bpf_prog_free+0x87/0xc0 kernel/bpf/core.c:258 bpf_jit_free+0x64/0x1b0 bpf_prog_free_deferred+0x1a6/0x350 kernel/bpf/core.c:1980 process_one_work+0x9af/0x1740 kernel/workqueue.c:2269 worker_thread+0x98/0xe40 kernel/workqueue.c:2415 kthread+0x361/0x430 kernel/kthread.c:255 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352 The buggy address belongs to the object at ffff88808d042d40 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 72 bytes inside of 512-byte region [ffff88808d042d40, ffff88808d042f40) The buggy address belongs to the page: page:ffffea0002341080 refcount:1 mapcount:0 mapping:ffff8880aa400a80 index:0x0 flags: 0x1fffc0000000200(slab) raw: 01fffc0000000200 ffffea0001f64848 ffffea00028ec288 ffff8880aa400a80 raw: 0000000000000000 ffff88808d0420c0 0000000100000006 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88808d042c80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88808d042d00: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb >ffff88808d042d80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88808d042e00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88808d042e80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================