================================================================== 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.part.0+0x21e/0x270 kernel/bpf/core.c:511 Read of size 8 at addr ffff88805bc71440 by task systemd-udevd/4703 CPU: 1 PID: 4703 Comm: systemd-udevd Not tainted 4.19.171-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+0x1fc/0x2ef lib/dump_stack.c:118 print_address_description.cold+0x54/0x219 mm/kasan/report.c:256 kasan_report_error.cold+0x8a/0x1b9 mm/kasan/report.c:354 kasan_report mm/kasan/report.c:412 [inline] __asan_report_load8_noabort+0x88/0x90 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.part.0+0x21e/0x270 kernel/bpf/core.c:511 bpf_prog_kallsyms_find include/linux/rcupdate.h:628 [inline] is_bpf_text_address+0x196/0x1b0 kernel/bpf/core.c:546 kernel_text_address kernel/extable.c:152 [inline] kernel_text_address+0xbd/0xf0 kernel/extable.c:122 __kernel_text_address+0x9/0x30 kernel/extable.c:107 unwind_get_return_address arch/x86/kernel/unwind_orc.c:297 [inline] unwind_get_return_address+0x51/0x90 arch/x86/kernel/unwind_orc.c:292 __save_stack_trace+0xaf/0x190 arch/x86/kernel/stacktrace.c:45 save_stack mm/kasan/kasan.c:448 [inline] set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc+0xeb/0x160 mm/kasan/kasan.c:553 slab_post_alloc_hook mm/slab.h:445 [inline] slab_alloc mm/slab.c:3397 [inline] kmem_cache_alloc+0x110/0x370 mm/slab.c:3557 kmem_cache_zalloc include/linux/slab.h:699 [inline] seq_open+0x57/0x1a0 fs/seq_file.c:57 kernfs_fop_open+0x5cd/0xd20 fs/kernfs/file.c:704 do_dentry_open+0x4aa/0x1160 fs/open.c:796 do_last fs/namei.c:3421 [inline] path_openat+0x793/0x2df0 fs/namei.c:3537 do_filp_open+0x18c/0x3f0 fs/namei.c:3567 do_sys_open+0x3b3/0x520 fs/open.c:1085 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7f50263526f0 Code: 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 83 3d 19 30 2c 00 00 75 10 b8 02 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 31 c3 48 83 ec 08 e8 fe 9d 01 00 48 89 04 24 RSP: 002b:00007ffd3cca5ae8 EFLAGS: 00000246 ORIG_RAX: 0000000000000002 RAX: ffffffffffffffda RBX: 000055dc493e8730 RCX: 00007f50263526f0 RDX: 00000000000001b6 RSI: 0000000000080000 RDI: 00007ffd3cca5c90 RBP: 0000000000000008 R08: 0000000000000008 R09: 0000000000000001 R10: 0000000000080000 R11: 0000000000000246 R12: 000055dc4903768a R13: 0000000000000001 R14: 000055dc493ea120 R15: 00007ffd3cca5d10 Allocated by task 22011: kmem_cache_alloc_trace+0x12f/0x380 mm/slab.c:3625 kmalloc include/linux/slab.h:515 [inline] kzalloc include/linux/slab.h:709 [inline] bpf_prog_alloc+0x20b/0x290 kernel/bpf/core.c:90 jit_subprogs kernel/bpf/verifier.c:5849 [inline] fixup_call_args kernel/bpf/verifier.c:5968 [inline] bpf_check+0x599b/0x9ab0 kernel/bpf/verifier.c:6375 bpf_prog_load+0xcca/0x1240 kernel/bpf/syscall.c:1445 __do_sys_bpf kernel/bpf/syscall.c:2418 [inline] __se_sys_bpf+0xf22/0x3a20 kernel/bpf/syscall.c:2379 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 5: __cache_free mm/slab.c:3503 [inline] kfree+0xcc/0x210 mm/slab.c:3822 bpf_jit_free+0x9b/0x300 bpf_prog_free_deferred+0x18f/0x410 kernel/bpf/core.c:1809 process_one_work+0x864/0x1570 kernel/workqueue.c:2155 worker_thread+0x64c/0x1130 kernel/workqueue.c:2298 kthread+0x33f/0x460 kernel/kthread.c:259 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415 The buggy address belongs to the object at ffff88805bc713c0 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 128 bytes inside of 256-byte region [ffff88805bc713c0, ffff88805bc714c0) The buggy address belongs to the page: page:ffffea00016f1c40 count:1 mapcount:0 mapping:ffff88813bff07c0 index:0xffff88805bc718c0 flags: 0xfff00000000100(slab) raw: 00fff00000000100 ffffea00024738c8 ffffea0002d14c48 ffff88813bff07c0 raw: ffff88805bc718c0 ffff88805bc71000 0000000100000002 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88805bc71300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88805bc71380: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb >ffff88805bc71400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88805bc71480: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88805bc71500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ip6_tunnel: ip6gretap0 xmit: Local address not yet configured!