KASAN: use-after-free Read in h5_rx_3wire_hdr

14 views
Skip to first unread message

syzbot

unread,
Feb 28, 2020, 3:34:13 AM2/28/20
to syzkaller...@googlegroups.com
Hello,

syzbot found the following crash on:

HEAD commit: f25804f3 Linux 4.19.106
git tree: linux-4.19.y
console output: https://syzkaller.appspot.com/x/log.txt?x=126e9c55e00000
kernel config: https://syzkaller.appspot.com/x/.config?x=a5f029a69ae922fd
dashboard link: https://syzkaller.appspot.com/bug?extid=8824f9ee4797b2590447
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+8824f9...@syzkaller.appspotmail.com

Bluetooth: Invalid header checksum
Bluetooth: Invalid header checksum
==================================================================
BUG: KASAN: use-after-free in h5_rx_3wire_hdr+0x38c/0x3b0 drivers/bluetooth/hci_h5.c:444
Read of size 8 at addr ffff88808c71a5d8 by task syz-executor.3/30913

CPU: 0 PID: 30913 Comm: syz-executor.3 Not tainted 4.19.106-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+0x188/0x20d lib/dump_stack.c:118
print_address_description.cold+0x7c/0x212 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+0x88/0x2b9 mm/kasan/report.c:396
h5_rx_3wire_hdr+0x38c/0x3b0 drivers/bluetooth/hci_h5.c:444
h5_recv+0x2d4/0x460 drivers/bluetooth/hci_h5.c:576
hci_uart_tty_receive+0x21d/0x520 drivers/bluetooth/hci_ldisc.c:620
Bluetooth: Invalid header checksum
tiocsti drivers/tty/tty_io.c:2194 [inline]
tty_ioctl+0xe0a/0x1420 drivers/tty/tty_io.c:2580
vfs_ioctl fs/ioctl.c:46 [inline]
file_ioctl fs/ioctl.c:501 [inline]
do_vfs_ioctl+0xcda/0x12e0 fs/ioctl.c:688
ksys_ioctl+0x9b/0xc0 fs/ioctl.c:705
__do_sys_ioctl fs/ioctl.c:712 [inline]
__se_sys_ioctl fs/ioctl.c:710 [inline]
__x64_sys_ioctl+0x6f/0xb0 fs/ioctl.c:710
do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x45c479
Code: ad b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 7b b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00
Bluetooth: Invalid header checksum
RSP: 002b:00007feb47ad3c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007feb47ad46d4 RCX: 000000000045c479
RDX: 00000000200000c0 RSI: 0000000000005412 RDI: 0000000000000003
RBP: 000000000076c060 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff
R13: 0000000000000583 R14: 00000000004c7d91 R15: 000000000076c06c

Allocated by task 107:
set_track mm/kasan/kasan.c:460 [inline]
kasan_kmalloc mm/kasan/kasan.c:553 [inline]
kasan_kmalloc+0xbf/0xe0 mm/kasan/kasan.c:531
kmem_cache_alloc_node+0x148/0x730 mm/slab.c:3649
__alloc_skb+0xba/0x5b0 net/core/skbuff.c:193
alloc_skb include/linux/skbuff.h:995 [inline]
bt_skb_alloc include/net/bluetooth/bluetooth.h:339 [inline]
h5_rx_pkt_start+0xcb/0x270 drivers/bluetooth/hci_h5.c:487
h5_recv+0x2d4/0x460 drivers/bluetooth/hci_h5.c:576
hci_uart_tty_receive+0x21d/0x520 drivers/bluetooth/hci_ldisc.c:620
tty_ldisc_receive_buf+0x14a/0x190 drivers/tty/tty_buffer.c:460
tty_port_default_receive_buf+0x78/0xa0 drivers/tty/tty_port.c:38
receive_buf drivers/tty/tty_buffer.c:476 [inline]
flush_to_ldisc+0x21d/0x390 drivers/tty/tty_buffer.c:528
process_one_work+0x91f/0x1640 kernel/workqueue.c:2153
worker_thread+0x96/0xe20 kernel/workqueue.c:2296
kthread+0x34a/0x420 kernel/kthread.c:246
ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415
Bluetooth: Invalid header checksum

Freed by task 107:
set_track mm/kasan/kasan.c:460 [inline]
__kasan_slab_free+0xf7/0x140 mm/kasan/kasan.c:521
__cache_free mm/slab.c:3503 [inline]
kmem_cache_free+0x7f/0x260 mm/slab.c:3765
kfree_skbmem+0xc1/0x140 net/core/skbuff.c:586
__kfree_skb net/core/skbuff.c:646 [inline]
kfree_skb net/core/skbuff.c:663 [inline]
kfree_skb+0xe9/0x390 net/core/skbuff.c:657
h5_reset_rx+0x47/0x100 drivers/bluetooth/hci_h5.c:543
h5_rx_3wire_hdr+0x2ee/0x3b0 drivers/bluetooth/hci_h5.c:453
h5_recv+0x2d4/0x460 drivers/bluetooth/hci_h5.c:576
hci_uart_tty_receive+0x21d/0x520 drivers/bluetooth/hci_ldisc.c:620
tty_ldisc_receive_buf+0x14a/0x190 drivers/tty/tty_buffer.c:460
tty_port_default_receive_buf+0x78/0xa0 drivers/tty/tty_port.c:38
receive_buf drivers/tty/tty_buffer.c:476 [inline]
flush_to_ldisc+0x21d/0x390 drivers/tty/tty_buffer.c:528
process_one_work+0x91f/0x1640 kernel/workqueue.c:2153
worker_thread+0x96/0xe20 kernel/workqueue.c:2296
kthread+0x34a/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 ffff88808c71a500
which belongs to the cache skbuff_head_cache of size 232
The buggy address is located 216 bytes inside of
232-byte region [ffff88808c71a500, ffff88808c71a5e8)
The buggy address belongs to the page:
page:ffffea000231c680 count:1 mapcount:0 mapping:ffff8880a9fadac0 index:0x0
Bluetooth: Invalid header checksum
flags: 0xfffe0000000100(slab)
raw: 00fffe0000000100 ffffea0002545088 ffffea000254ff48 ffff8880a9fadac0
raw: 0000000000000000 ffff88808c71a000 000000010000000c 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff88808c71a480: fb fb fb fb fb fc fc fc fc fc fc fc fc fc fc fc
ffff88808c71a500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88808c71a580: fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc
^
ffff88808c71a600: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb
ffff88808c71a680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================


---
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,
Aug 8, 2020, 1:48:14 PM8/8/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