================================================================== BUG: KASAN: use-after-free in hlist_add_head include/linux/list.h:814 [inline] BUG: KASAN: use-after-free in enqueue_timer+0x9e/0x2c0 kernel/time/timer.c:541 Write of size 8 at addr ffff8881ddb931c8 by task syz.0.1064/4105 CPU: 0 PID: 4105 Comm: syz.0.1064 Not tainted 5.4.292-syzkaller-00021-gcd8e74fa0fa3 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025 Call Trace: __dump_stack+0x1e/0x20 lib/dump_stack.c:77 dump_stack+0x15b/0x1b8 lib/dump_stack.c:118 print_address_description+0x8d/0x4c0 mm/kasan/report.c:384 __kasan_report+0xef/0x120 mm/kasan/report.c:516 kasan_report+0x30/0x60 mm/kasan/common.c:653 __asan_report_store8_noabort+0x17/0x20 mm/kasan/generic_report.c:137 hlist_add_head include/linux/list.h:814 [inline] enqueue_timer+0x9e/0x2c0 kernel/time/timer.c:541 __internal_add_timer kernel/time/timer.c:554 [inline] internal_add_timer+0x208/0x3e0 kernel/time/timer.c:604 __mod_timer+0x5ab/0x1150 kernel/time/timer.c:1065 mod_timer+0x1f/0x30 kernel/time/timer.c:1117 can_stat_update+0xbab/0xc40 net/can/proc.c:186 call_timer_fn+0x3c/0x380 kernel/time/timer.c:1448 expire_timers kernel/time/timer.c:1493 [inline] __run_timers+0x81d/0xb60 kernel/time/timer.c:1817 run_timer_softirq+0x6a/0xf0 kernel/time/timer.c:1830 __do_softirq+0x236/0x660 kernel/softirq.c:292 do_softirq_own_stack+0x2a/0x40 arch/x86/entry/entry_64.S:1086 do_softirq+0xf9/0x140 kernel/softirq.c:337 __local_bh_enable_ip+0x70/0x80 kernel/softirq.c:189 local_bh_enable+0x1f/0x30 include/linux/bottom_half.h:32 rcu_read_unlock_bh include/linux/rcupdate.h:739 [inline] __dev_queue_xmit+0x136e/0x2400 net/core/dev.c:3848 dev_queue_xmit+0x17/0x20 net/core/dev.c:3854 __bpf_tx_skb net/core/filter.c:2063 [inline] __bpf_redirect_no_mac net/core/filter.c:2097 [inline] __bpf_redirect+0x699/0xe30 net/core/filter.c:2120 ____bpf_clone_redirect net/core/filter.c:2151 [inline] bpf_clone_redirect+0x242/0x380 net/core/filter.c:2123 bpf_prog_973cd02a7a0e8181+0xde/0x1000 bpf_call_func include/linux/filter.h:627 [inline] bpf_test_run+0x1ea/0x5d0 net/bpf/test_run.c:44 bpf_prog_test_run_skb+0x721/0xdc0 net/bpf/test_run.c:311 bpf_prog_test_run+0x21a/0x2a0 kernel/bpf/syscall.c:2124 __do_sys_bpf kernel/bpf/syscall.c:2909 [inline] __se_sys_bpf+0x49a/0x570 kernel/bpf/syscall.c:2849 __x64_sys_bpf+0x7b/0x90 kernel/bpf/syscall.c:2849 do_syscall_64+0xcf/0x170 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 RIP: 0033:0x7f3048a7f969 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f30470e8038 EFLAGS: 00000246 ORIG_RAX: 0000000000000141 RAX: ffffffffffffffda RBX: 00007f3048ca6fa0 RCX: 00007f3048a7f969 RDX: 000000000000002c RSI: 0000200000000080 RDI: 000000000000000a RBP: 00007f3048b01ab1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f3048ca6fa0 R15: 00007ffd56e2e5a8 Allocated by task 4022: save_stack mm/kasan/common.c:70 [inline] set_track mm/kasan/common.c:78 [inline] __kasan_kmalloc+0x162/0x200 mm/kasan/common.c:529 kasan_slab_alloc+0x12/0x20 mm/kasan/common.c:537 slab_post_alloc_hook mm/slab.h:584 [inline] slab_alloc_node mm/slub.c:2829 [inline] slab_alloc mm/slub.c:2837 [inline] __kmalloc_track_caller+0x10d/0x2d0 mm/slub.c:4449 __kmalloc_reserve net/core/skbuff.c:142 [inline] __alloc_skb+0xdc/0x500 net/core/skbuff.c:210 alloc_skb include/linux/skbuff.h:1080 [inline] nlmsg_new include/net/netlink.h:888 [inline] fdb_notify+0x78/0x130 net/bridge/br_fdb.c:709 br_fdb_update+0x33d/0x4f0 net/bridge/br_fdb.c:615 br_handle_frame_finish+0x1e6/0x11d0 net/bridge/br_input.c:98 nf_hook_bridge_pre net/bridge/br_input.c:254 [inline] br_handle_frame+0x407/0x8e0 net/bridge/br_input.c:355 __netif_receive_skb_core+0xe7f/0x2f10 net/core/dev.c:4885 __netif_receive_skb_one_core net/core/dev.c:4989 [inline] __netif_receive_skb+0x72/0x280 net/core/dev.c:5105 process_backlog+0x363/0x630 net/core/dev.c:5940 napi_poll net/core/dev.c:6386 [inline] net_rx_action+0x447/0xe50 net/core/dev.c:6454 __do_softirq+0x236/0x660 kernel/softirq.c:292 Freed by task 4022: save_stack mm/kasan/common.c:70 [inline] set_track mm/kasan/common.c:78 [inline] kasan_set_free_info mm/kasan/common.c:345 [inline] __kasan_slab_free+0x1c3/0x280 mm/kasan/common.c:487 kasan_slab_free+0xe/0x10 mm/kasan/common.c:496 slab_free_hook mm/slub.c:1455 [inline] slab_free_freelist_hook+0xb7/0x180 mm/slub.c:1494 slab_free mm/slub.c:3080 [inline] kfree+0xbe/0x260 mm/slub.c:4071 skb_free_head net/core/skbuff.c:601 [inline] skb_release_data+0x4ea/0x610 net/core/skbuff.c:621 skb_release_all net/core/skbuff.c:675 [inline] __kfree_skb net/core/skbuff.c:689 [inline] consume_skb+0xad/0x240 net/core/skbuff.c:849 netlink_broadcast_filtered+0x1198/0x1290 net/netlink/af_netlink.c:1516 netlink_broadcast net/netlink/af_netlink.c:1538 [inline] nlmsg_multicast include/net/netlink.h:968 [inline] nlmsg_notify+0xed/0x1b0 net/netlink/af_netlink.c:2510 rtnl_notify+0x9a/0xc0 net/core/rtnetlink.c:737 fdb_notify+0xce/0x130 net/bridge/br_fdb.c:720 br_fdb_update+0x33d/0x4f0 net/bridge/br_fdb.c:615 br_handle_frame_finish+0x1e6/0x11d0 net/bridge/br_input.c:98 nf_hook_bridge_pre net/bridge/br_input.c:254 [inline] br_handle_frame+0x407/0x8e0 net/bridge/br_input.c:355 __netif_receive_skb_core+0xe7f/0x2f10 net/core/dev.c:4885 __netif_receive_skb_one_core net/core/dev.c:4989 [inline] __netif_receive_skb+0x72/0x280 net/core/dev.c:5105 process_backlog+0x363/0x630 net/core/dev.c:5940 napi_poll net/core/dev.c:6386 [inline] net_rx_action+0x447/0xe50 net/core/dev.c:6454 __do_softirq+0x236/0x660 kernel/softirq.c:292 The buggy address belongs to the object at ffff8881ddb93000 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 456 bytes inside of 512-byte region [ffff8881ddb93000, ffff8881ddb93200) The buggy address belongs to the page: page:ffffea000776e400 refcount:1 mapcount:0 mapping:ffff8881f5c02500 index:0x0 compound_mapcount: 0 flags: 0x8000000000010200(slab|head) raw: 8000000000010200 dead000000000100 dead000000000122 ffff8881f5c02500 raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Unmovable, gfp_mask 0x152a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_HARDWALL) set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook mm/page_alloc.c:2165 [inline] prep_new_page+0x35e/0x370 mm/page_alloc.c:2171 get_page_from_freelist+0x1296/0x1310 mm/page_alloc.c:3794 __alloc_pages_nodemask+0x202/0x4b0 mm/page_alloc.c:4894 alloc_slab_page+0x3c/0x3b0 mm/slub.c:343 allocate_slab mm/slub.c:1683 [inline] new_slab+0x93/0x420 mm/slub.c:1749 new_slab_objects mm/slub.c:2505 [inline] ___slab_alloc+0x29e/0x420 mm/slub.c:2667 __slab_alloc+0x63/0xa0 mm/slub.c:2707 slab_alloc_node mm/slub.c:2792 [inline] slab_alloc mm/slub.c:2837 [inline] __kmalloc+0x176/0x2f0 mm/slub.c:3909 kmalloc include/linux/slab.h:561 [inline] kzalloc include/linux/slab.h:690 [inline] neigh_alloc net/core/neighbour.c:439 [inline] ___neigh_create+0x6f0/0x1a80 net/core/neighbour.c:592 __neigh_create+0x31/0x40 net/core/neighbour.c:680 ip6_finish_output2+0x934/0x1570 net/ipv6/ip6_output.c:126 __ip6_finish_output+0x5ff/0x790 net/ipv6/ip6_output.c:200 ip6_finish_output+0x33/0x1f0 net/ipv6/ip6_output.c:210 NF_HOOK_COND include/linux/netfilter.h:292 [inline] ip6_output+0x1bc/0x3a0 net/ipv6/ip6_output.c:233 dst_output include/net/dst.h:438 [inline] NF_HOOK include/linux/netfilter.h:303 [inline] ndisc_send_skb+0x71d/0xba0 net/ipv6/ndisc.c:513 ndisc_send_ns+0x842/0xaf0 net/ipv6/ndisc.c:655 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1176 [inline] __free_pages_ok+0x7e4/0x910 mm/page_alloc.c:1438 free_the_page mm/page_alloc.c:4956 [inline] __free_pages+0x8c/0x110 mm/page_alloc.c:4962 kfree+0x1ca/0x260 mm/slub.c:4068 kvfree+0x4c/0x50 mm/util.c:625 netdev_freemem+0x3f/0x60 net/core/dev.c:9583 netdev_release+0x7f/0xb0 net/core/net-sysfs.c:1743 device_release+0x70/0x1a0 drivers/base/core.c:1776 kobject_cleanup lib/kobject.c:716 [inline] kobject_release lib/kobject.c:747 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x1fe/0x2c0 lib/kobject.c:764 put_device+0x1f/0x30 drivers/base/core.c:3010 free_netdev+0x27e/0x320 net/core/dev.c:9746 tun_set_iff+0x87c/0xe00 drivers/net/tun.c:2924 __tun_chr_ioctl+0x771/0x18a0 drivers/net/tun.c:3187 tun_chr_ioctl+0x2a/0x40 drivers/net/tun.c:3470 do_vfs_ioctl+0x753/0x13f0 fs/ioctl.c:47 ksys_ioctl fs/ioctl.c:742 [inline] __do_sys_ioctl fs/ioctl.c:749 [inline] __se_sys_ioctl fs/ioctl.c:747 [inline] __x64_sys_ioctl+0xe1/0x120 fs/ioctl.c:747 do_syscall_64+0xcf/0x170 arch/x86/entry/common.c:290 Memory state around the buggy address: ffff8881ddb93080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881ddb93100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8881ddb93180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881ddb93200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8881ddb93280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== BUG: kernel NULL pointer dereference, address: 0000000000000000 #PF: supervisor instruction fetch in kernel mode #PF: error_code(0x0010) - not-present page PGD 0 P4D 0 Oops: 0010 [#1] PREEMPT SMP KASAN CPU: 0 PID: 0 Comm: swapper/0 Tainted: G B 5.4.292-syzkaller-00021-gcd8e74fa0fa3 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025 RIP: 0010:0x0 Code: Bad RIP value. RSP: 0018:ffff8881f6e09cf0 EFLAGS: 00010202 RAX: ffffffff8150a590 RBX: 0000000000000101 RCX: ffffffff85c1ad40 RDX: 0000000080000101 RSI: 0000000000000000 RDI: ffff8881ddb931c0 RBP: ffff8881f6e09d30 R08: 0000000000000004 R09: 0000000000000003 R10: ffffed103edc1398 R11: 1ffff1103edc1398 R12: 00000000ffffb0c0 R13: dffffc0000000000 R14: 0000000000000000 R15: ffff8881ddb931c0 FS: 0000000000000000(0000) GS:ffff8881f6e00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffffffffffffffd6 CR3: 0000000005c0e000 CR4: 00000000003406b0 DR0: 0000200000000300 DR1: 0000200000000300 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000ffff0ff1 DR7: 0000000000000600 Call Trace: call_timer_fn+0x3c/0x380 kernel/time/timer.c:1448 expire_timers kernel/time/timer.c:1493 [inline] __run_timers+0x81d/0xb60 kernel/time/timer.c:1817 run_timer_softirq+0x6a/0xf0 kernel/time/timer.c:1830 __do_softirq+0x236/0x660 kernel/softirq.c:292 invoke_softirq kernel/softirq.c:373 [inline] irq_exit+0x197/0x1c0 kernel/softirq.c:413 exiting_irq arch/x86/include/asm/apic.h:539 [inline] smp_apic_timer_interrupt+0x11d/0x490 arch/x86/kernel/apic/apic.c:1161 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:834 RIP: 0010:default_idle+0x23/0x40 arch/x86/kernel/process.c:578 Code: 90 90 00 00 90 90 00 55 48 89 e5 e8 87 b2 f5 fd bf 01 00 00 00 89 c6 e8 bb 1c fc fc 0f 1f 44 00 00 0f 00 2d cf c2 59 00 fb f4 68 b2 f5 fd bf ff ff ff ff 89 c6 e8 9c 1c fc fc 5d c3 66 2e 0f RSP: 0018:ffffffff85c07cc0 EFLAGS: 000002c6 ORIG_RAX: ffffffffffffff13 RAX: 0000000000000000 RBX: ffffffff85c1ad40 RCX: ffffffff85c1ad40 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000001 RBP: ffffffff85c07cc0 R08: dffffc0000000000 R09: fffffbfff0b835a9 R10: fffffbfff0b835a9 R11: 1ffffffff0b835a8 R12: 0000000000000000 R13: 1ffffffff0b835a8 R14: 0000000000000000 R15: ffffffff862bb528 arch_cpu_idle+0xa/0x10 arch/x86/kernel/process.c:568 default_idle_call kernel/sched/idle.c:94 [inline] cpuidle_idle_call kernel/sched/idle.c:154 [inline] do_idle+0x21d/0x550 kernel/sched/idle.c:264 cpu_startup_entry+0x18/0x20 kernel/sched/idle.c:356 rest_init+0xe8/0xf0 init/main.c:707 arch_call_rest_init+0xe/0x10 init/main.c:831 start_kernel+0x678/0x73e init/main.c:1036 x86_64_start_reservations+0x2a/0x2c arch/x86/kernel/head64.c:492 x86_64_start_kernel+0x60/0x63 arch/x86/kernel/head64.c:473 secondary_startup_64+0xa4/0xb0 arch/x86/kernel/head_64.S:241 Modules linked in: CR2: 0000000000000000 ---[ end trace 5d4b2761df3a91e8 ]--- RIP: 0010:0x0 Code: Bad RIP value. RSP: 0018:ffff8881f6e09cf0 EFLAGS: 00010202 RAX: ffffffff8150a590 RBX: 0000000000000101 RCX: ffffffff85c1ad40 RDX: 0000000080000101 RSI: 0000000000000000 RDI: ffff8881ddb931c0 RBP: ffff8881f6e09d30 R08: 0000000000000004 R09: 0000000000000003 R10: ffffed103edc1398 R11: 1ffff1103edc1398 R12: 00000000ffffb0c0 R13: dffffc0000000000 R14: 0000000000000000 R15: ffff8881ddb931c0 FS: 0000000000000000(0000) GS:ffff8881f6e00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffffffffffffffd6 CR3: 0000000005c0e000 CR4: 00000000003406b0 DR0: 0000200000000300 DR1: 0000200000000300 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000ffff0ff1 DR7: 0000000000000600 ---------------- Code disassembly (best guess): 0: 90 nop 1: 90 nop 2: 00 00 add %al,(%rax) 4: 90 nop 5: 90 nop 6: 00 55 48 add %dl,0x48(%rbp) 9: 89 e5 mov %esp,%ebp b: e8 87 b2 f5 fd call 0xfdf5b297 10: bf 01 00 00 00 mov $0x1,%edi 15: 89 c6 mov %eax,%esi 17: e8 bb 1c fc fc call 0xfcfc1cd7 1c: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) 21: 0f 00 2d cf c2 59 00 verw 0x59c2cf(%rip) # 0x59c2f7 28: fb sti 29: f4 hlt * 2a: e8 68 b2 f5 fd call 0xfdf5b297 <-- trapping instruction 2f: bf ff ff ff ff mov $0xffffffff,%edi 34: 89 c6 mov %eax,%esi 36: e8 9c 1c fc fc call 0xfcfc1cd7 3b: 5d pop %rbp 3c: c3 ret 3d: 66 data16 3e: 2e cs 3f: 0f .byte 0xf