syzbot


KASAN: use-after-free Read in qfq_reset_qdisc (2)

Status: auto-closed as invalid on 2020/11/25 14:56
Reported-by: syzbot+c1d00e3ef46bea1df0cf@syzkaller.appspotmail.com
First crash: 1339d, last: 1339d
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 594d 666d 0/26 auto-obsoleted due to no activity on 2022/11/11 06:00
linux-4.19 KASAN: use-after-free Read in qfq_reset_qdisc 2 1511d 1521d 0/1 auto-closed as invalid on 2020/06/06 11:35
upstream KASAN: use-after-free Read in qfq_reset_qdisc net 1 801d 801d 0/26 closed as invalid on 2022/02/17 02:00
linux-4.14 KASAN: use-after-free Read in qfq_reset_qdisc 6 1305d 1617d 0/1 auto-closed as invalid on 2020/12/30 04:03
linux-4.19 KASAN: use-after-free Read in qfq_reset_qdisc (3) 1 1208d 1208d 0/1 auto-closed as invalid on 2021/04/05 19:15

Sample crash report:
device veth1_macvtap left promiscuous mode
device veth0_macvtap left promiscuous mode
device veth1_vlan left promiscuous mode
device veth0_vlan left promiscuous mode
==================================================================
BUG: KASAN: use-after-free in qfq_reset_qdisc+0x3b2/0x4d0 net/sched/sch_qfq.c:1468
Read of size 8 at addr ffff88809028b108 by task kworker/u4:0/20636

CPU: 1 PID: 20636 Comm: kworker/u4:0 Not tainted 4.19.134-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+0x1fc/0x2fe lib/dump_stack.c:118
 print_address_description.cold+0x54/0x219 mm/kasan/report.c:256
 kasan_report_error.cold+0x8a/0x1c7 mm/kasan/report.c:354
 kasan_report mm/kasan/report.c:412 [inline]
 __asan_report_load8_noabort+0x88/0x90 mm/kasan/report.c:433
 qfq_reset_qdisc+0x3b2/0x4d0 net/sched/sch_qfq.c:1468
 qdisc_destroy+0x148/0x780 net/sched/sch_generic.c:981
 dev_shutdown+0x2b2/0x48b net/sched/sch_generic.c:1301
 rollback_registered_many+0x689/0xde0 net/core/dev.c:8180
 unregister_netdevice_many.part.0+0x1a/0x300 net/core/dev.c:9310
 unregister_netdevice_many net/core/dev.c:9309 [inline]
 default_device_exit_batch+0x2fa/0x3c0 net/core/dev.c:9781
 ops_exit_list+0xf9/0x150 net/core/net_namespace.c:156
 cleanup_net+0x3b4/0x8b0 net/core/net_namespace.c:553
 process_one_work+0x864/0x1570 kernel/workqueue.c:2155
 worker_thread+0x64c/0x1130 kernel/workqueue.c:2298
 kthread+0x30b/0x410 kernel/kthread.c:246
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415

Allocated by task 22503:
 __do_kmalloc mm/slab.c:3727 [inline]
 __kmalloc_track_caller+0x155/0x3c0 mm/slab.c:3742
 kmemdup+0x23/0x50 mm/util.c:118
 kmemdup include/linux/string.h:446 [inline]
 mpls_dev_sysctl_register+0xaa/0x2d0 net/mpls/af_mpls.c:1353
 mpls_add_dev net/mpls/af_mpls.c:1419 [inline]
 mpls_dev_notify+0x271/0x9b0 net/mpls/af_mpls.c:1545
 notifier_call_chain+0xc0/0x230 kernel/notifier.c:93
 call_netdevice_notifiers net/core/dev.c:1762 [inline]
 register_netdevice+0xdd2/0x10f0 net/core/dev.c:8747
 veth_newlink+0x3eb/0x930 drivers/net/veth.c:1143
 rtnl_newlink+0x1027/0x15a0 net/core/rtnetlink.c:3141
 rtnetlink_rcv_msg+0x453/0xb80 net/core/rtnetlink.c:4777
 netlink_rcv_skb+0x160/0x440 net/netlink/af_netlink.c:2455
 netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline]
 netlink_unicast+0x4d5/0x690 net/netlink/af_netlink.c:1344
 netlink_sendmsg+0x6bb/0xc40 net/netlink/af_netlink.c:1909
 sock_sendmsg_nosec net/socket.c:622 [inline]
 sock_sendmsg+0xc3/0x120 net/socket.c:632
 ___sys_sendmsg+0x7bb/0x8e0 net/socket.c:2115
 __sys_sendmsg net/socket.c:2153 [inline]
 __do_sys_sendmsg net/socket.c:2162 [inline]
 __se_sys_sendmsg net/socket.c:2160 [inline]
 __x64_sys_sendmsg+0x132/0x220 net/socket.c:2160
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 20636:
 __cache_free mm/slab.c:3503 [inline]
 kfree+0xcc/0x210 mm/slab.c:3822
 mpls_dev_sysctl_unregister net/mpls/af_mpls.c:1389 [inline]
 mpls_dev_notify+0x6d0/0x9b0 net/mpls/af_mpls.c:1578
 notifier_call_chain+0xc0/0x230 kernel/notifier.c:93
 call_netdevice_notifiers net/core/dev.c:1762 [inline]
 rollback_registered_many+0x823/0xde0 net/core/dev.c:8187
 unregister_netdevice_many.part.0+0x1a/0x300 net/core/dev.c:9310
 unregister_netdevice_many net/core/dev.c:9309 [inline]
 default_device_exit_batch+0x2fa/0x3c0 net/core/dev.c:9781
 ops_exit_list+0xf9/0x150 net/core/net_namespace.c:156
 cleanup_net+0x3b4/0x8b0 net/core/net_namespace.c:553
 process_one_work+0x864/0x1570 kernel/workqueue.c:2155
 worker_thread+0x64c/0x1130 kernel/workqueue.c:2298
 kthread+0x30b/0x410 kernel/kthread.c:246
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415

The buggy address belongs to the object at ffff88809028b0c0
 which belongs to the cache kmalloc-128 of size 128
The buggy address is located 72 bytes inside of
 128-byte region [ffff88809028b0c0, ffff88809028b140)
The buggy address belongs to the page:
page:ffffea000240a2c0 count:1 mapcount:0 mapping:ffff88812c39c640 index:0xffff88809028b780
flags: 0xfffe0000000100(slab)
raw: 00fffe0000000100 ffffea0001333348 ffffea0002359388 ffff88812c39c640
raw: ffff88809028b780 ffff88809028b000 0000000100000014 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff88809028b000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88809028b080: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb
>ffff88809028b100: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
                      ^
 ffff88809028b180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88809028b200: fc fc fc fc fc fc fc fc 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/07/28 14:55 linux-4.19.y 20b3a3dfdf6c cb93dc6a .config console log report ci2-linux-4-19
* Struck through repros no longer work on HEAD.