[v6.1] KASAN: use-after-free Read in qfq_reset_qdisc

4 views
Skip to first unread message

syzbot

unread,
Dec 27, 2025, 4:38:20 AM (3 days ago) Dec 27
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 50cbba13faa2 Linux 6.1.159
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=13e75022580000
kernel config: https://syzkaller.appspot.com/x/.config?x=31ea1cecaf34f0db
dashboard link: https://syzkaller.appspot.com/bug?extid=415e52ffab7b2b45778b
compiler: Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8
userspace arch: arm64

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/7ad0bd66715a/disk-50cbba13.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/3284d626258e/vmlinux-50cbba13.xz
kernel image: https://storage.googleapis.com/syzbot-assets/a1f92ca7bbfc/Image-50cbba13.gz.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+415e52...@syzkaller.appspotmail.com

==================================================================
BUG: KASAN: use-after-free in qfq_reset_qdisc+0xcc/0x208 net/sched/sch_qfq.c:1486
Read of size 8 at addr ffff0000f495c050 by task syz.2.393/6248

CPU: 1 PID: 6248 Comm: syz.2.393 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/03/2025
Call trace:
dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158
show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165
__dump_stack+0x30/0x40 lib/dump_stack.c:88
dump_stack_lvl+0xf8/0x160 lib/dump_stack.c:106
print_address_description+0x88/0x218 mm/kasan/report.c:316
print_report+0x50/0x68 mm/kasan/report.c:420
kasan_report+0xa8/0x100 mm/kasan/report.c:524
__asan_report_load8_noabort+0x2c/0x38 mm/kasan/report_generic.c:351
qfq_reset_qdisc+0xcc/0x208 net/sched/sch_qfq.c:1486
qdisc_reset+0x134/0x604 net/sched/sch_generic.c:1038
__qdisc_destroy+0x100/0x500 net/sched/sch_generic.c:1076
qdisc_put net/sched/sch_generic.c:1107 [inline]
dev_shutdown+0x35c/0x47c net/sched/sch_generic.c:1495
unregister_netdevice_many+0x944/0x1740 net/core/dev.c:10981
unregister_netdevice_queue+0x2ac/0x2f8 net/core/dev.c:10921
unregister_netdevice include/linux/netdevice.h:3075 [inline]
__tun_detach+0xb04/0x122c drivers/net/tun.c:685
tun_detach drivers/net/tun.c:701 [inline]
tun_chr_close+0x118/0x1f8 drivers/net/tun.c:3492
__fput+0x1bc/0x7c0 fs/file_table.c:320
____fput+0x20/0x30 fs/file_table.c:348
task_work_run+0x1ec/0x270 kernel/task_work.c:203
resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
do_notify_resume+0x2038/0x2b28 arch/arm64/kernel/signal.c:1137
prepare_exit_to_user_mode arch/arm64/kernel/entry-common.c:137 [inline]
exit_to_user_mode arch/arm64/kernel/entry-common.c:142 [inline]
el0_svc+0x98/0x138 arch/arm64/kernel/entry-common.c:638
el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585

