==================================================================
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 ffff8881e8a771c8 by task syz-executor/1065
CPU: 0 PID: 1065 Comm: syz-executor 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
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:step_into+0x0/0x5a0 fs/namei.c:1845
Code: fe ff ff 48 8b 4c 24 28 80 e1 07 80 c1 03 38 c1 0f 8c 34 ff ff ff 48 8b 7c 24 28 e8 8a f3 f5 ff e9 25 ff ff ff 0f 1f 44 00 00 <55> 48 89 e5 41 57 41 56 41 55 41 54 53 48 83 ec 20 44 89 c3 48 89
RSP: 0018:ffff8881e96079d8 EFLAGS: 00000293 ORIG_RAX: ffffffffffffff13
RAX: ffffffff819760ce RBX: ffff8881e9607c80 RCX: ffff8881cbb48060
RDX: 0000000000000003 RSI: ffff8881e9607a40 RDI: ffff8881e9607c80
RBP: ffff8881e9607ab0 R08: 0000000000000002 R09: ffffed103d3f177e
R10: ffffed103d3f177e R11: 1ffff1103d3f177d R12: 0000000000000001
R13: 1ffff1103d2c0f44 R14: ffff8881e9607a40 R15: 0000000000000003
link_path_walk+0x5d0/0x1020 fs/namei.c:2210
path_parentat fs/namei.c:2441 [inline]
filename_parentat+0x1c1/0x570 fs/namei.c:2463
do_unlinkat+0xd6/0x670 fs/namei.c:4186
__do_sys_unlink fs/namei.c:4259 [inline]
__se_sys_unlink fs/namei.c:4257 [inline]
__x64_sys_unlink+0x49/0x50 fs/namei.c:4257
do_syscall_64+0xcf/0x170 arch/x86/entry/common.c:290
entry_SYSCALL_64_after_hwframe+0x5c/0xc1
RIP: 0033:0x7f7aefd04f17
Code: 73 01 c3 48 c7 c1 a8 ff ff ff 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 b8 57 00 00 00 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:00007fffcd55d5f8 EFLAGS: 00000206 ORIG_RAX: 0000000000000057
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f7aefd04f17
RDX: 00007fffcd55d620 RSI: 00007fffcd55d6b0 RDI: 00007fffcd55d6b0
RBP: 00007fffcd55d6b0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000100 R11: 0000000000000206 R12: 00007fffcd55e740
R13: 00007f7aefd8789d R14: 000000000000d21e R15: 00007fffcd55e780
Allocated by task 9:
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]
rtmsg_ifa+0xfa/0x1d0 net/ipv4/devinet.c:1928
__inet_del_ifa+0x7e8/0xd70 net/ipv4/devinet.c:442
inet_del_ifa net/ipv4/devinet.c:480 [inline]
inetdev_destroy net/ipv4/devinet.c:320 [inline]
inetdev_event+0x65a/0x1030 net/ipv4/devinet.c:1613
notifier_call_chain kernel/notifier.c:98 [inline]
__raw_notifier_call_chain kernel/notifier.c:399 [inline]
raw_notifier_call_chain+0xa0/0x120 kernel/notifier.c:406
call_netdevice_notifiers_info net/core/dev.c:1670 [inline]
call_netdevice_notifiers_extack net/core/dev.c:1682 [inline]
call_netdevice_notifiers net/core/dev.c:1696 [inline]
rollback_registered_many+0xa75/0xf40 net/core/dev.c:8650
unregister_netdevice_many+0x4b/0x290 net/core/dev.c:9805
ip_tunnel_delete_nets+0x343/0x390 net/ipv4/ip_tunnel.c:1129
erspan_exit_batch_net+0x22/0x30 net/ipv4/ip_gre.c:1727
ops_exit_list net/core/net_namespace.c:187 [inline]
cleanup_net+0x5fd/0xb40 net/core/net_namespace.c:612
process_one_work+0x73b/0xcc0 kernel/workqueue.c:2290
worker_thread+0xa5c/0x13b0 kernel/workqueue.c:2436
kthread+0x31e/0x3a0 kernel/kthread.c:288
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:354
Freed by task 9:
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
rtmsg_ifa+0x143/0x1d0 net/ipv4/devinet.c:1939
__inet_del_ifa+0x7e8/0xd70 net/ipv4/devinet.c:442
inet_del_ifa net/ipv4/devinet.c:480 [inline]
inetdev_destroy net/ipv4/devinet.c:320 [inline]
inetdev_event+0x65a/0x1030 net/ipv4/devinet.c:1613
notifier_call_chain kernel/notifier.c:98 [inline]
__raw_notifier_call_chain kernel/notifier.c:399 [inline]
raw_notifier_call_chain+0xa0/0x120 kernel/notifier.c:406
call_netdevice_notifiers_info net/core/dev.c:1670 [inline]
call_netdevice_notifiers_extack net/core/dev.c:1682 [inline]
call_netdevice_notifiers net/core/dev.c:1696 [inline]
rollback_registered_many+0xa75/0xf40 net/core/dev.c:8650
unregister_netdevice_many+0x4b/0x290 net/core/dev.c:9805
ip_tunnel_delete_nets+0x343/0x390 net/ipv4/ip_tunnel.c:1129
erspan_exit_batch_net+0x22/0x30 net/ipv4/ip_gre.c:1727
ops_exit_list net/core/net_namespace.c:187 [inline]
cleanup_net+0x5fd/0xb40 net/core/net_namespace.c:612
process_one_work+0x73b/0xcc0 kernel/workqueue.c:2290
worker_thread+0xa5c/0x13b0 kernel/workqueue.c:2436
kthread+0x31e/0x3a0 kernel/kthread.c:288
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:354
The buggy address belongs to the object at ffff8881e8a77000
which belongs to the cache kmalloc-512 of size 512
The buggy address is located 456 bytes inside of
512-byte region [ffff8881e8a77000, ffff8881e8a77200)
The buggy address belongs to the page:
page:ffffea0007a29d00 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 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__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_track_caller+0x17c/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]
inet_netconf_notify_devconf+0x169/0x220 net/ipv4/devinet.c:2121
__devinet_sysctl_unregister net/ipv4/devinet.c:2629 [inline]
devinet_sysctl_unregister net/ipv4/devinet.c:2653 [inline]
inetdev_destroy net/ipv4/devinet.c:326 [inline]
inetdev_event+0x7c6/0x1030 net/ipv4/devinet.c:1613
notifier_call_chain kernel/notifier.c:98 [inline]
__raw_notifier_call_chain kernel/notifier.c:399 [inline]
raw_notifier_call_chain+0xa0/0x120 kernel/notifier.c:406
call_netdevice_notifiers_info net/core/dev.c:1670 [inline]
call_netdevice_notifiers_extack net/core/dev.c:1682 [inline]
call_netdevice_notifiers net/core/dev.c:1696 [inline]
rollback_registered_many+0xa75/0xf40 net/core/dev.c:8650
unregister_netdevice_many+0x4b/0x290 net/core/dev.c:9805
ip_tunnel_delete_nets+0x343/0x390 net/ipv4/ip_tunnel.c:1129
erspan_exit_batch_net+0x22/0x30 net/ipv4/ip_gre.c:1727
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:
ffff8881e8a77080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8881e8a77100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8881e8a77180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff8881e8a77200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff8881e8a77280: 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 1cb5dd067 P4D 1cb5dd067 PUD 0
Oops: 0010 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 1251 Comm: syz.7.212 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: 00010206
RAX: ffffffff8150a590 RBX: 0000000000000100 RCX: ffff8881caea1f80
RDX: 0000000080000100 RSI: 0000000000000000 RDI: ffff8881e8a771c0
RBP: ffff8881f6e09d30 R08: 0000000000000004 R09: 0000000000000003
R10: ffffed103edc1398 R11: 1ffff1103edc1398 R12: 00000000ffff9ff0
R13: dffffc0000000000 R14: 0000000000000000 R15: ffff8881e8a771c0
FS: 00007f7aee36e6c0(0000) GS:ffff8881f6e00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffffffffd6 CR3: 00000001d4ba0000 CR4: 00000000003406b0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 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:bytes_is_nonzero mm/kasan/generic.c:90 [inline]
RIP: 0010:memory_is_nonzero mm/kasan/generic.c:108 [inline]
RIP: 0010:memory_is_poisoned_n mm/kasan/generic.c:134 [inline]
RIP: 0010:memory_is_poisoned mm/kasan/generic.c:165 [inline]
RIP: 0010:check_memory_region_inline mm/kasan/generic.c:181 [inline]
RIP: 0010:check_memory_region+0x6c/0x280 mm/kasan/generic.c:191
Code: df 4f 8d 0c 03 48 8d 5c 37 ff 48 c1 eb 03 4e 8d 14 3b 4d 89 d6 4d 29 ce 49 83 fe 10 7f 26 4d 85 f6 0f 84 39 01 00 00 48 f7 d3 <4c> 01 db 41 80 39 00 0f 85 c2 01 00 00 49 ff c1 48 ff c3 75 ee e9
RSP: 0018:ffff8881cacf7230 EFLAGS: 00000202 ORIG_RAX: ffffffffffffff13
RAX: 0000000000001001 RBX: e0000eefc6896e91 RCX: ffffffff8147feb0
RDX: 0000000000000001 RSI: 0000000000000008 RDI: ffff8881cbb48b70
RBP: ffff8881cacf7248 R08: dffffc0000000000 R09: ffffed103976916e
R10: ffffed103976916f R11: 1ffff1103976916e R12: 1ffff1103959ee78
R13: dffffc0000000000 R14: 0000000000000001 R15: dffffc0000000001
__kasan_check_write+0x14/0x20 mm/kasan/common.c:99
atomic64_set include/asm-generic/atomic-instrumented.h:854 [inline]
atomic_long_set include/asm-generic/atomic-long.h:40 [inline]
rwsem_clear_owner kernel/locking/rwsem.c:185 [inline]
__up_write kernel/locking/rwsem.c:1495 [inline]
up_write+0x30/0x160 kernel/locking/rwsem.c:1636
inode_unlock include/linux/fs.h:830 [inline]
generic_file_write_iter+0x499/0x620 mm/filemap.c:3612
call_write_iter include/linux/fs.h:1991 [inline]
new_sync_write fs/read_write.c:483 [inline]
__vfs_write+0x480/0x5d0 fs/read_write.c:496
__kernel_write+0xea/0x320 fs/read_write.c:515
dump_emit+0x1c0/0x2c0 fs/coredump.c:838
elf_core_dump+0x3465/0x3bd0 fs/binfmt_elf.c:2352
do_coredump+0x1d8c/0x2ab0 fs/coredump.c:801
get_signal+0xdb7/0x13d0 kernel/signal.c:2732
do_signal+0xad/0xda0 arch/x86/kernel/signal.c:809
exit_to_usermode_loop+0xc4/0x1b0 arch/x86/entry/common.c:159
prepare_exit_to_usermode+0x18e/0x1f0 arch/x86/entry/common.c:194
ret_from_intr+0x1c/0x1c
RIP: 0033:0x7f7aefd05971
Code: 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 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f
RSP: 002b:0000200000000430 EFLAGS: 00010217
RAX: 0000000000000000 RBX: 00007f7aeff2cfa0 RCX: 00007f7aefd05969
RDX: 00002000000000c0 RSI: 0000200000000430 RDI: 0000000000100000
RBP: 00007f7aefd87ab1 R08: 0000200000000180 R09: 0000200000000180
R10: 0000200000000100 R11: 0000000000000206 R12: 0000000000000000
R13: 0000000000000001 R14: 00007f7aeff2cfa0 R15: 00007fffcd55e368
Modules linked in:
CR2: 0000000000000000
---[ end trace b44bfb7e4c0f07d0 ]---
RIP: 0010:0x0
Code: Bad RIP value.
RSP: 0018:ffff8881f6e09cf0 EFLAGS: 00010206
RAX: ffffffff8150a590 RBX: 0000000000000100 RCX: ffff8881caea1f80
RDX: 0000000080000100 RSI: 0000000000000000 RDI: ffff8881e8a771c0
RBP: ffff8881f6e09d30 R08: 0000000000000004 R09: 0000000000000003
R10: ffffed103edc1398 R11: 1ffff1103edc1398 R12: 00000000ffff9ff0
R13: dffffc0000000000 R14: 0000000000000000 R15: ffff8881e8a771c0
FS: 00007f7aee36e6c0(0000) GS:ffff8881f6e00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffffffffd6 CR3: 00000001d4ba0000 CR4: 00000000003406b0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000600
----------------
Code disassembly (best guess), 2 bytes skipped:
0: ff 48 8b decl -0x75(%rax)
3: 4c 24 28 rex.WR and $0x28,%al
6: 80 e1 07 and $0x7,%cl
9: 80 c1 03 add $0x3,%cl
c: 38 c1 cmp %al,%cl
e: 0f 8c 34 ff ff ff jl 0xffffff48
14: 48 8b 7c 24 28 mov 0x28(%rsp),%rdi
19: e8 8a f3 f5 ff call 0xfff5f3a8
1e: e9 25 ff ff ff jmp 0xffffff48
23: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1)
* 28: 55 push %rbp <-- trapping instruction
29: 48 89 e5 mov %rsp,%rbp
2c: 41 57 push %r15
2e: 41 56 push %r14
30: 41 55 push %r13
32: 41 54 push %r12
34: 53 push %rbx
35: 48 83 ec 20 sub $0x20,%rsp
39: 44 89 c3 mov %r8d,%ebx
3c: 48 rex.W
3d: 89 .byte 0x89