syzbot


KASAN: slab-out-of-bounds Read in hci_le_meta_evt

Status: fixed on 2021/03/10 01:49
Reported-by: syzbot+24ebd650e20bd263ca01@syzkaller.appspotmail.com
Fix commit: f7e0e8b2f1b0 Bluetooth: Fix slab-out-of-bounds read in hci_le_direct_adv_report_evt()
First crash: 703d, last: 580d

Cause bisection: failed (bisect log)

Fix bisection: failed (bisect log)
similar bugs (4):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.14 KASAN: slab-out-of-bounds Read in hci_le_meta_evt C done 15 582d 702d 1/1 fixed on 2020/12/30 13:33
upstream KASAN: slab-out-of-bounds Read in hci_le_meta_evt (2) C inconclusive 2 247d 247d 22/22 fixed on 2022/03/08 16:11
linux-4.19 KASAN: slab-out-of-bounds Read in hci_le_meta_evt C done 12 563d 704d 1/1 fixed on 2021/01/18 14:01
linux-4.19 KASAN: slab-out-of-bounds Read in hci_le_meta_evt (2) C error 1 266d 416d 0/1 upstream: reported C repro on 2021/05/14 20:19
Patch testing requests:
Created Duration User Patch Repo Result
2020/12/23 16:49 15m yepeilin.cs@gmail.com patch git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git linux-4.14.y OK
2020/08/05 16:50 16m yepeilin.cs@gmail.com patch upstream OK
2020/08/05 12:05 5m yepeilin.cs@gmail.com patch linux-next error
2020/08/05 03:07 0m yepeilin.cs@gmail.com patch linux-next error

Sample crash report:
==================================================================
BUG: KASAN: slab-out-of-bounds in hci_le_direct_adv_report_evt net/bluetooth/hci_event.c:5875 [inline]
BUG: KASAN: slab-out-of-bounds in hci_le_meta_evt+0x3937/0x3ff0 net/bluetooth/hci_event.c:5939
Read of size 1 at addr ffff888092006e0c by task kworker/u5:2/6852

CPU: 1 PID: 6852 Comm: kworker/u5:2 Not tainted 5.9.0-rc2-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: hci0 hci_rx_work
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x18f/0x20d lib/dump_stack.c:118
 print_address_description.constprop.0.cold+0xae/0x497 mm/kasan/report.c:383
 __kasan_report mm/kasan/report.c:513 [inline]
 kasan_report.cold+0x1f/0x37 mm/kasan/report.c:530
 hci_le_direct_adv_report_evt net/bluetooth/hci_event.c:5875 [inline]
 hci_le_meta_evt+0x3937/0x3ff0 net/bluetooth/hci_event.c:5939
 hci_event_packet+0x2e25/0x87a8 net/bluetooth/hci_event.c:6192
 hci_rx_work+0x22e/0xb50 net/bluetooth/hci_core.c:4889
 process_one_work+0x94c/0x1670 kernel/workqueue.c:2269
 worker_thread+0x64c/0x1120 kernel/workqueue.c:2415
 kthread+0x3b5/0x4a0 kernel/kthread.c:292
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294

Allocated by task 6846:
 kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48
 kasan_set_track mm/kasan/common.c:56 [inline]
 __kasan_kmalloc.constprop.0+0xbf/0xd0 mm/kasan/common.c:461
 __kmalloc_reserve net/core/skbuff.c:142 [inline]
 __alloc_skb+0xae/0x550 net/core/skbuff.c:210
 alloc_skb include/linux/skbuff.h:1085 [inline]
 bt_skb_alloc include/net/bluetooth/bluetooth.h:389 [inline]
 vhci_get_user drivers/bluetooth/hci_vhci.c:165 [inline]
 vhci_write+0xbd/0x450 drivers/bluetooth/hci_vhci.c:285
 call_write_iter include/linux/fs.h:1882 [inline]
 new_sync_write+0x422/0x650 fs/read_write.c:503
 vfs_write+0x5ad/0x730 fs/read_write.c:578
 ksys_write+0x12d/0x250 fs/read_write.c:631
 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xa9

The buggy address belongs to the object at ffff888092006c00
 which belongs to the cache kmalloc-512 of size 512
The buggy address is located 12 bytes to the right of
 512-byte region [ffff888092006c00, ffff888092006e00)
The buggy address belongs to the page:
page:00000000bf4cfd8b refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x92006
flags: 0xfffe0000000200(slab)
raw: 00fffe0000000200 ffffea00027d9e48 ffffea000278e408 ffff8880aa040600
raw: 0000000000000000 ffff888092006000 0000000100000004 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff888092006d00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff888092006d80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff888092006e00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
                      ^
 ffff888092006e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff888092006f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================

