syzbot


KASAN: use-after-free Write in qdisc_class_hash_insert (2)

Status: auto-closed as invalid on 2020/10/10 02:06
Reported-by: syzbot+43a74cd99ed438f80bf8@syzkaller.appspotmail.com
First crash: 1636d, last: 1636d
Similar bugs (4)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.19 KASAN: use-after-free Write in qdisc_class_hash_insert 1 1840d 1840d 0/1 auto-closed as invalid on 2020/03/20 06:18
linux-4.14 KASAN: use-after-free Write in qdisc_class_hash_insert C error 12 1301d 1844d 0/1 upstream: reported C repro on 2019/11/17 01:10
upstream KASAN: use-after-free Write in qdisc_class_hash_insert net C done error 8 1591d 1834d 0/28 closed as invalid on 2020/09/28 07:57
upstream KASAN: use-after-free Write in qdisc_class_hash_insert (2) net 1 1263d 1263d 20/28 fixed on 2021/11/10 00:50

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in hlist_add_head include/linux/list.h:704 [inline]
BUG: KASAN: use-after-free in qdisc_class_hash_insert+0x200/0x210 net/sched/sch_api.c:713
Write of size 8 at addr ffff888086555550 by task syz-executor.4/28018

CPU: 1 PID: 28018 Comm: syz-executor.4 Not tainted 4.19.128-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x1fc/0x2fe lib/dump_stack.c:118
 print_address_description.cold+0x54/0x222 mm/kasan/report.c:256
 kasan_report_error mm/kasan/report.c:354 [inline]
 kasan_report mm/kasan/report.c:412 [inline]
 kasan_report.cold+0x88/0x2b9 mm/kasan/report.c:396
 hlist_add_head include/linux/list.h:704 [inline]
 qdisc_class_hash_insert+0x200/0x210 net/sched/sch_api.c:713
 qfq_change_class+0x9d6/0x1437 net/sched/sch_qfq.c:501
 tc_ctl_tclass+0x4b2/0xbe0 net/sched/sch_api.c:1992
 rtnetlink_rcv_msg+0x453/0xb80 net/core/rtnetlink.c:4777
 netlink_rcv_skb+0x160/0x410 net/netlink/af_netlink.c:2455
 netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline]
 netlink_unicast+0x4d7/0x6a0 net/netlink/af_netlink.c:1344
 netlink_sendmsg+0x6e3/0xcc0 net/netlink/af_netlink.c:1909
 sock_sendmsg_nosec net/socket.c:622 [inline]
 sock_sendmsg+0xc3/0x120 net/socket.c:632
 ___sys_sendmsg+0x3e2/0x920 net/socket.c:2115
 __sys_sendmmsg+0x195/0x470 net/socket.c:2210
 __do_sys_sendmmsg net/socket.c:2239 [inline]
 __se_sys_sendmmsg net/socket.c:2236 [inline]
 __x64_sys_sendmmsg+0x99/0x100 net/socket.c:2236
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x45ca69
Code: 0d b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 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 0f 83 db b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007f532fb21c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000133
RAX: ffffffffffffffda RBX: 00000000004fce40 RCX: 000000000045ca69
RDX: 0492492492492642 RSI: 0000000020000180 RDI: 0000000000000008
RBP: 000000000078bfa0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000009
R13: 00000000000008f5 R14: 00000000004cbc51 R15: 00007f532fb226d4

Allocated by task 28018:
 kmem_cache_alloc_trace+0x14b/0x3a0 mm/slab.c:3625
 kmalloc include/linux/slab.h:515 [inline]
 kzalloc include/linux/slab.h:709 [inline]
 qfq_change_class+0x752/0x1437 net/sched/sch_qfq.c:476
 tc_ctl_tclass+0x4b2/0xbe0 net/sched/sch_api.c:1992
 rtnetlink_rcv_msg+0x453/0xb80 net/core/rtnetlink.c:4777
 netlink_rcv_skb+0x160/0x410 net/netlink/af_netlink.c:2455
 netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline]
 netlink_unicast+0x4d7/0x6a0 net/netlink/af_netlink.c:1344
 netlink_sendmsg+0x6e3/0xcc0 net/netlink/af_netlink.c:1909
 sock_sendmsg_nosec net/socket.c:622 [inline]
 sock_sendmsg+0xc3/0x120 net/socket.c:632
 ___sys_sendmsg+0x3e2/0x920 net/socket.c:2115
 __sys_sendmmsg+0x195/0x470 net/socket.c:2210
 __do_sys_sendmmsg net/socket.c:2239 [inline]
 __se_sys_sendmmsg net/socket.c:2236 [inline]
 __x64_sys_sendmmsg+0x99/0x100 net/socket.c:2236
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 28018:
 __cache_free mm/slab.c:3503 [inline]
 kfree+0xce/0x220 mm/slab.c:3822
 qfq_change_class+0xf7d/0x1437 net/sched/sch_qfq.c:530
 tc_ctl_tclass+0x4b2/0xbe0 net/sched/sch_api.c:1992
 rtnetlink_rcv_msg+0x453/0xb80 net/core/rtnetlink.c:4777
 netlink_rcv_skb+0x160/0x410 net/netlink/af_netlink.c:2455
 netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline]
 netlink_unicast+0x4d7/0x6a0 net/netlink/af_netlink.c:1344
 netlink_sendmsg+0x6e3/0xcc0 net/netlink/af_netlink.c:1909
 sock_sendmsg_nosec net/socket.c:622 [inline]
 sock_sendmsg+0xc3/0x120 net/socket.c:632
 ___sys_sendmsg+0x3e2/0x920 net/socket.c:2115
 __sys_sendmmsg+0x195/0x470 net/socket.c:2210
 __do_sys_sendmmsg net/socket.c:2239 [inline]
 __se_sys_sendmmsg net/socket.c:2236 [inline]
 __x64_sys_sendmmsg+0x99/0x100 net/socket.c:2236
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

The buggy address belongs to the object at ffff888086555540
 which belongs to the cache kmalloc-128 of size 128
The buggy address is located 16 bytes inside of
 128-byte region [ffff888086555540, ffff8880865555c0)
The buggy address belongs to the page:
page:ffffea0002195540 count:1 mapcount:0 mapping:ffff88812c3dc640 index:0x0
flags: 0xfffe0000000100(slab)
raw: 00fffe0000000100 ffffea00021e4888 ffffea00023ff148 ffff88812c3dc640
raw: 0000000000000000 ffff888086555000 0000000100000015 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff888086555400: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
 ffff888086555480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888086555500: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb
                                                 ^
 ffff888086555580: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
 ffff888086555600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/06/12 02:05 linux-4.19.y 3fc898571b97 1beaee21 .config console log report ci2-linux-4-19
* Struck through repros no longer work on HEAD.