syzbot


KASAN: use-after-free Write in qdisc_class_hash_insert

Status: closed as invalid on 2020/09/28 07:57
Subsystems: net
[Documentation on labels]
First crash: 1583d, last: 1340d
Cause bisection: introduced by (bisect log) :
commit e41d58185f1444368873d4d7422f7664a68be61d
Author: Dmitry Vyukov <dvyukov@google.com>
Date: Wed Jul 12 21:34:35 2017 +0000

  fault-inject: support systematic fault injection

Crash: KASAN: use-after-free Write in qdisc_class_hash_insert (log)
Repro: C syz .config
  
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 1589d 1589d 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 1050d 1593d 0/1 upstream: reported C repro on 2019/11/17 01:10
upstream KASAN: use-after-free Write in qdisc_class_hash_insert (2) net 1 1012d 1012d 20/26 fixed on 2021/11/10 00:50
linux-4.19 KASAN: use-after-free Write in qdisc_class_hash_insert (2) 1 1385d 1385d 0/1 auto-closed as invalid on 2020/10/10 02:06
Fix bisection attempts (2)
Created Duration User Patch Repo Result
2020/05/08 05:40 0m bisect fix upstream error job log (0)
2020/01/13 16:43 22m bisect fix upstream job log (0) log

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in hlist_add_head include/linux/list.h:787 [inline]
BUG: KASAN: use-after-free in qdisc_class_hash_insert+0x106/0x1d0 net/sched/sch_api.c:720
Write of size 8 at addr ffff888098884e10 by task syz-executor061/8104

CPU: 1 PID: 8104 Comm: syz-executor061 Not tainted 5.4.0-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+0x1fb/0x318 lib/dump_stack.c:118
 print_address_description+0x75/0x5c0 mm/kasan/report.c:374
 __kasan_report+0x14b/0x1c0 mm/kasan/report.c:506
 kasan_report+0x26/0x50 mm/kasan/common.c:634
 __asan_report_store8_noabort+0x17/0x20 mm/kasan/generic_report.c:137
 hlist_add_head include/linux/list.h:787 [inline]
 qdisc_class_hash_insert+0x106/0x1d0 net/sched/sch_api.c:720
 qfq_change_class+0x8ba/0x1c50 net/sched/sch_qfq.c:489
 tc_ctl_tclass+0x7f1/0xea0 net/sched/sch_api.c:2080
 rtnetlink_rcv_msg+0x889/0xd40 net/core/rtnetlink.c:5245
 netlink_rcv_skb+0x19e/0x3d0 net/netlink/af_netlink.c:2477
 rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:5263
 netlink_unicast_kernel net/netlink/af_netlink.c:1302 [inline]
 netlink_unicast+0x787/0x8f0 net/netlink/af_netlink.c:1328
 netlink_sendmsg+0x994/0xc50 net/netlink/af_netlink.c:1917
 sock_sendmsg_nosec net/socket.c:638 [inline]
 sock_sendmsg net/socket.c:658 [inline]
 ___sys_sendmsg+0x60d/0x910 net/socket.c:2312
 __sys_sendmmsg+0x239/0x470 net/socket.c:2414
 __do_sys_sendmmsg net/socket.c:2443 [inline]
 __se_sys_sendmmsg net/socket.c:2440 [inline]
 __x64_sys_sendmmsg+0xa0/0xb0 net/socket.c:2440
 do_syscall_64+0xf7/0x1c0 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x447589
Code: e8 0c e8 ff ff 48 83 c4 18 c3 0f 1f 80 00 00 00 00 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 8b cd fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007ffcec769358 EFLAGS: 00000246 ORIG_RAX: 0000000000000133
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000447589
RDX: 0000000004924b68 RSI: 0000000020000140 RDI: 0000000000000006
RBP: 0000000000012fba R08: 0000000000000001 R09: 0000000000400037
R10: 0000000000000000 R11: 0000000000000246 R12: ffffffffffffffff
R13: 0000000000000007 R14: 0000000000000000 R15: 0000000000000000

