KASAN: use-after-free Read in qfq_reset_qdisc

4 views
Skip to first unread message

syzbot

unread,
Oct 24, 2019, 3:45:07 AM10/24/19
to syzkaller...@googlegroups.com
Hello,

syzbot found the following crash on:

HEAD commit: b98aebd2 Linux 4.14.150
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=1007901f600000
kernel config: https://syzkaller.appspot.com/x/.config?x=c52c93b368dac5a7
dashboard link: https://syzkaller.appspot.com/bug?extid=035b42caa27937c5e47e
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+035b42...@syzkaller.appspotmail.com

device bridge_slave_1 left promiscuous mode
bridge0: port 2(bridge_slave_1) entered disabled state
device bridge_slave_0 left promiscuous mode
bridge0: port 1(bridge_slave_0) entered disabled state
==================================================================
BUG: KASAN: use-after-free in qfq_reset_qdisc+0x24c/0x2c0
net/sched/sch_qfq.c:1463
Read of size 8 at addr ffff8880812e1dc8 by task kworker/u4:1/22

CPU: 1 PID: 22 Comm: kworker/u4:1 Not tainted 4.14.150 #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:17 [inline]
dump_stack+0x138/0x197 lib/dump_stack.c:53
print_address_description.cold+0x7c/0x1dc 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/0x2af mm/kasan/report.c:393
__asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:430
qfq_reset_qdisc+0x24c/0x2c0 net/sched/sch_qfq.c:1463
qdisc_destroy+0x11d/0x320 net/sched/sch_generic.c:723
dev_shutdown+0x28e/0x44b net/sched/sch_generic.c:1000
rollback_registered_many+0x6fd/0xb60 net/core/dev.c:7207
unregister_netdevice_many.part.0+0x1b/0x1e0 net/core/dev.c:8267
unregister_netdevice_many net/core/dev.c:8266 [inline]
default_device_exit_batch+0x31e/0x3d0 net/core/dev.c:8728
ops_exit_list.isra.0+0xfc/0x150 net/core/net_namespace.c:145
cleanup_net+0x3ba/0x880 net/core/net_namespace.c:484
process_one_work+0x863/0x1600 kernel/workqueue.c:2114
worker_thread+0x5d9/0x1050 kernel/workqueue.c:2248
kthread+0x319/0x430 kernel/kthread.c:232
ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404

Allocated by task 20286:
save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59
save_stack+0x45/0xd0 mm/kasan/kasan.c:447
set_track mm/kasan/kasan.c:459 [inline]
kasan_kmalloc mm/kasan/kasan.c:551 [inline]
kasan_kmalloc+0xce/0xf0 mm/kasan/kasan.c:529
kmem_cache_alloc_trace+0x152/0x790 mm/slab.c:3618
kmalloc include/linux/slab.h:488 [inline]
sock_alloc_inode+0x63/0x260 net/socket.c:254
alloc_inode+0x64/0x180 fs/inode.c:209
new_inode_pseudo+0x19/0xf0 fs/inode.c:891
sock_alloc+0x41/0x280 net/socket.c:569
__sock_create+0x8f/0x620 net/socket.c:1239
sock_create net/socket.c:1315 [inline]
SYSC_socket net/socket.c:1345 [inline]
SyS_socket+0xd3/0x170 net/socket.c:1325
do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x42/0xb7

Freed by task 7:
save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59
save_stack+0x45/0xd0 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+0xcc/0x270 mm/slab.c:3815
__rcu_reclaim kernel/rcu/rcu.h:190 [inline]
rcu_do_batch kernel/rcu/tree.c:2699 [inline]
invoke_rcu_callbacks kernel/rcu/tree.c:2962 [inline]
__rcu_process_callbacks kernel/rcu/tree.c:2929 [inline]
rcu_process_callbacks+0x8d0/0x12b0 kernel/rcu/tree.c:2946
__do_softirq+0x244/0x9a0 kernel/softirq.c:288

The buggy address belongs to the object at ffff8880812e1d80
which belongs to the cache kmalloc-128 of size 128
The buggy address is located 72 bytes inside of
128-byte region [ffff8880812e1d80, ffff8880812e1e00)
The buggy address belongs to the page:
page:ffffea000204b840 count:1 mapcount:0 mapping:ffff8880812e1000 index:0x0
flags: 0x1fffc0000000100(slab)
raw: 01fffc0000000100 ffff8880812e1000 0000000000000000 0000000100000015
raw: ffffea00027ad360 ffffea0001643560 ffff8880aa800640 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff8880812e1c80: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb
ffff8880812e1d00: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
> ffff8880812e1d80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff8880812e1e00: fc fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00
ffff8880812e1e80: 00 00 00 00 00 00 fc fc 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,
Dec 29, 2020, 11:03:11 PM12/29/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