Crashes (45):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-kasan-gce-selinux-root 2020/08/27 09:54 upstream 15bc20c6af4c 816e0689 .config log report syz C
ci-upstream-kasan-gce 2020/08/27 05:05 upstream 15bc20c6af4c 318430cb .config log report syz C
ci-upstream-kasan-gce 2020/08/14 18:39 upstream a1d21081a60d 424dd8e7 .config log report syz C
ci-upstream-kasan-gce 2020/08/14 18:19 upstream a1d21081a60d 424dd8e7 .config log report syz C
ci-upstream-kasan-gce 2020/08/13 00:48 upstream fb893de323e2 bc15f7db .config log report syz C
ci-upstream-kasan-gce-root 2020/08/05 04:40 upstream c0842fbc1b18 80a06902 .config log report syz C
ci-upstream-kasan-gce-root 2020/08/05 04:21 upstream c0842fbc1b18 80a06902 .config log report syz C
ci-upstream-kasan-gce-selinux-root 2020/08/03 11:56 upstream 5a30a78924ec 196277c4 .config log report syz C
ci-upstream-kasan-gce-selinux-root 2020/08/03 11:36 upstream 5a30a78924ec 196277c4 .config log report syz C
ci-upstream-kasan-gce-root 2020/08/02 20:54 upstream ac3a0c847296 63a73341 .config log report syz C
ci-upstream-kasan-gce-selinux-root 2020/08/01 05:16 upstream d8b9faec54ae d895b3be .config log report syz C
ci-upstream-kasan-gce-386 2020/08/27 04:38 upstream 15bc20c6af4c 318430cb .config log report syz C
ci-upstream-kasan-gce-386 2020/08/14 17:32 upstream a1d21081a60d 424dd8e7 .config log report syz C
ci-upstream-kasan-gce-386 2020/08/14 17:12 upstream a1d21081a60d 424dd8e7 .config log report syz C
ci-upstream-kasan-gce-386 2020/08/13 02:42 upstream fb893de323e2 bc15f7db .config log report syz C
ci-upstream-linux-next-kasan-gce-root 2020/08/27 02:25 linux-next f37be72473a0 318430cb .config log report syz C
ci-upstream-linux-next-kasan-gce-root 2020/08/07 03:28 linux-next 01830e6c042e 1f122f88 .config log report syz C
ci-upstream-linux-next-kasan-gce-root 2020/08/07 03:08 linux-next 01830e6c042e 1f122f88 .config log report syz C
ci-upstream-linux-next-kasan-gce-root 2020/08/04 22:15 linux-next 01830e6c042e 80a06902 .config log report syz C
ci-upstream-kasan-gce-selinux-root 2020/12/02 12:52 upstream 509a15421674 c42a35e9 .config log report info
ci-upstream-kasan-gce 2020/11/02 09:41 upstream 3cea11cd5e3b 8bc4594f .config log report info
ci-upstream-kasan-gce-root 2020/08/08 23:30 upstream 449dc8c97089 f721e4a0 .config log report
ci-upstream-kasan-gce-root 2020/08/08 04:32 upstream 5631c5e0eb90 ff51e522 .config log report
ci-upstream-kasan-gce-root 2020/08/08 04:32 upstream 5631c5e0eb90 ff51e522 .config log report
ci-upstream-kasan-gce-selinux-root 2020/08/08 04:02 upstream 5631c5e0eb90 ff51e522 .config log report
ci-upstream-kasan-gce-selinux-root 2020/08/08 03:58 upstream 5631c5e0eb90 ff51e522 .config log report
ci-qemu-upstream 2020/08/08 03:05 upstream fffe3ae0ee84 28ac5c9e .config log report
ci-qemu-upstream 2020/08/08 03:04 upstream fffe3ae0ee84 28ac5c9e .config log report
ci-upstream-kasan-gce-root 2020/08/07 18:48 upstream d6efb3ac3e6c cb436c69 .config log report
ci-upstream-kasan-gce-selinux-root 2020/08/07 18:35 upstream d6efb3ac3e6c cb436c69 .config log report
ci-upstream-kasan-gce-selinux-root 2020/08/07 16:34 upstream d6efb3ac3e6c cb436c69 .config log report
ci-upstream-kasan-gce-root 2020/08/07 16:19 upstream d6efb3ac3e6c cb436c69 .config log report
ci-upstream-kasan-gce-selinux-root 2020/08/07 15:06 upstream d6efb3ac3e6c cb436c69 .config log report
ci-upstream-kasan-gce-root 2020/08/07 15:04 upstream d6efb3ac3e6c cb436c69 .config log report
ci-upstream-kasan-gce-root 2020/08/02 12:40 upstream ac3a0c847296 63a73341 .config log report
ci-upstream-kasan-gce-selinux-root 2020/08/02 12:24 upstream ac3a0c847296 63a73341 .config log report
ci-upstream-kasan-gce-selinux-root 2020/08/02 12:24 upstream ac3a0c847296 63a73341 .config log report
ci-upstream-kasan-gce-root 2020/08/02 11:20 upstream ac3a0c847296 63a73341 .config log report
ci-upstream-kasan-gce-selinux-root 2020/08/02 11:15 upstream ac3a0c847296 63a73341 .config log report
ci-upstream-linux-next-kasan-gce-root 2020/09/24 13:21 linux-next dcf2427baa64 54289b08 .config log report info
ci-upstream-linux-next-kasan-gce-root 2020/08/16 10:16 linux-next 4993e4fe12af 424dd8e7 .config log report
ci-upstream-linux-next-kasan-gce-root 2020/08/08 08:25 linux-next 01830e6c042e ff51e522 .config log report
ci-upstream-linux-next-kasan-gce-root 2020/08/08 03:51 linux-next 01830e6c042e ff51e522 .config log report
ci-upstream-linux-next-kasan-gce-root 2020/08/07 15:10 linux-next 01830e6c042e cb436c69 .config log report
ci-upstream-linux-next-kasan-gce-root 2020/08/02 11:22 linux-next 01830e6c042e 63a73341 .config log report