syzbot


KASAN: use-after-free Write in qdisc_class_hash_insert

Status: upstream: reported C repro on 2019/11/17 01:10
Reported-by: syzbot+2f0e4cb10cdf18e710ab@syzkaller.appspotmail.com
First crash: 1619d, last: 1075d
Fix bisection: failed (error log, bisect log)
  
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 1615d 1615d 0/1 auto-closed as invalid on 2020/03/20 06:18
upstream KASAN: use-after-free Write in qdisc_class_hash_insert net C done error 8 1366d 1609d 0/26 closed as invalid on 2020/09/28 07:57
upstream KASAN: use-after-free Write in qdisc_class_hash_insert (2) net 1 1038d 1038d 20/26 fixed on 2021/11/10 00:50
linux-4.19 KASAN: use-after-free Write in qdisc_class_hash_insert (2) 1 1411d 1411d 0/1 auto-closed as invalid on 2020/10/10 02:06
Last patch testing requests (2)
Created Duration User Patch Repo Result
2023/02/07 23:32 14m retest repro linux-4.14.y report log
2022/09/17 15:29 10m retest repro linux-4.14.y report log
Fix bisection attempts (2)
Created Duration User Patch Repo Result
2020/06/02 20:09 0m bisect fix linux-4.14.y error job log (0)
2020/04/19 14:22 26m bisect fix linux-4.14.y job log (0) log

Sample crash report:
RDX: 0492492492492642 RSI: 0000000020000180 RDI: 0000000000000009
RBP: 0000000000000000 R08: 0000000000000001 R09: 00000000bb1414ac
R10: 0000000000000000 R11: 0000000000000246 R12: ffffffffffffffff
R13: 000000000000000a R14: 0000000000000000 R15: 0000000000000000
==================================================================
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+0x25e/0x270 net/sched/sch_api.c:694
Write of size 8 at addr ffff88809ce1f9d0 by task syz-executor746/7503

CPU: 1 PID: 7503 Comm: syz-executor746 Not tainted 4.14.174-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x13e/0x194 lib/dump_stack.c:58
 print_address_description.cold+0x7c/0x1e2 mm/kasan/report.c:252
 kasan_report_error mm/kasan/report.c:351 [inline]
 kasan_report mm/kasan/report.c:409 [inline]
 kasan_report.cold+0xa9/0x2ae mm/kasan/report.c:393
 hlist_add_head include/linux/list.h:704 [inline]
 qdisc_class_hash_insert+0x25e/0x270 net/sched/sch_api.c:694
 qfq_change_class+0x88f/0x1081 net/sched/sch_qfq.c:500
 tc_ctl_tclass+0x3e2/0xa00 net/sched/sch_api.c:1848
 rtnetlink_rcv_msg+0x3be/0xb10 net/core/rtnetlink.c:4315
 netlink_rcv_skb+0x127/0x370 net/netlink/af_netlink.c:2433
 netlink_unicast_kernel net/netlink/af_netlink.c:1287 [inline]
 netlink_unicast+0x437/0x620 net/netlink/af_netlink.c:1313
 netlink_sendmsg+0x733/0xbe0 net/netlink/af_netlink.c:1878
 sock_sendmsg_nosec net/socket.c:646 [inline]
 sock_sendmsg+0xc5/0x100 net/socket.c:656
 ___sys_sendmsg+0x349/0x840 net/socket.c:2062
 __sys_sendmmsg+0x129/0x330 net/socket.c:2152
 SYSC_sendmmsg net/socket.c:2183 [inline]
 SyS_sendmmsg+0x2f/0x50 net/socket.c:2178
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x443da9
RSP: 002b:00007fff4325eea8 EFLAGS: 00000246 ORIG_RAX: 0000000000000133
RAX: ffffffffffffffda RBX: 00007fff4325ef20 RCX: 0000000000443da9
RDX: 0492492492492642 RSI: 0000000020000180 RDI: 0000000000000009
RBP: 0000000000000000 R08: 0000000000000001 R09: 00000000bb1414ac
R10: 0000000000000000 R11: 0000000000000246 R12: ffffffffffffffff
R13: 000000000000000a R14: 0000000000000000 R15: 0000000000000000

