syzbot


KASAN: use-after-free Read in qfq_find_class

Status: upstream: reported C repro on 2020/05/31 15:28
Reported-by: syzbot+dfce07970ed912950568@syzkaller.appspotmail.com
First crash: 1477d, last: 687d
Fix bisection the fix commit could be any of (bisect log):
  4f68020fef1c Linux 4.14.182
  4139fb08c05f Linux 4.14.187
  
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.19 KASAN: use-after-free Read in qfq_find_class C error 2 687d 687d 0/1 upstream: reported C repro on 2022/07/30 18:22
Last patch testing requests (4)
Created Duration User Patch Repo Result
2023/03/02 14:32 12m retest repro linux-4.14.y report log
2023/03/02 10:32 12m retest repro linux-4.14.y report log
2022/11/11 17:30 12m retest repro linux-4.14.y report log
2022/11/11 16:30 9m retest repro linux-4.14.y report log

Sample crash report:
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000007
R13: 00000000000f4240 R14: 0000000000000000 R15: 0000000000000000
netlink: 24 bytes leftover after parsing attributes in process `syz-executor230'.
netlink: 72 bytes leftover after parsing attributes in process `syz-executor230'.
==================================================================
BUG: KASAN: use-after-free in qdisc_class_find include/net/sch_generic.h:414 [inline]
BUG: KASAN: use-after-free in qfq_find_class+0x144/0x170 net/sched/sch_qfq.c:214
Read of size 4 at addr ffff8880b370e300 by task syz-executor230/8205

CPU: 0 PID: 8205 Comm: syz-executor230 Not tainted 4.14.290-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/22/2022
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x1b2/0x281 lib/dump_stack.c:58
 print_address_description.cold+0x54/0x1d3 mm/kasan/report.c:252
 kasan_report_error.cold+0x8a/0x191 mm/kasan/report.c:351
 kasan_report mm/kasan/report.c:409 [inline]
 __asan_report_load4_noabort+0x68/0x70 mm/kasan/report.c:429
 qdisc_class_find include/net/sch_generic.h:414 [inline]
 qfq_find_class+0x144/0x170 net/sched/sch_qfq.c:214
 tc_ctl_tclass+0x5ca/0xa60 net/sched/sch_api.c:1818
 rtnetlink_rcv_msg+0x3be/0xb10 net/core/rtnetlink.c:4322
 netlink_rcv_skb+0x125/0x390 net/netlink/af_netlink.c:2454
 netlink_unicast_kernel net/netlink/af_netlink.c:1296 [inline]
 netlink_unicast+0x437/0x610 net/netlink/af_netlink.c:1322
 netlink_sendmsg+0x648/0xbc0 net/netlink/af_netlink.c:1893
 sock_sendmsg_nosec net/socket.c:646 [inline]
 sock_sendmsg+0xb5/0x100 net/socket.c:656
 ___sys_sendmsg+0x6c8/0x800 net/socket.c:2062
 __sys_sendmsg+0xa3/0x120 net/socket.c:2096
 SYSC_sendmsg net/socket.c:2107 [inline]
 SyS_sendmsg+0x27/0x40 net/socket.c:2103
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x46/0xbb
RIP: 0033:0x7f4f7d6b1e69
RSP: 002b:00007ffe7aed9248 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00007ffe7aed9280 RCX: 00007f4f7d6b1e69
RDX: 0000000000000000 RSI: 00000000200001c0 RDI: 0000000000000005
RBP: 0000000000000000 R08: 0000000000000001 R09: 0000000000000001
R10: 0000000000000001 R11: 0000000000000246 R12: 00007ffe7aed9270
R13: 00000000000f4240 R14: 0000000000007197 R15: 00007ffe7aed9254

