==================================================================
BUG: KASAN: slab-use-after-free in advance_sched+0xc20/0xca0 net/sched/sch_taprio.c:942
Read of size 8 at addr ffff888024af7510 by task syz-executor.0/23613
CPU: 0 PID: 23613 Comm: syz-executor.0 Not tainted 6.8.0-syzkaller-05271-gf99c5f563c17 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x1e7/0x2e0 lib/dump_stack.c:106
print_address_description mm/kasan/report.c:377 [inline]
print_report+0x169/0x550 mm/kasan/report.c:488
kasan_report+0x143/0x180 mm/kasan/report.c:601
advance_sched+0xc20/0xca0 net/sched/sch_taprio.c:942
__run_hrtimer kernel/time/hrtimer.c:1692 [inline]
__hrtimer_run_queues+0x595/0xd00 kernel/time/hrtimer.c:1756
hrtimer_interrupt+0x396/0x990 kernel/time/hrtimer.c:1818
local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1032 [inline]
__sysvec_apic_timer_interrupt+0x107/0x3a0 arch/x86/kernel/apic/apic.c:1049
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline]
sysvec_apic_timer_interrupt+0xa1/0xc0 arch/x86/kernel/apic/apic.c:1043
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
RIP: 0010:check_kcov_mode kernel/kcov.c:184 [inline]
RIP: 0010:write_comp_data kernel/kcov.c:236 [inline]
RIP: 0010:__sanitizer_cov_trace_const_cmp8+0x35/0x90 kernel/kcov.c:311
Code: 0c 25 80 ce 03 00 65 8b 05 20 d9 6e 7e a9 00 01 ff 00 74 10 a9 00 01 00 00 74 57 83 b9 14 16 00 00 00 74 4e 8b 81 f0 15 00 00 <83> f8 03 75 43 48 8b 91 f8 15 00 00 44 8b 89 f4 15 00 00 49 c1 e1
RSP: 0018:ffffc900035dfd98 EFLAGS: 00000246
RAX: 0000000000000000 RBX: ffff88807529b350 RCX: ffff888075299e00
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffffc900035dfec8 R08: ffffffff81c90de2 R09: 1ffffffff1f0d5cd
R10: dffffc0000000000 R11: fffffbfff1f0d5ce R12: 0000000000000000
R13: ffffc900035dffd8 R14: 00000000ffffffff R15: 0000000000000000
rseq_get_rseq_cs kernel/rseq.c:161 [inline]
rseq_ip_fixup kernel/rseq.c:281 [inline]
__rseq_handle_notify_resume+0x172/0x1490 kernel/rseq.c:329
rseq_handle_notify_resume include/linux/rseq.h:38 [inline]
resume_user_mode_work include/linux/resume_user_mode.h:62 [inline]
exit_to_user_mode_loop kernel/entry/common.c:108 [inline]
exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline]
__syscall_exit_to_user_mode_work kernel/entry/common.c:201 [inline]
syscall_exit_to_user_mode+0x114/0x360 kernel/entry/common.c:212
do_syscall_64+0x10a/0x240 arch/x86/entry/common.c:89
entry_SYSCALL_64_after_hwframe+0x6d/0x75
RIP: 0033:0x7f9bf66a9275
Code: 24 0c 89 3c 24 48 89 4c 24 18 e8 f6 b9 ff ff 4c 8b 54 24 18 48 8b 54 24 10 41 89 c0 8b 74 24 0c 8b 3c 24 b8 e6 00 00 00 0f 05 <44> 89 c7 48 89 04 24 e8 4f ba ff ff 48 8b 04 24 48 83 c4 28 f7 d8
RSP: 002b:00007fff54693080 EFLAGS: 00000293 ORIG_RAX: 00000000000000e6
RAX: 0000000000000000 RBX: 0000000000000081 RCX: 00007f9bf66a9275
RDX: 00007fff546930c0 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 00007fff5469314c R08: 0000000000000000 R09: 00007f9bf738c0b0
R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000032
R13: 000000000007ec85 R14: 000000000007ec3c R15: 0000000000000018
Allocated by task 24552:
kasan_save_stack mm/kasan/common.c:47 [inline]
kasan_save_track+0x3f/0x80 mm/kasan/common.c:68
poison_kmalloc_redzone mm/kasan/common.c:370 [inline]
__kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:387
kasan_kmalloc include/linux/kasan.h:211 [inline]
kmalloc_trace+0x1d9/0x360 mm/slub.c:4012
kmalloc include/linux/slab.h:590 [inline]
kzalloc include/linux/slab.h:711 [inline]
taprio_change+0x1030/0x42d0 net/sched/sch_taprio.c:1862
qdisc_change net/sched/sch_api.c:1416 [inline]
tc_modify_qdisc+0x190d/0x1e40 net/sched/sch_api.c:1746
rtnetlink_rcv_msg+0x89b/0x10d0 net/core/rtnetlink.c:6595
netlink_rcv_skb+0x1e3/0x430 net/netlink/af_netlink.c:2559
netlink_unicast_kernel net/netlink/af_netlink.c:1335 [inline]
netlink_unicast+0x7ea/0x980 net/netlink/af_netlink.c:1361
netlink_sendmsg+0x8e1/0xcb0 net/netlink/af_netlink.c:1905
sock_sendmsg_nosec net/socket.c:730 [inline]
__sock_sendmsg+0x221/0x270 net/socket.c:745
____sys_sendmsg+0x525/0x7d0 net/socket.c:2584
___sys_sendmsg net/socket.c:2638 [inline]
__sys_sendmmsg+0x3b2/0x740 net/socket.c:2724
__do_sys_sendmmsg net/socket.c:2753 [inline]
__se_sys_sendmmsg net/socket.c:2750 [inline]
__x64_sys_sendmmsg+0xa0/0xb0 net/socket.c:2750
do_syscall_64+0xfb/0x240
entry_SYSCALL_64_after_hwframe+0x6d/0x75
Freed by task 19698:
kasan_save_stack mm/kasan/common.c:47 [inline]
kasan_save_track+0x3f/0x80 mm/kasan/common.c:68
kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:589
poison_slab_object+0xa6/0xe0 mm/kasan/common.c:240
__kasan_slab_free+0x37/0x60 mm/kasan/common.c:256
kasan_slab_free include/linux/kasan.h:184 [inline]
slab_free_hook mm/slub.c:2121 [inline]
slab_free mm/slub.c:4299 [inline]
kfree+0x14a/0x380 mm/slub.c:4409
rcu_do_batch kernel/rcu/tree.c:2196 [inline]
rcu_core+0xafd/0x1830 kernel/rcu/tree.c:2471
__do_softirq+0x2bc/0x943 kernel/softirq.c:554
Last potentially related work creation:
kasan_save_stack+0x3f/0x60 mm/kasan/common.c:47
__kasan_record_aux_stack+0xac/0xc0 mm/kasan/generic.c:551
__call_rcu_common kernel/rcu/tree.c:2734 [inline]
call_rcu+0x167/0xa70 kernel/rcu/tree.c:2838
taprio_change+0x32d9/0x42d0 net/sched/sch_taprio.c:1972
qdisc_change net/sched/sch_api.c:1416 [inline]
tc_modify_qdisc+0x190d/0x1e40 net/sched/sch_api.c:1746
rtnetlink_rcv_msg+0x89b/0x10d0 net/core/rtnetlink.c:6595
netlink_rcv_skb+0x1e3/0x430 net/netlink/af_netlink.c:2559
netlink_unicast_kernel net/netlink/af_netlink.c:1335 [inline]
netlink_unicast+0x7ea/0x980 net/netlink/af_netlink.c:1361
netlink_sendmsg+0x8e1/0xcb0 net/netlink/af_netlink.c:1905
sock_sendmsg_nosec net/socket.c:730 [inline]
__sock_sendmsg+0x221/0x270 net/socket.c:745
____sys_sendmsg+0x525/0x7d0 net/socket.c:2584
___sys_sendmsg net/socket.c:2638 [inline]
__sys_sendmmsg+0x3b2/0x740 net/socket.c:2724
__do_sys_sendmmsg net/socket.c:2753 [inline]
__se_sys_sendmmsg net/socket.c:2750 [inline]
__x64_sys_sendmmsg+0xa0/0xb0 net/socket.c:2750
do_syscall_64+0xfb/0x240
entry_SYSCALL_64_after_hwframe+0x6d/0x75
The buggy address belongs to the object at ffff888024af7400
which belongs to the cache kmalloc-512 of size 512
The buggy address is located 272 bytes inside of
freed 512-byte region [ffff888024af7400, ffff888024af7600)
The buggy address belongs to the physical page:
page:ffffea000092bd00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x24af4
head:ffffea000092bd00 order:2 entire_mapcount:0 nr_pages_mapped:0 pincount:0
flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000000840 ffff888014c41c80 dead000000000100 dead000000000122
raw: 0000000000000000 0000000080100010 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5082, tgid 5082 (syz-executor.0), ts 55797251688, free_ts 55656475488
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x1ea/0x210 mm/page_alloc.c:1533
prep_new_page mm/page_alloc.c:1540 [inline]
get_page_from_freelist+0x33ea/0x3580 mm/page_alloc.c:3311
__alloc_pages+0x256/0x680 mm/page_alloc.c:4569
__alloc_pages_node include/linux/gfp.h:238 [inline]
alloc_pages_node include/linux/gfp.h:261 [inline]
alloc_slab_page+0x5f/0x160 mm/slub.c:2190
allocate_slab mm/slub.c:2354 [inline]
new_slab+0x84/0x2f0 mm/slub.c:2407
___slab_alloc+0xd1b/0x13e0 mm/slub.c:3540
__slab_alloc mm/slub.c:3625 [inline]
__slab_alloc_node mm/slub.c:3678 [inline]
slab_alloc_node mm/slub.c:3850 [inline]
__do_kmalloc_node mm/slub.c:3980 [inline]
__kmalloc+0x2e3/0x4a0 mm/slub.c:3994
kmalloc include/linux/slab.h:594 [inline]
kzalloc include/linux/slab.h:711 [inline]
alloc_workqueue+0x1b0/0x20c0 kernel/workqueue.c:5542
wg_newlink+0x1a8/0x640 drivers/net/wireguard/device.c:333
rtnl_newlink_create net/core/rtnetlink.c:3494 [inline]
__rtnl_newlink net/core/rtnetlink.c:3714 [inline]
rtnl_newlink+0x158f/0x20a0 net/core/rtnetlink.c:3727
rtnetlink_rcv_msg+0x89b/0x10d0 net/core/rtnetlink.c:6595
netlink_rcv_skb+0x1e3/0x430 net/netlink/af_netlink.c:2559
netlink_unicast_kernel net/netlink/af_netlink.c:1335 [inline]
netlink_unicast+0x7ea/0x980 net/netlink/af_netlink.c:1361
netlink_sendmsg+0x8e1/0xcb0 net/netlink/af_netlink.c:1905
sock_sendmsg_nosec net/socket.c:730 [inline]
__sock_sendmsg+0x221/0x270 net/socket.c:745
__sys_sendto+0x3a4/0x4f0 net/socket.c:2191
page last free pid 5079 tgid 5079 stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1140 [inline]
free_unref_page_prepare+0x968/0xa90 mm/page_alloc.c:2346
free_unref_page+0x37/0x3f0 mm/page_alloc.c:2486
__slab_free+0x349/0x410 mm/slub.c:4211
qlink_free mm/kasan/quarantine.c:163 [inline]
qlist_free_all+0x5e/0xc0 mm/kasan/quarantine.c:179
kasan_quarantine_reduce+0x14f/0x170 mm/kasan/quarantine.c:286
__kasan_slab_alloc+0x23/0x80 mm/kasan/common.c:322
kasan_slab_alloc include/linux/kasan.h:201 [inline]
slab_post_alloc_hook mm/slub.c:3813 [inline]
slab_alloc_node mm/slub.c:3860 [inline]
kmalloc_trace+0x16d/0x360 mm/slub.c:4007
kmalloc include/linux/slab.h:590 [inline]
kzalloc include/linux/slab.h:711 [inline]
ref_tracker_alloc+0x14b/0x490 lib/ref_tracker.c:203
__netdev_tracker_alloc include/linux/netdevice.h:4064 [inline]
netdev_hold include/linux/netdevice.h:4093 [inline]
rx_queue_add_kobject net/core/net-sysfs.c:1102 [inline]
net_rx_queue_update_kobjects+0x16b/0x5b0 net/core/net-sysfs.c:1160
register_queue_kobjects net/core/net-sysfs.c:1895 [inline]
netdev_register_kobject+0x224/0x320 net/core/net-sysfs.c:2140
register_netdevice+0x1208/0x1a20 net/core/dev.c:10277
veth_newlink+0x84f/0xcd0 drivers/net/veth.c:1859
rtnl_newlink_create net/core/rtnetlink.c:3494 [inline]
__rtnl_newlink net/core/rtnetlink.c:3714 [inline]
rtnl_newlink+0x158f/0x20a0 net/core/rtnetlink.c:3727
rtnetlink_rcv_msg+0x89b/0x10d0 net/core/rtnetlink.c:6595
netlink_rcv_skb+0x1e3/0x430 net/netlink/af_netlink.c:2559
netlink_unicast_kernel net/netlink/af_netlink.c:1335 [inline]
netlink_unicast+0x7ea/0x980 net/netlink/af_netlink.c:1361
Memory state around the buggy address:
ffff888024af7400: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888024af7480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888024af7500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888024af7580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888024af7600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================
----------------
Code disassembly (best guess):
0: 0c 25 or $0x25,%al
2: 80 ce 03 or $0x3,%dh
5: 00 65 8b add %ah,-0x75(%rbp)
8: 05 20 d9 6e 7e add $0x7e6ed920,%eax
d: a9 00 01 ff 00 test $0xff0100,%eax
12: 74 10 je 0x24
14: a9 00 01 00 00 test $0x100,%eax
19: 74 57 je 0x72
1b: 83 b9 14 16 00 00 00 cmpl $0x0,0x1614(%rcx)
22: 74 4e je 0x72
24: 8b 81 f0 15 00 00 mov 0x15f0(%rcx),%eax
* 2a: 83 f8 03 cmp $0x3,%eax <-- trapping instruction
2d: 75 43 jne 0x72
2f: 48 8b 91 f8 15 00 00 mov 0x15f8(%rcx),%rdx
36: 44 8b 89 f4 15 00 00 mov 0x15f4(%rcx),%r9d
3d: 49 rex.WB
3e: c1 .byte 0xc1
3f: e1 .byte 0xe1