bisecting fixing commit since 32ee7492f104d82b01a44fc4b4ae17d5d2bb237b building syzkaller on 2274ad39c8bee8efda31dc31ec8933d5624e8fe4 testing commit 32ee7492f104d82b01a44fc4b4ae17d5d2bb237b with gcc (GCC) 8.1.0 kernel signature: dba23b938e0fa3d246b2022c2796c607429eba06d53099ab97d835f9fc0a9f41 run #0: crashed: BUG: unable to handle kernel paging request in bpf_prog_kallsyms_find run #1: crashed: KASAN: use-after-free Read in bpf_prog_kallsyms_find run #2: crashed: KASAN: use-after-free Read in bpf_prog_kallsyms_find run #3: crashed: BUG: unable to handle kernel paging request in bpf_prog_kallsyms_find run #4: crashed: BUG: unable to handle kernel paging request in bpf_prog_kallsyms_find run #5: crashed: KASAN: use-after-free Read in bpf_prog_kallsyms_find run #6: crashed: BUG: unable to handle kernel paging request in bpf_prog_kallsyms_find run #7: crashed: BUG: unable to handle kernel paging request in bpf_prog_kallsyms_find run #8: crashed: BUG: unable to handle kernel paging request in bpf_prog_kallsyms_find run #9: crashed: KASAN: use-after-free Read in bpf_prog_kallsyms_find testing current HEAD 5692097116094a4a7045abcc1dbc172dbdc5657e testing commit 5692097116094a4a7045abcc1dbc172dbdc5657e with gcc (GCC) 8.1.0 kernel signature: 1351b8b14b539c72873352aea70995ff8374fc73c550c01cae5b23c1d402e2c1 run #0: crashed: KASAN: use-after-free Read in bpf_prog_kallsyms_find run #1: crashed: BUG: unable to handle kernel paging request in bpf_prog_kallsyms_find run #2: crashed: BUG: unable to handle kernel paging request in bpf_prog_kallsyms_find run #3: crashed: BUG: unable to handle kernel paging request in bpf_prog_kallsyms_find run #4: crashed: BUG: unable to handle kernel paging request in bpf_prog_kallsyms_find run #5: crashed: BUG: unable to handle kernel paging request in bpf_prog_kallsyms_find run #6: crashed: BUG: unable to handle kernel paging request in bpf_prog_kallsyms_find run #7: crashed: BUG: unable to handle kernel paging request in bpf_prog_kallsyms_find run #8: crashed: WARNING in bpf_prog_kallsyms_find run #9: crashed: KASAN: use-after-free Read in bpf_prog_kallsyms_find revisions tested: 2, total time: 32m39.80491099s (build: 19m6.323928902s, test: 11m56.336780662s) the crash still happens on HEAD commit msg: Linux 4.19.109 crash: KASAN: use-after-free Read in bpf_prog_kallsyms_find ================================================================== BUG: KASAN: use-after-free in bpf_tree_comp kernel/bpf/core.c:437 [inline] BUG: KASAN: use-after-free in __lt_find include/linux/rbtree_latch.h:115 [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+0x1d1/0x2e0 kernel/bpf/core.c:511 Read of size 8 at addr ffff8880903cabc0 by task udevd/4503 CPU: 0 PID: 4503 Comm: udevd Not tainted 4.19.109-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+0x123/0x177 lib/dump_stack.c:118 print_address_description.cold.8+0x9/0x1ff mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report.cold.9+0x242/0x309 mm/kasan/report.c:412 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433 bpf_tree_comp kernel/bpf/core.c:437 [inline] __lt_find include/linux/rbtree_latch.h:115 [inline] latch_tree_find include/linux/rbtree_latch.h:208 [inline] bpf_prog_kallsyms_find+0x1d1/0x2e0 kernel/bpf/core.c:511 is_bpf_text_address+0x48/0xe0 kernel/bpf/core.c:546 kernel_text_address+0x79/0xf0 kernel/extable.c:152 __kernel_text_address+0xd/0x40 kernel/extable.c:107 unwind_get_return_address+0x61/0xa0 arch/x86/kernel/unwind_frame.c:18 __save_stack_trace+0x9c/0x100 arch/x86/kernel/stacktrace.c:45 save_stack_trace+0x1a/0x20 arch/x86/kernel/stacktrace.c:60 save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc+0xc7/0xe0 mm/kasan/kasan.c:553 kasan_slab_alloc+0x12/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/0x730 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+0xb7/0x1a0 security/selinux/hooks.c:3600 security_file_alloc+0x3a/0x70 security/security.c:880 __alloc_file+0xbf/0x2f0 fs/file_table.c:105 alloc_empty_file+0x45/0x110 fs/file_table.c:150 path_openat+0x106/0x3c60 fs/namei.c:3526 do_filp_open+0x177/0x250 fs/namei.c:3567 do_open_execat+0xe1/0x4b0 fs/exec.c:853 __do_execve_file.isra.31+0x11a2/0x1dc0 fs/exec.c:1755 do_execveat_common fs/exec.c:1866 [inline] do_execve fs/exec.c:1883 [inline] __do_sys_execve fs/exec.c:1964 [inline] __se_sys_execve fs/exec.c:1959 [inline] __x64_sys_execve+0x8a/0xb0 fs/exec.c:1959 do_syscall_64+0xd0/0x4e0 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7f359d994207 Code: 77 19 f4 48 89 d7 44 89 c0 0f 05 48 3d 00 f0 ff ff 76 e0 f7 d8 64 41 89 01 eb d8 f7 d8 64 41 89 01 eb df b8 3b 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 02 f3 c3 48 8b 15 00 8c 2d 00 f7 d8 64 89 02 RSP: 002b:00007fff1663ead8 EFLAGS: 00000206 ORIG_RAX: 000000000000003b RAX: ffffffffffffffda RBX: 00000000ffffffff RCX: 00007f359d994207 RDX: 0000000000964840 RSI: 00007fff1663ebd0 RDI: 00007fff1663fbe0 RBP: 0000000000625500 R08: 0000000000001c72 R09: 0000000000001c72 R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000964840 R13: 0000000000000007 R14: 00000000007d3030 R15: 0000000000000005 Allocated by task 4498: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc+0xc7/0xe0 mm/kasan/kasan.c:553 kmem_cache_alloc_trace+0x152/0x740 mm/slab.c:3625 kmalloc include/linux/slab.h:515 [inline] kzalloc include/linux/slab.h:709 [inline] bpf_prog_alloc+0x1e7/0x270 kernel/bpf/core.c:90 jit_subprogs kernel/bpf/verifier.c:5826 [inline] fixup_call_args kernel/bpf/verifier.c:5945 [inline] bpf_check+0x2fd2/0x585d kernel/bpf/verifier.c:6352 bpf_prog_load+0xab4/0x1160 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+0x238/0x380 kernel/bpf/syscall.c:2373 do_syscall_64+0xd0/0x4e0 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 14: save_stack+0x43/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+0x6f/0x2a0 bpf_prog_free_deferred+0x15d/0x3a0 kernel/bpf/core.c:1809 process_one_work+0x830/0x1670 kernel/workqueue.c:2153 worker_thread+0x85/0xb60 kernel/workqueue.c:2296 kthread+0x324/0x3e0 kernel/kthread.c:246 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415 The buggy address belongs to the object at ffff8880903cab40 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 128 bytes inside of 256-byte region [ffff8880903cab40, ffff8880903cac40) The buggy address belongs to the page: page:ffffea000240f280 count:1 mapcount:0 mapping:ffff88812c29c7c0 index:0x0 flags: 0xfffe0000000100(slab) raw: 00fffe0000000100 ffffea0002409f48 ffffea0002409108 ffff88812c29c7c0 raw: 0000000000000000 ffff8880903ca000 000000010000000c 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880903caa80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880903cab00: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb >ffff8880903cab80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880903cac00: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff8880903cac80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================