Allocated by task 8091:
 save_stack mm/kasan/common.c:69 [inline]
 set_track mm/kasan/common.c:77 [inline]
 __kasan_kmalloc+0x11c/0x1b0 mm/kasan/common.c:510
 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:524
 kmem_cache_alloc_trace+0x221/0x2f0 mm/slab.c:3550
 kmalloc include/linux/slab.h:556 [inline]
 kzalloc include/linux/slab.h:690 [inline]
 qfq_change_class+0x4d4/0x1c50 net/sched/sch_qfq.c:464
 tc_ctl_tclass+0x7f1/0xea0 net/sched/sch_api.c:2080
 rtnetlink_rcv_msg+0x889/0xd40 net/core/rtnetlink.c:5245
 netlink_rcv_skb+0x19e/0x3d0 net/netlink/af_netlink.c:2477
 rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:5263
 netlink_unicast_kernel net/netlink/af_netlink.c:1302 [inline]
 netlink_unicast+0x787/0x8f0 net/netlink/af_netlink.c:1328
 netlink_sendmsg+0x994/0xc50 net/netlink/af_netlink.c:1917
 sock_sendmsg_nosec net/socket.c:638 [inline]
 sock_sendmsg net/socket.c:658 [inline]
 ___sys_sendmsg+0x60d/0x910 net/socket.c:2312
 __sys_sendmmsg+0x239/0x470 net/socket.c:2414
 __do_sys_sendmmsg net/socket.c:2443 [inline]
 __se_sys_sendmmsg net/socket.c:2440 [inline]
 __x64_sys_sendmmsg+0xa0/0xb0 net/socket.c:2440
 do_syscall_64+0xf7/0x1c0 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 8091:
 save_stack mm/kasan/common.c:69 [inline]
 set_track mm/kasan/common.c:77 [inline]
 kasan_set_free_info mm/kasan/common.c:332 [inline]
 __kasan_slab_free+0x12a/0x1e0 mm/kasan/common.c:471
 kasan_slab_free+0xe/0x10 mm/kasan/common.c:480
 __cache_free mm/slab.c:3425 [inline]
 kfree+0x115/0x200 mm/slab.c:3756
 qfq_change_class+0xc53/0x1c50 net/sched/sch_qfq.c:518
 tc_ctl_tclass+0x7f1/0xea0 net/sched/sch_api.c:2080
 rtnetlink_rcv_msg+0x889/0xd40 net/core/rtnetlink.c:5245
 netlink_rcv_skb+0x19e/0x3d0 net/netlink/af_netlink.c:2477
 rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:5263
 netlink_unicast_kernel net/netlink/af_netlink.c:1302 [inline]
 netlink_unicast+0x787/0x8f0 net/netlink/af_netlink.c:1328
 netlink_sendmsg+0x994/0xc50 net/netlink/af_netlink.c:1917
 sock_sendmsg_nosec net/socket.c:638 [inline]
 sock_sendmsg net/socket.c:658 [inline]
 ___sys_sendmsg+0x60d/0x910 net/socket.c:2312
 __sys_sendmmsg+0x239/0x470 net/socket.c:2414
 __do_sys_sendmmsg net/socket.c:2443 [inline]
 __se_sys_sendmmsg net/socket.c:2440 [inline]
 __x64_sys_sendmmsg+0xa0/0xb0 net/socket.c:2440
 do_syscall_64+0xf7/0x1c0 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

The buggy address belongs to the object at ffff888098884e00
 which belongs to the cache kmalloc-128 of size 128
The buggy address is located 16 bytes inside of
 128-byte region [ffff888098884e00, ffff888098884e80)
The buggy address belongs to the page:
page:ffffea0002622100 refcount:1 mapcount:0 mapping:ffff8880aa400700 index:0x0
raw: 01fffc0000000200 ffffea00029df388 ffffea00023302c8 ffff8880aa400700
raw: 0000000000000000 ffff888098884000 0000000100000010 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff888098884d00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
 ffff888098884d80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888098884e00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                         ^
 ffff888098884e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff888098884f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc
==================================================================

Crashes (8):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/11/26 14:08 upstream 0be0ee71816b f746151a .config console log report syz C ci-upstream-kasan-gce-smack-root
2020/07/27 01:20 upstream 04300d66f0a0 51265195 .config console log report ci-upstream-kasan-gce
2020/06/24 19:25 upstream 7ae77150d94d 54566aff .config console log report ci-upstream-kasan-gce-selinux-root
2020/04/08 05:40 upstream 763dede1b248 db9bcd4b .config console log report ci-upstream-kasan-gce
2020/03/23 09:04 upstream 67d584e33e54 78267cec .config console log report ci-upstream-kasan-gce-selinux-root
2020/01/31 08:14 upstream 9f68e3655aae 5ed23f9a .config console log report ci-upstream-kasan-gce-selinux-root
2019/11/26 13:04 upstream 0be0ee71816b f746151a .config console log report ci-upstream-kasan-gce-smack-root
2020/03/11 01:46 net-next-old 1e09e5818b3a 35f53e45 .config console log report ci-upstream-net-kasan-gce
* Struck through repros no longer work on HEAD.