================================================================== BUG: KASAN: use-after-free in __read_once_size include/linux/compiler.h:193 [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:511 [inline] BUG: KASAN: use-after-free in bpf_prog_kallsyms_find+0x2a9/0x2c0 kernel/bpf/core.c:504 Read of size 8 at addr ffff888051749e40 by task syz-executor.2/996 CPU: 1 PID: 996 Comm: syz-executor.2 Not tainted 4.19.94-syzkaller #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+0x197/0x210 lib/dump_stack.c:118 print_address_description.cold+0x7c/0x20d mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report mm/kasan/report.c:412 [inline] kasan_report.cold+0x8c/0x2ba mm/kasan/report.c:396 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433 __read_once_size include/linux/compiler.h:193 [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:511 [inline] bpf_prog_kallsyms_find+0x2a9/0x2c0 kernel/bpf/core.c:504 is_bpf_text_address+0x78/0x170 kernel/bpf/core.c:546 kernel_text_address+0x73/0xf0 kernel/extable.c:152 __kernel_text_address+0xd/0x40 kernel/extable.c:107 unwind_get_return_address arch/x86/kernel/unwind_frame.c:18 [inline] unwind_get_return_address+0x61/0xa0 arch/x86/kernel/unwind_frame.c:13 __save_stack_trace+0x99/0x100 arch/x86/kernel/stacktrace.c:45 save_stack_trace+0x1a/0x20 arch/x86/kernel/stacktrace.c:60 save_stack+0x45/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc mm/kasan/kasan.c:553 [inline] kasan_kmalloc+0xce/0xf0 mm/kasan/kasan.c:531 kasan_slab_alloc+0xf/0x20 mm/kasan/kasan.c:490 slab_post_alloc_hook mm/slab.h:445 [inline] slab_alloc mm/slab.c:3397 [inline] kmem_cache_alloc+0x11b/0x700 mm/slab.c:3557 kmem_cache_zalloc include/linux/slab.h:699 [inline] file_alloc_security security/selinux/hooks.c:390 [inline] selinux_file_alloc_security+0xb4/0x190 security/selinux/hooks.c:3597 security_file_alloc+0x63/0xa0 security/security.c:884 __alloc_file+0xcf/0x330 fs/file_table.c:105 alloc_empty_file+0x72/0x170 fs/file_table.c:150 path_openat+0xef/0x45e0 fs/namei.c:3523 do_filp_open+0x1a1/0x280 fs/namei.c:3564 do_sys_open+0x3fe/0x550 fs/open.c:1088 __do_sys_open fs/open.c:1106 [inline] __se_sys_open fs/open.c:1101 [inline] __x64_sys_open+0x7e/0xc0 fs/open.c:1101 do_syscall_64+0xfd/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x414cc0 Code: 05 48 3d 01 f0 ff ff 0f 83 2d 19 00 00 c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 83 3d ad 37 66 00 00 75 14 b8 02 00 00 00 0f 05 <48> 3d 01 f0 ff ff 0f 83 04 19 00 00 c3 48 83 ec 08 e8 0a fa ff ff RSP: 002b:00007ffe386110e8 EFLAGS: 00000246 ORIG_RAX: 0000000000000002 RAX: ffffffffffffffda RBX: 00007ffe38611114 RCX: 0000000000414cc0 RDX: 00007ffe3861111a RSI: 0000000000080001 RDI: 00000000004c0a49 RBP: 00007ffe38611110 R08: 0000000000000000 R09: 0000000000000004 R10: 0000000000000075 R11: 0000000000000246 R12: 00000000004c0a49 R13: 00007ffe38611630 R14: 0000000000000000 R15: 00007ffe38611640 Allocated by task 995: save_stack+0x45/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc mm/kasan/kasan.c:553 [inline] kasan_kmalloc+0xce/0xf0 mm/kasan/kasan.c:531 kmem_cache_alloc_trace+0x152/0x760 mm/slab.c:3625 kmalloc include/linux/slab.h:515 [inline] kzalloc include/linux/slab.h:709 [inline] bpf_prog_alloc+0x216/0x2a0 kernel/bpf/core.c:90 jit_subprogs kernel/bpf/verifier.c:5814 [inline] fixup_call_args kernel/bpf/verifier.c:5933 [inline] bpf_check+0x3e7f/0x6259 kernel/bpf/verifier.c:6340 bpf_prog_load+0xdcb/0x1430 kernel/bpf/syscall.c:1445 __do_sys_bpf kernel/bpf/syscall.c:2411 [inline] __se_sys_bpf kernel/bpf/syscall.c:2373 [inline] __x64_sys_bpf+0x32b/0x4c0 kernel/bpf/syscall.c:2373 do_syscall_64+0xfd/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 19: save_stack+0x45/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/kasan.c:521 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528 __cache_free mm/slab.c:3503 [inline] kfree+0xcf/0x220 mm/slab.c:3822 bpf_jit_free+0xa5/0x300 bpf_prog_free_deferred+0x1a6/0x420 kernel/bpf/core.c:1809 process_one_work+0x989/0x1750 kernel/workqueue.c:2153 worker_thread+0x98/0xe40 kernel/workqueue.c:2296 kthread+0x354/0x420 kernel/kthread.c:246 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415 The buggy address belongs to the object at ffff888051749e00 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 64 bytes inside of 256-byte region [ffff888051749e00, ffff888051749f00) The buggy address belongs to the page: page:ffffea000145d240 count:1 mapcount:0 mapping:ffff88812c31c7c0 index:0x0 flags: 0xfffe0000000100(slab) raw: 00fffe0000000100 ffffea000239e748 ffffea0002283488 ffff88812c31c7c0 raw: 0000000000000000 ffff888051749040 000000010000000c 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888051749d00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888051749d80: 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888051749e00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888051749e80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888051749f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================