==================================================================
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 ffff8881d84c71c8 by task syz-executor110/523
CPU: 1 PID: 523 Comm: syz-executor110 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:memory_is_nonzero mm/kasan/generic.c:120 [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+0x162/0x280 mm/kasan/generic.c:191
Code: 00 00 00 41 29 db 4d 01 d9 4d 89 d6 4d 29 ce 4d 8d 7e 07 4d 85 f6 4d 0f 49 fe 49 c1 ef 03 45 85 ff 74 21 45 31 db 4b 8b 1c 19 <48> 85 db 75 42 49 83 c3 08 41 ff cf 75 ee 4d 29 ca 4d 29 da 4d 01
RSP: 0018:ffff8881d91e7cc8 EFLAGS: 00000202 ORIG_RAX: ffffffffffffff13
RAX: ffffffff82366f01 RBX: 0000000000000000 RCX: ffffffff82366faa
RDX: 0000000000000001 RSI: 0000000000000fe0 RDI: ffff8881ec915520
RBP: ffff8881d91e7ce0 R08: dffffc0000000000 R09: ffffed103d922aa8
R10: ffffed103d922ca0 R11: 0000000000000150 R12: ffff8881d99d3ad8
R13: 0000000000000fe0 R14: 00000000000001f8 R15: 0000000000000015
__kasan_check_write+0x14/0x20 mm/kasan/common.c:99
strncpy_from_user+0x9a/0x310 lib/strncpy_from_user.c:117
getname_flags+0xf4/0x500 fs/namei.c:152
getname+0x19/0x20 fs/namei.c:212
do_sys_open+0x26c/0x5d0 fs/open.c:1117
__do_sys_openat fs/open.c:1150 [inline]
__se_sys_openat fs/open.c:1144 [inline]
__x64_sys_openat+0xa2/0xb0 fs/open.c:1144
do_syscall_64+0xcf/0x170 arch/x86/entry/common.c:290
entry_SYSCALL_64_after_hwframe+0x5c/0xc1
RIP: 0033:0x7ff366f92509
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 18 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ff366f52218 EFLAGS: 00000246 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 00007ff36701d3c8 RCX: 00007ff366f92509
RDX: 0000000000000000 RSI: 0000200000000140 RDI: ffffffffffffff9c
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007ff36701d3c0
R13: 0000200000000040 R14: 00007ff366fea29c R15: 000020000000085c
The buggy address belongs to the page:
page:ffffea00076131c0 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0
flags: 0x8000000000000000()
raw: 8000000000000000 ffffea0007613308 ffffea0007613188 0000000000000000
raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as freed
page last allocated via order 0, migratetype Unmovable, gfp_mask 0x12cc2(GFP_KERNEL|__GFP_HIGHMEM|__GFP_NOWARN|__GFP_NORETRY)
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_pages include/linux/gfp.h:503 [inline]
__alloc_pages_node include/linux/gfp.h:516 [inline]
alloc_pages_node include/linux/gfp.h:530 [inline]
pcpu_alloc_pages mm/percpu-vm.c:94 [inline]
pcpu_populate_chunk+0x1b6/0xce0 mm/percpu-vm.c:284
pcpu_balance_workfn+0x1039/0x14b0 mm/percpu.c:1917
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
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_pcp_prepare mm/page_alloc.c:1233 [inline]
free_unref_page_prepare+0x2a9/0x3a0 mm/page_alloc.c:3085
free_unref_page mm/page_alloc.c:3134 [inline]
free_the_page mm/page_alloc.c:4954 [inline]
__free_pages+0xaa/0x110 mm/page_alloc.c:4962
pcpu_free_pages mm/percpu-vm.c:64 [inline]
pcpu_depopulate_chunk mm/percpu-vm.c:328 [inline]
pcpu_balance_workfn+0x8c7/0x14b0 mm/percpu.c:1865
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
Memory state around the buggy address:
ffff8881d84c7080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff8881d84c7100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff8881d84c7180: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff8881d84c7200: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff8881d84c7280: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================
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: 1 PID: 545 Comm: syz-executor110 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:ffff8881f6f09cf0 EFLAGS: 00010206
RAX: ffffffff8150a590 RBX: 0000000000000100 RCX: ffff8881ece78fc0
RDX: 0000000080000100 RSI: 0000000000000000 RDI: ffff8881d84c71c0
RBP: ffff8881f6f09d30 R08: 0000000000000004 R09: 0000000000000003
R10: ffffed103ede1398 R11: 1ffff1103ede1398 R12: 00000000ffff9500
R13: dffffc0000000000 R14: 0000000000000000 R15: ffff8881d84c71c0
FS: 00007ff366f526c0(0000) GS:ffff8881f6f00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffffffffd6 CR3: 00000001d8046000 CR4: 00000000003406a0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
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:unwind_next_frame+0x0/0x760 arch/x86/kernel/unwind_frame.c:261
Code: c0 08 5b 41 5e 41 5f 5d c3 89 d9 80 e1 07 80 c1 03 38 c1 7c 9b 48 89 df e8 5d dd 5f 00 eb 91 66 66 2e 0f 1f 84 00 00 00 00 00 <55> 48 89 e5 41 57 41 56 41 55 41 54 53 48 83 ec 58 48 89 fb 65 48
RSP: 0018:ffff8881ec5cf3e0 EFLAGS: 00000202 ORIG_RAX: ffffffffffffff13
RAX: ffffffff814fbd01 RBX: ffff8881ec5cf4a0 RCX: 0000000000000000
RDX: ffff8881ece78fc0 RSI: 0000000000000040 RDI: ffff8881ec5cf3e8
RBP: ffff8881ec5cf470 R08: dffffc0000000000 R09: ffff8881ec5cf3e8
R10: ffffed103d8b9e89 R11: 1ffff1103d8b9e7d R12: ffff8881ece78fc0
R13: 1ffff1103d8b9e90 R14: ffffffff814fbbf0 R15: ffff8881ec5cf3e8
stack_trace_save+0xaa/0xf0 kernel/stacktrace.c:123
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_kmalloc+0xd/0x20 mm/kasan/common.c:543
__kmalloc+0x12a/0x2f0 mm/slub.c:3913
kmalloc include/linux/slab.h:561 [inline]
kzalloc include/linux/slab.h:690 [inline]
kobject_get_path+0xbf/0x1f0 lib/kobject.c:184
kobject_uevent_env+0x289/0x6e0 lib/kobject_uevent.c:544
kobject_uevent+0x1d/0x30 lib/kobject_uevent.c:657
device_add+0x823/0xc90 drivers/base/core.c:2892
netdev_register_kobject+0x179/0x320 net/core/net-sysfs.c:1854
register_netdevice+0xbd4/0x12a0 net/core/dev.c:9209
tun_set_iff+0x812/0xe00 drivers/net/tun.c:2922
__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
entry_SYSCALL_64_after_hwframe+0x5c/0xc1
RIP: 0033:0x7ff366f92509
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 18 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ff366f52218 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007ff36701d3c8 RCX: 00007ff366f92509
RDX: 0000200000000080 RSI: 00000000400454ca RDI: 0000000000000006
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007ff36701d3c0
R13: 0000200000000040 R14: 00007ff366fea29c R15: 000020000000085c
Modules linked in:
CR2: 0000000000000000
---[ end trace 029e605c89d0b478 ]---
RIP: 0010:0x0
Code: Bad RIP value.
RSP: 0018:ffff8881f6f09cf0 EFLAGS: 00010206
RAX: ffffffff8150a590 RBX: 0000000000000100 RCX: ffff8881ece78fc0
RDX: 0000000080000100 RSI: 0000000000000000 RDI: ffff8881d84c71c0
RBP: ffff8881f6f09d30 R08: 0000000000000004 R09: 0000000000000003
R10: ffffed103ede1398 R11: 1ffff1103ede1398 R12: 00000000ffff9500
R13: dffffc0000000000 R14: 0000000000000000 R15: ffff8881d84c71c0
FS: 00007ff366f526c0(0000) GS:ffff8881f6f00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffffffffd6 CR3: 00000001d8046000 CR4: 00000000003406a0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess), 1 bytes skipped:
0: 00 00 add %al,(%rax)
2: 41 29 db sub %ebx,%r11d
5: 4d 01 d9 add %r11,%r9
8: 4d 89 d6 mov %r10,%r14
b: 4d 29 ce sub %r9,%r14
e: 4d 8d 7e 07 lea 0x7(%r14),%r15
12: 4d 85 f6 test %r14,%r14
15: 4d 0f 49 fe cmovns %r14,%r15
19: 49 c1 ef 03 shr $0x3,%r15
1d: 45 85 ff test %r15d,%r15d
20: 74 21 je 0x43
22: 45 31 db xor %r11d,%r11d
25: 4b 8b 1c 19 mov (%r9,%r11,1),%rbx
* 29: 48 85 db test %rbx,%rbx <-- trapping instruction
2c: 75 42 jne 0x70
2e: 49 83 c3 08 add $0x8,%r11
32: 41 ff cf dec %r15d
35: 75 ee jne 0x25
37: 4d 29 ca sub %r9,%r10
3a: 4d 29 da sub %r11,%r10
3d: 4d rex.WRB
3e: 01 .byte 0x1