KASAN: use-after-free Read in qfq_reset_qdisc

13 views
Skip to first unread message

syzbot

unread,
Jan 28, 2020, 9:23:10 AM1/28/20
to syzkaller...@googlegroups.com
Hello,

syzbot found the following crash on:

HEAD commit: 88d6de67 Linux 4.19.99
git tree: linux-4.19.y
console output: https://syzkaller.appspot.com/x/log.txt?x=14f57766e00000
kernel config: https://syzkaller.appspot.com/x/.config?x=bbdca1178922fa69
dashboard link: https://syzkaller.appspot.com/bug?extid=eb8da6d93a1f104a3bb0
compiler: gcc (GCC) 9.0.0 20181231 (experimental)

Unfortunately, I don't have any reproducer for this crash yet.

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+eb8da6...@syzkaller.appspotmail.com

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+0x280/0x300 net/sched/sch_qfq.c:1468
Read of size 8 at addr ffff88804fe9e7c8 by task kworker/u4:5/26285

CPU: 0 PID: 26285 Comm: kworker/u4:5 Not tainted 4.19.99-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:8164
unregister_netdevice_many.part.0+0x1b/0x1f0 net/core/dev.c:9283
unregister_netdevice_many net/core/dev.c:9282 [inline]
default_device_exit_batch+0x34e/0x410 net/core/dev.c:9754
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 22223:
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:1990
rtnetlink_rcv_msg+0x463/0xb00 net/core/rtnetlink.c:4768
netlink_rcv_skb+0x17d/0x460 net/netlink/af_netlink.c:2454
rtnetlink_rcv+0x1d/0x30 net/core/rtnetlink.c:4786
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 26285:
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:8164
unregister_netdevice_many.part.0+0x1b/0x1f0 net/core/dev.c:9283
unregister_netdevice_many net/core/dev.c:9282 [inline]
default_device_exit_batch+0x34e/0x410 net/core/dev.c:9754
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 ffff88804fe9e780
which belongs to the cache kmalloc-128 of size 128
The buggy address is located 72 bytes inside of
128-byte region [ffff88804fe9e780, ffff88804fe9e800)
The buggy address belongs to the page:
page:ffffea00013fa780 count:1 mapcount:0 mapping:ffff88812c31c640 index:0x0
flags: 0xfffe0000000100(slab)
raw: 00fffe0000000100 ffffea00028e8dc8 ffffea0000b14008 ffff88812c31c640
raw: 0000000000000000 ffff88804fe9e000 0000000100000015 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff88804fe9e680: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb
ffff88804fe9e700: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
>ffff88804fe9e780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88804fe9e800: fc fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00
ffff88804fe9e880: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
==================================================================


---
This bug is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this bug report. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

syzbot

unread,
Jun 6, 2020, 7:35:13 AM6/6/20
to syzkaller...@googlegroups.com
Auto-closing this bug as obsolete.
Crashes did not happen for a while, no reproducer and no activity.
Reply all
Reply to author
Forward
0 new messages