Allocated by task 7503:
 save_stack+0x32/0xa0 mm/kasan/kasan.c:447
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_kmalloc mm/kasan/kasan.c:551 [inline]
 kasan_kmalloc+0xbf/0xe0 mm/kasan/kasan.c:529
 kmem_cache_alloc_trace+0x14d/0x7b0 mm/slab.c:3618
 kmalloc include/linux/slab.h:488 [inline]
 kzalloc include/linux/slab.h:661 [inline]
 qfq_change_class+0x64e/0x1081 net/sched/sch_qfq.c:475
 tc_ctl_tclass+0x3e2/0xa00 net/sched/sch_api.c:1848
 rtnetlink_rcv_msg+0x3be/0xb10 net/core/rtnetlink.c:4315
 netlink_rcv_skb+0x127/0x370 net/netlink/af_netlink.c:2433
 netlink_unicast_kernel net/netlink/af_netlink.c:1287 [inline]
 netlink_unicast+0x437/0x620 net/netlink/af_netlink.c:1313
 netlink_sendmsg+0x733/0xbe0 net/netlink/af_netlink.c:1878
 sock_sendmsg_nosec net/socket.c:646 [inline]
 sock_sendmsg+0xc5/0x100 net/socket.c:656
 ___sys_sendmsg+0x349/0x840 net/socket.c:2062
 __sys_sendmmsg+0x129/0x330 net/socket.c:2152
 SYSC_sendmmsg net/socket.c:2183 [inline]
 SyS_sendmmsg+0x2f/0x50 net/socket.c:2178
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x42/0xb7

Freed by task 7503:
 save_stack+0x32/0xa0 mm/kasan/kasan.c:447
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_slab_free+0x75/0xc0 mm/kasan/kasan.c:524
 __cache_free mm/slab.c:3496 [inline]
 kfree+0xcb/0x260 mm/slab.c:3815
 qfq_change_class+0xd82/0x1081 net/sched/sch_qfq.c:529
 tc_ctl_tclass+0x3e2/0xa00 net/sched/sch_api.c:1848
 rtnetlink_rcv_msg+0x3be/0xb10 net/core/rtnetlink.c:4315
 netlink_rcv_skb+0x127/0x370 net/netlink/af_netlink.c:2433
 netlink_unicast_kernel net/netlink/af_netlink.c:1287 [inline]
 netlink_unicast+0x437/0x620 net/netlink/af_netlink.c:1313
 netlink_sendmsg+0x733/0xbe0 net/netlink/af_netlink.c:1878
 sock_sendmsg_nosec net/socket.c:646 [inline]
 sock_sendmsg+0xc5/0x100 net/socket.c:656
 ___sys_sendmsg+0x349/0x840 net/socket.c:2062
 __sys_sendmmsg+0x129/0x330 net/socket.c:2152
 SYSC_sendmmsg net/socket.c:2183 [inline]
 SyS_sendmmsg+0x2f/0x50 net/socket.c:2178
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x42/0xb7

The buggy address belongs to the object at ffff88809ce1f9c0
 which belongs to the cache kmalloc-128 of size 128
The buggy address is located 16 bytes inside of
 128-byte region [ffff88809ce1f9c0, ffff88809ce1fa40)
The buggy address belongs to the page:
page:ffffea00027387c0 count:1 mapcount:0 mapping:ffff88809ce1f000 index:0x0
flags: 0xfffe0000000100(slab)
raw: 00fffe0000000100 ffff88809ce1f000 0000000000000000 0000000100000015
raw: ffffea000272b3e0 ffffea000294bb20 ffff88812fe56640 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff88809ce1f880: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
 ffff88809ce1f900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88809ce1f980: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb
                                                 ^
 ffff88809ce1fa00: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
 ffff88809ce1fa80: 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc
==================================================================

Crashes (12):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/03/20 14:21 linux-4.14.y 01364dad1d45 2c31c529 .config console log report syz C ci2-linux-4-14
2021/05/13 07:57 linux-4.14.y 7d7d1c0ab3eb ed7d41c5 .config console log report info ci2-linux-4-14 KASAN: use-after-free Write in qdisc_class_hash_insert
2020/12/08 12:05 linux-4.14.y c196b3a9c83a 9af51e31 .config console log report info ci2-linux-4-14
2020/07/03 10:36 linux-4.14.y b850307b279c f30c14bf .config console log report ci2-linux-4-14
2020/05/03 19:46 linux-4.14.y 773e2b1cd56a 58ae5e18 .config console log report ci2-linux-4-14
2020/04/27 09:27 linux-4.14.y 050272a0423e 0ce7569e .config console log report ci2-linux-4-14
2020/04/22 14:16 linux-4.14.y c10b57a567e4 2e44d63e .config console log report ci2-linux-4-14
2020/03/20 13:46 linux-4.14.y 01364dad1d45 2c31c529 .config console log report ci2-linux-4-14
2020/03/14 02:52 linux-4.14.y 12cd844a39ed 749688d2 .config console log report ci2-linux-4-14
2020/03/09 19:14 linux-4.14.y 78d697fc93f9 35f53e45 .config console log report ci2-linux-4-14
2019/11/19 14:42 linux-4.14.y 775d01b65b5d 432c7650 .config console log report ci2-linux-4-14
2019/11/17 00:09 linux-4.14.y 775d01b65b5d cdac920b .config console log report ci2-linux-4-14
* Struck through repros no longer work on HEAD.