Allocated by task 6250:
kasan_save_stack mm/kasan/common.c:45 [inline]
kasan_set_track+0x4c/0x80 mm/kasan/common.c:52
kasan_save_alloc_info+0x28/0x34 mm/kasan/generic.c:505
____kasan_kmalloc mm/kasan/common.c:374 [inline]
__kasan_kmalloc+0xa0/0xb8 mm/kasan/common.c:383
kasan_kmalloc include/linux/kasan.h:211 [inline]
kmalloc_trace+0x7c/0x94 mm/slab_common.c:1031
kmalloc include/linux/slab.h:563 [inline]
kzalloc include/linux/slab.h:699 [inline]
qfq_change_class+0x358/0xa68 net/sched/sch_qfq.c:483
tc_ctl_tclass+0x840/0xb34 net/sched/sch_api.c:2202
rtnetlink_rcv_msg+0x734/0xce4 net/core/rtnetlink.c:6150
netlink_rcv_skb+0x208/0x3c4 net/netlink/af_netlink.c:2511
rtnetlink_rcv+0x28/0x38 net/core/rtnetlink.c:6168
netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline]
netlink_unicast+0x60c/0x824 net/netlink/af_netlink.c:1344
netlink_sendmsg+0x6e8/0x9b0 net/netlink/af_netlink.c:1872
sock_sendmsg_nosec net/socket.c:718 [inline]
__sock_sendmsg net/socket.c:730 [inline]
____sys_sendmsg+0x5b8/0x918 net/socket.c:2519
___sys_sendmsg net/socket.c:2573 [inline]
__sys_sendmsg+0x25c/0x320 net/socket.c:2602
__do_sys_sendmsg net/socket.c:2611 [inline]
__se_sys_sendmsg net/socket.c:2609 [inline]
__arm64_sys_sendmsg+0x80/0x94 net/socket.c:2609
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2bc arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140
do_el0_svc+0x58/0x13c arch/arm64/kernel/syscall.c:204
el0_svc+0x58/0x138 arch/arm64/kernel/entry-common.c:637
el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585

Freed by task 6250:
kasan_save_stack mm/kasan/common.c:45 [inline]
kasan_set_track+0x4c/0x80 mm/kasan/common.c:52
kasan_save_free_info+0x3c/0x60 mm/kasan/generic.c:516
____kasan_slab_free+0x148/0x1b0 mm/kasan/common.c:236
__kasan_slab_free+0x18/0x28 mm/kasan/common.c:244
kasan_slab_free include/linux/kasan.h:177 [inline]
slab_free_hook mm/slub.c:1729 [inline]
slab_free_freelist_hook+0x16c/0x1ec mm/slub.c:1755
slab_free mm/slub.c:3687 [inline]
__kmem_cache_free+0xc0/0x224 mm/slub.c:3700
kfree+0xd0/0x1ac mm/slab_common.c:988
qfq_change_class+0x818/0xa68 net/sched/sch_qfq.c:537
tc_ctl_tclass+0x840/0xb34 net/sched/sch_api.c:2202
rtnetlink_rcv_msg+0x734/0xce4 net/core/rtnetlink.c:6150
netlink_rcv_skb+0x208/0x3c4 net/netlink/af_netlink.c:2511
rtnetlink_rcv+0x28/0x38 net/core/rtnetlink.c:6168
netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline]
netlink_unicast+0x60c/0x824 net/netlink/af_netlink.c:1344
netlink_sendmsg+0x6e8/0x9b0 net/netlink/af_netlink.c:1872
sock_sendmsg_nosec net/socket.c:718 [inline]
__sock_sendmsg net/socket.c:730 [inline]
____sys_sendmsg+0x5b8/0x918 net/socket.c:2519
___sys_sendmsg net/socket.c:2573 [inline]
__sys_sendmsg+0x25c/0x320 net/socket.c:2602
__do_sys_sendmsg net/socket.c:2611 [inline]
__se_sys_sendmsg net/socket.c:2609 [inline]
__arm64_sys_sendmsg+0x80/0x94 net/socket.c:2609
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2bc arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140
do_el0_svc+0x58/0x13c arch/arm64/kernel/syscall.c:204
el0_svc+0x58/0x138 arch/arm64/kernel/entry-common.c:637
el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585

The buggy address belongs to the object at ffff0000f495c000
which belongs to the cache kmalloc-128 of size 128
The buggy address is located 80 bytes inside of
128-byte region [ffff0000f495c000, ffff0000f495c080)

