syzbot


KASAN: use-after-free Read in h5_rx_3wire_hdr

Status: auto-closed as invalid on 2020/08/08 17:48
Reported-by: syzbot+8824f9ee4797b2590447@syzkaller.appspotmail.com
First crash: 1518d, last: 1476d
Similar bugs (3)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: use-after-free Read in h5_rx_3wire_hdr bluetooth syz error 3 973d 1739d 0/26 auto-obsoleted due to no activity on 2023/04/15 21:58
linux-4.19 KASAN: use-after-free Read in h5_rx_3wire_hdr (2) 1 1029d 1029d 0/1 auto-closed as invalid on 2021/10/29 20:15
linux-4.14 KASAN: use-after-free Read in h5_rx_3wire_hdr syz inconclusive 2 1412d 1742d 0/1 upstream: reported syz repro on 2019/07/20 02:11

Sample crash report:
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 ffff88809b3ed3d8 by task syz-executor.2/29580

CPU: 1 PID: 29580 Comm: syz-executor.2 Not tainted 4.19.114-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
 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
netlink: 'syz-executor.4': attribute type 5 has an invalid length.
 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:0x45c889
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
RSP: 002b:00007f98896e3c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f98896e46d4 RCX: 000000000045c889
RDX: 0000000020000080 RSI: 0000000000005412 RDI: 0000000000000003
RBP: 000000000076bfa0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff
R13: 0000000000000582 R14: 00000000004c81b7 R15: 000000000076bfac

Allocated by task 22118:
 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:2155
 worker_thread+0x96/0xe20 kernel/workqueue.c:2298
 kthread+0x34a/0x420 kernel/kthread.c:246
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415

Freed by task 22118:
 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:2155
 worker_thread+0x96/0xe20 kernel/workqueue.c:2298
 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 ffff88809b3ed300
 which belongs to the cache skbuff_head_cache of size 232
The buggy address is located 216 bytes inside of
 232-byte region [ffff88809b3ed300, ffff88809b3ed3e8)
The buggy address belongs to the page:
page:ffffea00026cfb40 count:1 mapcount:0 mapping:ffff8880a9fb5ac0 index:0x0
flags: 0xfffe0000000100(slab)
raw: 00fffe0000000100 ffffea00027b0ec8 ffffea0002a24388 ffff8880a9fb5ac0
raw: 0000000000000000 ffff88809b3ed080 000000010000000c 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff88809b3ed280: fb fb fb fb fb fc fc fc fc fc fc fc fc fc fc fc
 ffff88809b3ed300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88809b3ed380: fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc
                                                    ^
 ffff88809b3ed400: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb
 ffff88809b3ed480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
Bluetooth: Invalid header checksum
Bluetooth: Invalid header checksum

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/04/10 17:47 linux-4.19.y dda0e2920330 a8c6a3f8 .config console log report ci2-linux-4-19
2020/02/28 08:33 linux-4.19.y f25804f38984 c88c7b75 .config console log report ci2-linux-4-19
* Struck through repros no longer work on HEAD.