==================================================================
BUG: KASAN: use-after-free in hlist_add_head include/linux/list.h:814 [inline]
BUG: KASAN: use-after-free in enqueue_timer+0xb7/0x300 kernel/time/timer.c:541
Write of size 8 at addr ffff8881ef0ff1c8 by task syz-executor/2472
CPU: 1 PID: 2472 Comm: syz-executor Not tainted 5.4.276-syzkaller-00020-g4275fce9fe94 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x1d8/0x241 lib/dump_stack.c:118
print_address_description+0x8c/0x600 mm/kasan/report.c:384
__kasan_report+0xf3/0x120 mm/kasan/report.c:516
kasan_report+0x30/0x60 mm/kasan/common.c:653
hlist_add_head include/linux/list.h:814 [inline]
enqueue_timer+0xb7/0x300 kernel/time/timer.c:541
__internal_add_timer kernel/time/timer.c:554 [inline]
internal_add_timer+0x240/0x430 kernel/time/timer.c:604
__mod_timer+0x6f1/0x13e0 kernel/time/timer.c:1065
call_timer_fn+0x36/0x390 kernel/time/timer.c:1448
expire_timers kernel/time/timer.c:1493 [inline]
__run_timers+0x879/0xbe0 kernel/time/timer.c:1817
run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1830
__do_softirq+0x23b/0x6b7 kernel/softirq.c:292
invoke_softirq kernel/softirq.c:373 [inline]
irq_exit+0x195/0x1c0 kernel/softirq.c:413
exiting_irq arch/x86/include/asm/apic.h:539 [inline]
smp_apic_timer_interrupt+0x11a/0x460 arch/x86/kernel/apic/apic.c:1149
apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:834
RIP: 0010:native_restore_fl arch/x86/include/asm/irqflags.h:41 [inline]
RIP: 0010:arch_local_irq_restore arch/x86/include/asm/irqflags.h:84 [inline]
RIP: 0010:console_unlock+0xa62/0xfa0 kernel/printk/printk.c:2527
Code: 03 84 db 4c 8d ac 24 00 01 00 00 0f 85 13 05 00 00 e8 52 e5 16 00 e8 5d 5f 00 00 48 8b 44 24 20 48 89 44 24 70 ff 74 24 70 9d 99 f7 ff ff e8 34 e5 16 00 48 c7 05 e9 79 9e 05 00 00 00 00 e9
RSP: 0018:ffff8881e932e720 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff13
RAX: 0000000000000246 RBX: 0000000000000000 RCX: ffff8881e55e5e80
RDX: 0000000000000000 RSI: 0000000000000004 RDI: 0000000000000001
RBP: ffff8881e932e8d0 R08: dffffc0000000000 R09: 0000000000000003
R10: ffffffffffffffff R11: dffffc0000000001 R12: dffffc0000000000
R13: ffff8881e932e820 R14: 0000000000000000 R15: ffffffff812ee800
vprintk_emit+0x1e0/0x3f0 kernel/printk/printk.c:2032
printk+0xd1/0x111 kernel/printk/printk.c:2092
new_nbp+0x447/0x5c0 net/bridge/br_if.c:431
br_add_if+0x28e/0x10c0 net/bridge/br_if.c:595
do_set_master net/core/rtnetlink.c:2413 [inline]
do_setlink+0xdf4/0x3b70 net/core/rtnetlink.c:2549
__rtnl_newlink net/core/rtnetlink.c:3188 [inline]
rtnl_newlink+0x16bc/0x2060 net/core/rtnetlink.c:3314
rtnetlink_rcv_msg+0x983/0xc70 net/core/rtnetlink.c:5290
netlink_rcv_skb+0x1d5/0x420 net/netlink/af_netlink.c:2481
netlink_unicast_kernel net/netlink/af_netlink.c:1321 [inline]
netlink_unicast+0x936/0xb20 net/netlink/af_netlink.c:1347
netlink_sendmsg+0xa18/0xcf0 net/netlink/af_netlink.c:1915
sock_sendmsg_nosec net/socket.c:638 [inline]
__sock_sendmsg net/socket.c:650 [inline]
__sys_sendto+0x4f3/0x6c0 net/socket.c:1961
__do_sys_sendto net/socket.c:1973 [inline]
__se_sys_sendto net/socket.c:1969 [inline]
__x64_sys_sendto+0xda/0xf0 net/socket.c:1969
do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290
entry_SYSCALL_64_after_hwframe+0x5c/0xc1
RIP: 0033:0x7f08d90858d3
Code: 64 89 02 48 c7 c0 ff ff ff ff eb b7 66 2e 0f 1f 84 00 00 00 00 00 90 80 3d 71 dc 15 00 00 41 89 ca 74 14 b8 2c 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 75 c3 0f 1f 40 00 55 48 83 ec 30 44 89 4c 24
RSP: 002b:00007ffd753cff48 EFLAGS: 00000202 ORIG_RAX: 000000000000002c
RAX: ffffffffffffffda RBX: 00007f08d9d42620 RCX: 00007f08d90858d3
RDX: 0000000000000028 RSI: 00007f08d9d42670 RDI: 0000000000000003
RBP: 0000000000000001 R08: 00007ffd753cff64 R09: 000000000000000c
R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000003
R13: 0000000000000000 R14: 00007f08d9d42670 R15: 0000000000000000
The buggy address belongs to the page:
page:ffffea0007bc3fc0 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0
flags: 0x8000000000000000()
raw: 8000000000000000 0000000000000000 ffffea0007bc3fc8 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 2, migratetype Unmovable, gfp_mask 0x146dc0(GFP_USER|__GFP_NOWARN|__GFP_RETRY_MAYFAIL|__GFP_COMP|__GFP_ZERO)
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook mm/page_alloc.c:2165 [inline]
prep_new_page+0x18f/0x370 mm/page_alloc.c:2171
get_page_from_freelist+0x2d13/0x2d90 mm/page_alloc.c:3794
__alloc_pages_nodemask+0x393/0x840 mm/page_alloc.c:4893
__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]
kmalloc_order mm/slab_common.c:1342 [inline]
kmalloc_order_trace+0x2a/0x100 mm/slab_common.c:1358
__kmalloc_node include/linux/slab.h:422 [inline]
kmalloc_node include/linux/slab.h:599 [inline]
kvmalloc_node+0x7e/0xf0 mm/util.c:596
kvmalloc include/linux/mm.h:761 [inline]
kvzalloc include/linux/mm.h:769 [inline]
alloc_netdev_mqs+0x85/0xc70 net/core/dev.c:9610
tun_set_iff+0x51f/0xdc0 drivers/net/tun.c:2890
__tun_chr_ioctl+0x8a9/0x1d00 drivers/net/tun.c:3184
do_vfs_ioctl+0x742/0x1720 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+0xd4/0x110 fs/ioctl.c:747
do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290
entry_SYSCALL_64_after_hwframe+0x5c/0xc1
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+0x847/0x950 mm/page_alloc.c:1438
free_the_page mm/page_alloc.c:4955 [inline]
__free_pages+0x91/0x140 mm/page_alloc.c:4961
device_release+0x6b/0x190 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+0x1e6/0x2f0 lib/kobject.c:764
tun_set_iff+0x870/0xdc0 drivers/net/tun.c:2921
__tun_chr_ioctl+0x8a9/0x1d00 drivers/net/tun.c:3184
do_vfs_ioctl+0x742/0x1720 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+0xd4/0x110 fs/ioctl.c:747
do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290
entry_SYSCALL_64_after_hwframe+0x5c/0xc1
Memory state around the buggy address:
ffff8881ef0ff080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff8881ef0ff100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff8881ef0ff180: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff8881ef0ff200: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff8881ef0ff280: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================
----------------
Code disassembly (best guess):
0: 03 84 db 4c 8d ac 24 add 0x24ac8d4c(%rbx,%rbx,8),%eax
7: 00 01 add %al,(%rcx)
9: 00 00 add %al,(%rax)
b: 0f 85 13 05 00 00 jne 0x524
11: e8 52 e5 16 00 call 0x16e568
16: e8 5d 5f 00 00 call 0x5f78
1b: 48 8b 44 24 20 mov 0x20(%rsp),%rax
20: 48 89 44 24 70 mov %rax,0x70(%rsp)
25: ff 74 24 70 push 0x70(%rsp)
29: 9d popf
* 2a: e9 99 f7 ff ff jmp 0xfffff7c8 <-- trapping instruction
2f: e8 34 e5 16 00 call 0x16e568
34: 48 c7 05 e9 79 9e 05 movq $0x0,0x59e79e9(%rip) # 0x59e7a28
3b: 00 00 00 00
3f: e9 .byte 0xe9