The buggy address belongs to the physical page:
page:00000000cde5c9c0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x13495c
flags: 0x5ffc00000000200(slab|node=0|zone=2|lastcpupid=0x7ff)
raw: 05ffc00000000200 fffffc0003d73000 dead000000000004 ffff0000c0002300
raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff0000f495bf00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff0000f495bf80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff0000f495c000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff0000f495c080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff0000f495c100: 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================
Unable to handle kernel paging request at virtual address e09a009a20000316
KASAN: maybe wild-memory-access in range [0x04d404d1000018b0-0x04d404d1000018b7]
Mem abort info:
ESR = 0x0000000096000004
EC = 0x25: DABT (current EL), IL = 32 bits
SET = 0, FnV = 0
EA = 0, S1PTW = 0
FSC = 0x04: level 0 translation fault
Data abort info:
ISV = 0, ISS = 0x00000004
CM = 0, WnR = 0
[e09a009a20000316] address between user and kernel address ranges
Internal error: Oops: 0000000096000004 [#1] PREEMPT SMP
Modules linked in:
CPU: 0 PID: 6248 Comm: syz.2.393 Tainted: G B syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/03/2025
pstate: 82400005 (Nzcv daif +PAN -UAO +TCO -DIT -SSBS BTYPE=--)
pc : qfq_reset_qdisc+0xbc/0x208 net/sched/sch_qfq.c:1486
lr : qfq_reset_qdisc+0x158/0x208 net/sched/sch_qfq.c:1485
sp : ffff8000219d75a0
x29: ffff8000219d75b0 x28: 0000000000000000 x27: 1fffe00019d0305a
x26: 009a809a20000316 x25: dfff800000000000 x24: 0000000000000000
x23: 04d404d1000018b2 x22: 04d404d100001862 x21: ffff0000ce8182d0
x20: ffff0000ce8182d8 x19: ffff0000ce818000 x18: ffff800011a5bd40
x17: 0000000000000000 x16: ffff800008042d90 x15: 0000000000000000
x14: 00000000ffffffff x13: 0000000000000001 x12: 0000000000ff0100
x11: ff0080000ff41dac x10: 0000000000000000 x9 : ffff80000ff41dac
x8 : ffff0000ca69d340 x7 : 0000000000000001 x6 : 0000000000000001
x5 : ffff8000219d6f78 x4 : ffff800015134e00 x3 : ffff80000ff41d98
x2 : 0000000000000000 x1 : 0000000000000008 x0 : 0000000000000000
Call trace:
qfq_reset_qdisc+0xbc/0x208 net/sched/sch_qfq.c:1486
qdisc_reset+0x134/0x604 net/sched/sch_generic.c:1038
__qdisc_destroy+0x100/0x500 net/sched/sch_generic.c:1076
qdisc_put net/sched/sch_generic.c:1107 [inline]
dev_shutdown+0x35c/0x47c net/sched/sch_generic.c:1495
unregister_netdevice_many+0x944/0x1740 net/core/dev.c:10981
unregister_netdevice_queue+0x2ac/0x2f8 net/core/dev.c:10921
unregister_netdevice include/linux/netdevice.h:3075 [inline]
__tun_detach+0xb04/0x122c drivers/net/tun.c:685
tun_detach drivers/net/tun.c:701 [inline]
tun_chr_close+0x118/0x1f8 drivers/net/tun.c:3492
__fput+0x1bc/0x7c0 fs/file_table.c:320
____fput+0x20/0x30 fs/file_table.c:348
task_work_run+0x1ec/0x270 kernel/task_work.c:203
resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
do_notify_resume+0x2038/0x2b28 arch/arm64/kernel/signal.c:1137
prepare_exit_to_user_mode arch/arm64/kernel/entry-common.c:137 [inline]
exit_to_user_mode arch/arm64/kernel/entry-common.c:142 [inline]
el0_svc+0x98/0x138 arch/arm64/kernel/entry-common.c:638
el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585
Code: d1002116 b4000656 910142d7 d343fefa (38796b48)
---[ end trace 0000000000000000 ]---
----------------
Code disassembly (best guess):
0: d1002116 sub x22, x8, #0x8
4: b4000656 cbz x22, 0xcc
8: 910142d7 add x23, x22, #0x50
c: d343fefa lsr x26, x23, #3
* 10: 38796b48 ldrb w8, [x26, x25] <-- trapping instruction


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

syzbot

unread,
Dec 27, 2025, 5:35:24 AM (3 days ago) Dec 27
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: 50cbba13faa2 Linux 6.1.159
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=15ba289a580000
kernel config: https://syzkaller.appspot.com/x/.config?x=31ea1cecaf34f0db
dashboard link: https://syzkaller.appspot.com/bug?extid=415e52ffab7b2b45778b
compiler: Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8
userspace arch: arm64
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=16ef5022580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=13ba289a580000
do_el0_svc+0x58/0x13c arch/arm64/kernel/syscall.c:204
el0_svc+0x58/0x138 arch/arm64/kernel/entry-common.c:637
el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585
==================================================================
BUG: KASAN: use-after-free in qfq_reset_qdisc+0xcc/0x208 net/sched/sch_qfq.c:1486
Read of size 8 at addr ffff0000c45fad50 by task syz.0.17/4518

CPU: 0 PID: 4518 Comm: syz.0.17 Not tainted syzkaller #0
Allocated by task 4518:
Freed by task 4518:
The buggy address belongs to the object at ffff0000c45fad00
which belongs to the cache kmalloc-128 of size 128
The buggy address is located 80 bytes inside of
128-byte region [ffff0000c45fad00, ffff0000c45fad80)

The buggy address belongs to the physical page:
page:000000002f5cf160 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1045fa
flags: 0x5ffc00000000200(slab|node=0|zone=2|lastcpupid=0x7ff)
raw: 05ffc00000000200 0000000000000000 dead000000000122 ffff0000c0002300
raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff0000c45fac00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff0000c45fac80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff0000c45fad00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff0000c45fad80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff0000c45fae00: 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================
Unable to handle kernel paging request at virtual address e0e500762000023d
KASAN: maybe wild-memory-access in range [0x072c03b1000011e8-0x072c03b1000011ef]
Mem abort info:
ESR = 0x0000000096000004
EC = 0x25: DABT (current EL), IL = 32 bits
SET = 0, FnV = 0
EA = 0, S1PTW = 0
FSC = 0x04: level 0 translation fault
Data abort info:
ISV = 0, ISS = 0x00000004
CM = 0, WnR = 0
[e0e500762000023d] address between user and kernel address ranges
Internal error: Oops: 0000000096000004 [#1] PREEMPT SMP
Modules linked in:
CPU: 0 PID: 4518 Comm: syz.0.17 Tainted: G B syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/03/2025
pstate: 82400005 (Nzcv daif +PAN -UAO +TCO -DIT -SSBS BTYPE=--)
pc : qfq_reset_qdisc+0xbc/0x208 net/sched/sch_qfq.c:1486
lr : qfq_reset_qdisc+0x158/0x208 net/sched/sch_qfq.c:1485
sp : ffff8000213275a0
x29: ffff8000213275b0 x28: 0000000000000000 x27: 1fffe0001bc2885a
x26: 00e580762000023d x25: dfff800000000000 x24: 0000000000000000
x23: 072c03b1000011ee x22: 072c03b10000119e x21: ffff0000de1442d0
x20: ffff0000de1442d8 x19: ffff0000de144000 x18: ffff800011a5bd40
x17: 0000000000000000 x16: ffff800008042d90 x15: 0000000000000000
x14: 00000000ffffffff x13: 0000000000000001 x12: 0000000000ff0100
x11: ff0080000ff41dac x10: 0000000000000000 x9 : ffff80000ff41dac
x8 : ffff0000d337b780 x7 : 0000000000000001 x6 : 0000000000000001
x5 : ffff800021326f78 x4 : ffff800015134e00 x3 : ffff80000ff41d98
If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.
Reply all
Reply to author
Forward
0 new messages