syzbot


KASAN: use-after-free Read in qfq_reset_qdisc

Status: auto-closed as invalid on 2020/06/06 11:35
Reported-by: syzbot+eb8da6d93a1f104a3bb0@syzkaller.appspotmail.com
First crash: 1761d, last: 1751d
Similar bugs (5)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream general protection fault in qfq_reset_qdisc net 5 833d 905d 0/28 auto-obsoleted due to no activity on 2022/11/11 06:00
upstream KASAN: use-after-free Read in qfq_reset_qdisc net 1 1040d 1040d 0/28 closed as invalid on 2022/02/17 02:00
linux-4.14 KASAN: use-after-free Read in qfq_reset_qdisc 6 1544d 1857d 0/1 auto-closed as invalid on 2020/12/30 04:03
linux-4.19 KASAN: use-after-free Read in qfq_reset_qdisc (2) 1 1578d 1578d 0/1 auto-closed as invalid on 2020/11/25 14:56
linux-4.19 KASAN: use-after-free Read in qfq_reset_qdisc (3) 1 1447d 1447d 0/1 auto-closed as invalid on 2021/04/05 19:15

Sample crash report:
audit: type=1400 audit(1581075264.085:28866): avc:  denied  { map } for  pid=13575 comm="syz-executor.2" path="/sys/kernel/debug/kcov" dev="debugfs" ino=639 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=system_u:object_r:debugfs_t:s0 tclass=file permissive=1
==================================================================
BUG: KASAN: use-after-free in qfq_reset_qdisc+0x280/0x300 net/sched/sch_qfq.c:1468
Read of size 8 at addr ffff88809e45c108 by task kworker/u4:2/109

CPU: 1 PID: 109 Comm: kworker/u4:2 Not tainted 4.19.102-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: netns cleanup_net
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x197/0x210 lib/dump_stack.c:118
 print_address_description.cold+0x7c/0x20d 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+0x8c/0x2ba mm/kasan/report.c:396
 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433
 qfq_reset_qdisc+0x280/0x300 net/sched/sch_qfq.c:1468
 qdisc_destroy+0x152/0x6b0 net/sched/sch_generic.c:980
 dev_shutdown+0x2c5/0x497 net/sched/sch_generic.c:1300
 rollback_registered_many+0x6f9/0xda0 net/core/dev.c:8173
 unregister_netdevice_many.part.0+0x1b/0x1f0 net/core/dev.c:9294
 unregister_netdevice_many net/core/dev.c:9293 [inline]
 default_device_exit_batch+0x34e/0x410 net/core/dev.c:9765
 ops_exit_list.isra.0+0xfc/0x150 net/core/net_namespace.c:156
 cleanup_net+0x404/0x960 net/core/net_namespace.c:553
 process_one_work+0x989/0x1750 kernel/workqueue.c:2153
 worker_thread+0x98/0xe40 kernel/workqueue.c:2296
 kthread+0x354/0x420 kernel/kthread.c:246
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415

Allocated by task 20411:
 save_stack+0x45/0xd0 mm/kasan/kasan.c:448
 set_track mm/kasan/kasan.c:460 [inline]
 kasan_kmalloc mm/kasan/kasan.c:553 [inline]
 kasan_kmalloc+0xce/0xf0 mm/kasan/kasan.c:531
 kmem_cache_alloc_trace+0x152/0x760 mm/slab.c:3625
 kmalloc include/linux/slab.h:515 [inline]
 kzalloc include/linux/slab.h:709 [inline]
 qfq_change_class+0xd29/0x15ce net/sched/sch_qfq.c:511
 tc_ctl_tclass+0x4f8/0xc60 net/sched/sch_api.c:1992
 rtnetlink_rcv_msg+0x463/0xb00 net/core/rtnetlink.c:4777
 netlink_rcv_skb+0x17d/0x460 net/netlink/af_netlink.c:2454
 rtnetlink_rcv+0x1d/0x30 net/core/rtnetlink.c:4795
 netlink_unicast_kernel net/netlink/af_netlink.c:1317 [inline]
 netlink_unicast+0x53a/0x730 net/netlink/af_netlink.c:1343
 netlink_sendmsg+0x8ae/0xd70 net/netlink/af_netlink.c:1908
 sock_sendmsg_nosec net/socket.c:622 [inline]
 sock_sendmsg+0xd7/0x130 net/socket.c:632
 ___sys_sendmsg+0x803/0x920 net/socket.c:2115
 __sys_sendmsg+0x105/0x1d0 net/socket.c:2153
 __do_sys_sendmsg net/socket.c:2162 [inline]
 __se_sys_sendmsg net/socket.c:2160 [inline]
 __x64_sys_sendmsg+0x78/0xb0 net/socket.c:2160
 do_syscall_64+0xfd/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 109:
 save_stack+0x45/0xd0 mm/kasan/kasan.c:448
 set_track mm/kasan/kasan.c:460 [inline]
 __kasan_slab_free+0x102/0x150 mm/kasan/kasan.c:521
 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528
 __cache_free mm/slab.c:3503 [inline]
 kfree+0xcf/0x220 mm/slab.c:3822
 qfq_destroy_agg net/sched/sch_qfq.c:349 [inline]
 qfq_rm_from_agg.isra.0+0x23c/0x2f0 net/sched/sch_qfq.c:370
 qfq_destroy_class+0x23/0x70 net/sched/sch_qfq.c:538
 qfq_destroy_qdisc+0x122/0x1b0 net/sched/sch_qfq.c:1490
 qdisc_destroy+0x18a/0x6b0 net/sched/sch_generic.c:982
 dev_shutdown+0x2c5/0x497 net/sched/sch_generic.c:1300
 rollback_registered_many+0x6f9/0xda0 net/core/dev.c:8173
 unregister_netdevice_many.part.0+0x1b/0x1f0 net/core/dev.c:9294
 unregister_netdevice_many net/core/dev.c:9293 [inline]
 default_device_exit_batch+0x34e/0x410 net/core/dev.c:9765
 ops_exit_list.isra.0+0xfc/0x150 net/core/net_namespace.c:156
 cleanup_net+0x404/0x960 net/core/net_namespace.c:553
 process_one_work+0x989/0x1750 kernel/workqueue.c:2153
 worker_thread+0x98/0xe40 kernel/workqueue.c:2296
 kthread+0x354/0x420 kernel/kthread.c:246
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415

The buggy address belongs to the object at ffff88809e45c0c0
 which belongs to the cache kmalloc-128 of size 128
The buggy address is located 72 bytes inside of
 128-byte region [ffff88809e45c0c0, ffff88809e45c140)
The buggy address belongs to the page:
page:ffffea0002791700 count:1 mapcount:0 mapping:ffff88812c31c640 index:0x0
flags: 0xfffe0000000100(slab)
raw: 00fffe0000000100 ffffea00022c9f08 ffffea0002440688 ffff88812c31c640
raw: 0000000000000000 ffff88809e45c000 0000000100000015 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff88809e45c000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc
 ffff88809e45c080: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb
>ffff88809e45c100: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
                      ^
 ffff88809e45c180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
 ffff88809e45c200: fc fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00
==================================================================

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/02/07 11:34 linux-4.19.y b499cf4b3a90 06150bf1 .config console log report ci2-linux-4-19
2020/01/28 14:22 linux-4.19.y 88d6de67e390 56cd6c9b .config console log report ci2-linux-4-19
* Struck through repros no longer work on HEAD.