================================================================== BUG: KASAN: slab-use-after-free in __bpf_trace_run kernel/trace/bpf_trace.c:2085 [inline] BUG: KASAN: slab-use-after-free in bpf_trace_run2+0x2c4/0x840 kernel/trace/bpf_trace.c:2129 Read of size 8 at addr ffff888037371c80 by task dhcpcd/5161 CPU: 0 UID: 101 PID: 5161 Comm: dhcpcd Not tainted syzkaller #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 Call Trace: dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xba/0x230 mm/kasan/report.c:482 kasan_report+0x117/0x150 mm/kasan/report.c:595 __bpf_trace_run kernel/trace/bpf_trace.c:2085 [inline] bpf_trace_run2+0x2c4/0x840 kernel/trace/bpf_trace.c:2129 __do_trace_kfree include/trace/events/kmem.h:97 [inline] trace_kfree include/trace/events/kmem.h:97 [inline] kfree+0x5b2/0x630 mm/slub.c:6472 seccomp_filter_free kernel/seccomp.c:528 [inline] __put_seccomp_filter kernel/seccomp.c:547 [inline] __seccomp_filter_release kernel/seccomp.c:556 [inline] seccomp_filter_release+0x22b/0x2d0 kernel/seccomp.c:585 do_exit+0x3b0/0x23c0 kernel/exit.c:920 do_group_exit+0x21b/0x2d0 kernel/exit.c:1118 get_signal+0x1284/0x1330 kernel/signal.c:3034 arch_do_signal_or_restart+0xbc/0x830 arch/x86/kernel/signal.c:337 __exit_to_user_mode_loop kernel/entry/common.c:64 [inline] exit_to_user_mode_loop kernel/entry/common.c:98 [inline] __exit_to_user_mode_prepare include/linux/irq-entry-common.h:226 [inline] irqentry_exit_to_user_mode_prepare include/linux/irq-entry-common.h:270 [inline] irqentry_exit_to_user_mode include/linux/irq-entry-common.h:339 [inline] irqentry_exit+0x176/0x620 kernel/entry/common.c:219 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:618 RIP: 0033:0x7fe8e0539370 Code: 48 85 d2 74 0b f3 0f 6f 02 48 89 e0 0f 29 04 24 48 83 ec 08 45 31 c9 41 b8 08 00 00 00 48 89 c2 68 0f 01 00 00 e8 b0 20 f9 ff <48> 83 c4 28 c3 66 2e 0f 1f 84 00 00 00 00 00 90 48 83 ec 10 48 63 RSP: 002b:00007ffea62fe480 EFLAGS: 00010206 RAX: 0000000000000001 RBX: 0000000000000000 RCX: 0000560f273d97d0 RDX: 0000000000000001 RSI: 0000000000000002 RDI: 0000560f273d9380 RBP: 00007ffea62fe790 R08: 0000000000000008 R09: 0000000000000000 R10: 00007ffea62fe790 R11: 0000000000000202 R12: 0000560efd8675e0 R13: 0000560f273ccd40 R14: 0000000000000000 R15: 00007ffea62fe540 Allocated by task 5323: kasan_save_stack mm/kasan/common.c:57 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:78 poison_kmalloc_redzone mm/kasan/common.c:398 [inline] __kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:415 kasan_kmalloc include/linux/kasan.h:263 [inline] __kmalloc_cache_noprof+0x31c/0x660 mm/slub.c:5383 kmalloc_noprof include/linux/slab.h:950 [inline] kzalloc_noprof include/linux/slab.h:1188 [inline] bpf_raw_tp_link_attach+0x278/0x700 kernel/bpf/syscall.c:4264 bpf_raw_tracepoint_open+0x1b2/0x220 kernel/bpf/syscall.c:4312 __sys_bpf+0x846/0x950 kernel/bpf/syscall.c:6270 __do_sys_bpf kernel/bpf/syscall.c:6341 [inline] __se_sys_bpf kernel/bpf/syscall.c:6339 [inline] __x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:6339 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x14d/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 15: kasan_save_stack mm/kasan/common.c:57 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:78 kasan_save_free_info+0x46/0x50 mm/kasan/generic.c:584 poison_slab_object mm/kasan/common.c:253 [inline] __kasan_slab_free+0x5c/0x80 mm/kasan/common.c:285 kasan_slab_free include/linux/kasan.h:235 [inline] slab_free_hook mm/slub.c:2692 [inline] slab_free mm/slub.c:6168 [inline] kfree+0x1c1/0x630 mm/slub.c:6486 rcu_do_batch kernel/rcu/tree.c:2617 [inline] rcu_core+0x7cd/0x1070 kernel/rcu/tree.c:2869 handle_softirqs+0x22a/0x870 kernel/softirq.c:622 run_ksoftirqd+0x36/0x60 kernel/softirq.c:1063 smpboot_thread_fn+0x541/0xa50 kernel/smpboot.c:160 kthread+0x388/0x470 kernel/kthread.c:436 ret_from_fork+0x51e/0xb90 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Last potentially related work creation: kasan_save_stack+0x3e/0x60 mm/kasan/common.c:57 kasan_record_aux_stack+0xbd/0xd0 mm/kasan/generic.c:556 __call_rcu_common kernel/rcu/tree.c:3131 [inline] call_rcu+0xee/0x890 kernel/rcu/tree.c:3251 bpf_link_put_direct kernel/bpf/syscall.c:3323 [inline] bpf_link_release+0x6b/0x80 kernel/bpf/syscall.c:3330 __fput+0x44f/0xa70 fs/file_table.c:469 task_work_run+0x1d9/0x270 kernel/task_work.c:233 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] __exit_to_user_mode_loop kernel/entry/common.c:67 [inline] exit_to_user_mode_loop+0xed/0x480 kernel/entry/common.c:98 __exit_to_user_mode_prepare include/linux/irq-entry-common.h:226 [inline] syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:256 [inline] syscall_exit_to_user_mode include/linux/entry-common.h:325 [inline] do_syscall_64+0x32d/0xf80 arch/x86/entry/syscall_64.c:100 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888037371c00 which belongs to the cache kmalloc-192 of size 192 The buggy address is located 128 bytes inside of freed 192-byte region [ffff888037371c00, ffff888037371cc0) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x37371 flags: 0x4fff00000000000(node=1|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 04fff00000000000 ffff88801ac413c0 dead000000000100 dead000000000122 raw: 0000000000000000 0000000800100010 00000000f5000000 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0xd2c00(GFP_NOIO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 1, tgid 1 (swapper/0), ts 18030607281, free_ts 18028652068 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x231/0x280 mm/page_alloc.c:1889 prep_new_page mm/page_alloc.c:1897 [inline] get_page_from_freelist+0x24dc/0x2580 mm/page_alloc.c:3962 __alloc_frozen_pages_noprof+0x18d/0x380 mm/page_alloc.c:5250 alloc_slab_page mm/slub.c:3296 [inline] allocate_slab+0x77/0x660 mm/slub.c:3485 new_slab mm/slub.c:3543 [inline] refill_objects+0x331/0x3c0 mm/slub.c:7178 __pcs_replace_empty_main+0x2f9/0x5e0 mm/slub.c:-1 alloc_from_pcs mm/slub.c:4720 [inline] slab_alloc_node mm/slub.c:4854 [inline] __do_kmalloc_node mm/slub.c:5262 [inline] __kmalloc_noprof+0x474/0x760 mm/slub.c:5275 kmalloc_noprof include/linux/slab.h:954 [inline] usb_alloc_urb+0x46/0x150 drivers/usb/core/urb.c:75 usb_internal_control_msg drivers/usb/core/message.c:96 [inline] usb_control_msg+0x118/0x3e0 drivers/usb/core/message.c:154 usb_get_string+0xa1/0x3c0 drivers/usb/core/message.c:844 usb_string_sub+0x76/0x420 drivers/usb/core/message.c:883 usb_string+0x38f/0x7d0 drivers/usb/core/message.c:988 usb_cache_string+0x80/0x140 drivers/usb/core/message.c:1030 usb_enumerate_device drivers/usb/core/hub.c:2540 [inline] usb_new_device+0x360/0x16f0 drivers/usb/core/hub.c:2665 register_root_hub+0x270/0x5f0 drivers/usb/core/hcd.c:990 usb_add_hcd+0xba1/0x10b0 drivers/usb/core/hcd.c:2987 page last free pid 9 tgid 9 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] __free_pages_prepare mm/page_alloc.c:1433 [inline] __free_frozen_pages+0xc2b/0xdb0 mm/page_alloc.c:2978 vfree+0x25a/0x400 mm/vmalloc.c:3479 delayed_vfree_work+0x55/0x80 mm/vmalloc.c:3398 process_one_work kernel/workqueue.c:3275 [inline] process_scheduled_works+0xb02/0x1830 kernel/workqueue.c:3358 worker_thread+0xa50/0xfc0 kernel/workqueue.c:3439 kthread+0x388/0x470 kernel/kthread.c:436 ret_from_fork+0x51e/0xb90 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Memory state around the buggy address: ffff888037371b80: 00 00 00 00 00 00 00 06 fc fc fc fc fc fc fc fc ffff888037371c00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888037371c80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff888037371d00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888037371d80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ==================================================================