Allocated by task 8200:
 save_stack mm/kasan/kasan.c:447 [inline]
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_kmalloc+0xeb/0x160 mm/kasan/kasan.c:551
 kmem_cache_alloc_trace+0x131/0x3d0 mm/slab.c:3618
 kmalloc include/linux/slab.h:488 [inline]
 kzalloc include/linux/slab.h:661 [inline]
 qfq_change_class+0x478/0x13b0 net/sched/sch_qfq.c:475
 tc_ctl_tclass+0x408/0xa60 net/sched/sch_api.c:1849
 rtnetlink_rcv_msg+0x3be/0xb10 net/core/rtnetlink.c:4322
 netlink_rcv_skb+0x125/0x390 net/netlink/af_netlink.c:2454
 netlink_unicast_kernel net/netlink/af_netlink.c:1296 [inline]
 netlink_unicast+0x437/0x610 net/netlink/af_netlink.c:1322
 netlink_sendmsg+0x648/0xbc0 net/netlink/af_netlink.c:1893
 sock_sendmsg_nosec net/socket.c:646 [inline]
 sock_sendmsg+0xb5/0x100 net/socket.c:656
 ___sys_sendmsg+0x6c8/0x800 net/socket.c:2062
 __sys_sendmsg+0xa3/0x120 net/socket.c:2096
 SYSC_sendmsg net/socket.c:2107 [inline]
 SyS_sendmsg+0x27/0x40 net/socket.c:2103
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x46/0xbb

Freed by task 8200:
 save_stack mm/kasan/kasan.c:447 [inline]
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_slab_free+0xc3/0x1a0 mm/kasan/kasan.c:524
 __cache_free mm/slab.c:3496 [inline]
 kfree+0xc9/0x250 mm/slab.c:3815
 qfq_change_class+0xfe8/0x13b0 net/sched/sch_qfq.c:527
 tc_ctl_tclass+0x408/0xa60 net/sched/sch_api.c:1849
 rtnetlink_rcv_msg+0x3be/0xb10 net/core/rtnetlink.c:4322
 netlink_rcv_skb+0x125/0x390 net/netlink/af_netlink.c:2454
 netlink_unicast_kernel net/netlink/af_netlink.c:1296 [inline]
 netlink_unicast+0x437/0x610 net/netlink/af_netlink.c:1322
 netlink_sendmsg+0x648/0xbc0 net/netlink/af_netlink.c:1893
 sock_sendmsg_nosec net/socket.c:646 [inline]
 sock_sendmsg+0xb5/0x100 net/socket.c:656
 ___sys_sendmsg+0x6c8/0x800 net/socket.c:2062
 __sys_sendmsg+0xa3/0x120 net/socket.c:2096
 SYSC_sendmsg net/socket.c:2107 [inline]
 SyS_sendmsg+0x27/0x40 net/socket.c:2103
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x46/0xbb

The buggy address belongs to the object at ffff8880b370e300
 which belongs to the cache kmalloc-128 of size 128
The buggy address is located 0 bytes inside of
 128-byte region [ffff8880b370e300, ffff8880b370e380)
The buggy address belongs to the page:
page:ffffea0002cdc380 count:1 mapcount:0 mapping:ffff8880b370e000 index:0x0
flags: 0xfff00000000100(slab)
raw: 00fff00000000100 ffff8880b370e000 0000000000000000 0000000100000015
raw: ffffea0002cf43a0 ffffea0002cd61e0 ffff88813fe74640 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8880b370e200: fc fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00
 ffff8880b370e280: 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc
>ffff8880b370e300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                   ^
 ffff8880b370e380: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb
 ffff8880b370e400: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
==================================================================

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/07/30 21:58 linux-4.14.y b641242202ed fef302b1 .config console log report syz C ci2-linux-4-14 KASAN: use-after-free Read in qfq_find_class
2020/05/31 15:56 linux-4.14.y 4f68020fef1c a0331e89 .config console log report syz C ci2-linux-4-14
2020/05/31 15:27 linux-4.14.y 4f68020fef1c a0331e89 .config console log report ci2-linux-4-14
* Struck through repros no longer work on HEAD.