KASAN: use-after-free Read in sco_conn_del

13 views
Skip to first unread message

syzbot

unread,
Sep 25, 2021, 1:42:26 PM9/25/21
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 2950c9c5e0df Linux 4.19.207
git tree: linux-4.19.y
console output: https://syzkaller.appspot.com/x/log.txt?x=13d6f67f300000
kernel config: https://syzkaller.appspot.com/x/.config?x=8273060cfa230984
dashboard link: https://syzkaller.appspot.com/bug?extid=db00fca6867014d4b691
compiler: gcc version 10.2.1 20210110 (Debian 10.2.1-6)

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

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

netlink: 'syz-executor.2': attribute type 29 has an invalid length.
==================================================================
device bridge0 entered promiscuous mode
BUG: KASAN: use-after-free in trace_event_get_offsets_lock_acquire include/trace/events/lock.h:13 [inline]
BUG: KASAN: use-after-free in perf_trace_lock_acquire+0x402/0x530 include/trace/events/lock.h:13
Read of size 8 at addr ffff88809c10e938 by task syz-executor.5/15809

CPU: 0 PID: 15809 Comm: syz-executor.5 Not tainted 4.19.207-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+0x1fc/0x2ef lib/dump_stack.c:118
print_address_description.cold+0x54/0x219 mm/kasan/report.c:256
kasan_report_error.cold+0x8a/0x1b9 mm/kasan/report.c:354
kasan_report mm/kasan/report.c:412 [inline]
__asan_report_load8_noabort+0x88/0x90 mm/kasan/report.c:433
trace_event_get_offsets_lock_acquire include/trace/events/lock.h:13 [inline]
perf_trace_lock_acquire+0x402/0x530 include/trace/events/lock.h:13
trace_lock_acquire include/trace/events/lock.h:13 [inline]
lock_acquire+0x298/0x3c0 kernel/locking/lockdep.c:3907
__raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline]
_raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:144
spin_lock include/linux/spinlock.h:329 [inline]
sco_conn_del+0xbb/0x1a0 net/bluetooth/sco.c:194
sco_disconn_cfm+0x74/0xb0 net/bluetooth/sco.c:1150
hci_disconn_cfm include/net/bluetooth/hci_core.h:1263 [inline]
hci_conn_hash_flush+0x127/0x260 net/bluetooth/hci_conn.c:1512
hci_dev_do_close+0x6bc/0x1020 net/bluetooth/hci_core.c:1687
hci_unregister_dev+0x14f/0x460 net/bluetooth/hci_core.c:3288
vhci_release+0x70/0xe0 drivers/bluetooth/hci_vhci.c:354
__fput+0x2ce/0x890 fs/file_table.c:278
task_work_run+0x148/0x1c0 kernel/task_work.c:113
exit_task_work include/linux/task_work.h:22 [inline]
do_exit+0xbf3/0x2be0 kernel/exit.c:870
do_group_exit+0x125/0x310 kernel/exit.c:967
get_signal+0x3f2/0x1f70 kernel/signal.c:2589
do_signal+0x8f/0x1670 arch/x86/kernel/signal.c:799
exit_to_usermode_loop+0x204/0x2a0 arch/x86/entry/common.c:163
prepare_exit_to_usermode arch/x86/entry/common.c:198 [inline]
syscall_return_slowpath arch/x86/entry/common.c:271 [inline]
do_syscall_64+0x538/0x620 arch/x86/entry/common.c:296
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x7fedbfad6709
Code: Bad RIP value.
RSP: 002b:00007fedbd04d218 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca
RAX: fffffffffffffe00 RBX: 00007fedbfbdaf68 RCX: 00007fedbfad6709
RDX: 0000000000000000 RSI: 0000000000000080 RDI: 00007fedbfbdaf68
RBP: 00007fedbfbdaf60 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007fedbfbdaf6c
R13: 00007fff45c190bf R14: 00007fedbd04d300 R15: 0000000000022000

Allocated by task 15097:
__do_kmalloc mm/slab.c:3727 [inline]
__kmalloc+0x15a/0x3c0 mm/slab.c:3736
kmalloc include/linux/slab.h:520 [inline]
sk_prot_alloc+0x1e2/0x2d0 net/core/sock.c:1466
sk_alloc+0x36/0xec0 net/core/sock.c:1520
sco_sock_alloc.constprop.0+0x31/0x200 net/bluetooth/sco.c:480
sco_sock_create+0xd5/0x180 net/bluetooth/sco.c:515
bt_sock_create+0x154/0x2a0 net/bluetooth/af_bluetooth.c:130
__sock_create+0x3d8/0x740 net/socket.c:1365
sock_create net/socket.c:1416 [inline]
__sys_socket+0xef/0x200 net/socket.c:1458
__do_sys_socket net/socket.c:1467 [inline]
__se_sys_socket net/socket.c:1465 [inline]
__x64_sys_socket+0x6f/0xb0 net/socket.c:1465
do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 15099:
__cache_free mm/slab.c:3503 [inline]
kfree+0xcc/0x210 mm/slab.c:3822
sk_prot_free net/core/sock.c:1503 [inline]
__sk_destruct+0x684/0x8a0 net/core/sock.c:1584
sk_destruct net/core/sock.c:1599 [inline]
__sk_free+0x165/0x3b0 net/core/sock.c:1610
sk_free+0x3b/0x50 net/core/sock.c:1621
sock_put include/net/sock.h:1711 [inline]
sco_sock_kill.part.0+0xaa/0xc0 net/bluetooth/sco.c:412
sco_sock_kill net/bluetooth/sco.c:404 [inline]
sco_sock_release+0x1a2/0x330 net/bluetooth/sco.c:1035
__sock_release+0xcd/0x2a0 net/socket.c:599
sock_close+0x15/0x20 net/socket.c:1214
__fput+0x2ce/0x890 fs/file_table.c:278
task_work_run+0x148/0x1c0 kernel/task_work.c:113
get_signal+0x1b64/0x1f70 kernel/signal.c:2400
do_signal+0x8f/0x1670 arch/x86/kernel/signal.c:799
exit_to_usermode_loop+0x204/0x2a0 arch/x86/entry/common.c:163
prepare_exit_to_usermode arch/x86/entry/common.c:198 [inline]
syscall_return_slowpath arch/x86/entry/common.c:271 [inline]
do_syscall_64+0x538/0x620 arch/x86/entry/common.c:296
entry_SYSCALL_64_after_hwframe+0x49/0xbe

The buggy address belongs to the object at ffff88809c10e880
which belongs to the cache kmalloc-2048 of size 2048
The buggy address is located 184 bytes inside of
2048-byte region [ffff88809c10e880, ffff88809c10f080)
The buggy address belongs to the page:
page:ffffea0002704380 count:1 mapcount:0 mapping:ffff88813bff0c40 index:0x0 compound_mapcount: 0
flags: 0xfff00000008100(slab|head)
raw: 00fff00000008100 ffffea0001070608 ffffea0000e4bf08 ffff88813bff0c40
raw: 0000000000000000 ffff88809c10e000 0000000100000003 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff88809c10e800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88809c10e880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88809c10e900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88809c10e980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88809c10ea00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================


---
This report 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 issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

syzbot

unread,
Apr 3, 2022, 1:14:14 PM4/3/22
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