syzbot


KASAN: use-after-free Read in hci_chan_del

Status: upstream: reported C repro on 2020/08/03 13:37
Reported-by: syzbot+985dfa65ff9ce7b7cd31@syzkaller.appspotmail.com
First crash: 1572d, last: 837d
Fix bisection: failed (error log, bisect log)
  
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.19 KASAN: use-after-free Read in hci_chan_del C done 24 1227d 1573d 1/1 fixed on 2021/08/15 11:28
upstream KASAN: use-after-free Read in hci_chan_del bluetooth C done done 87 1294d 1573d 0/28 auto-obsoleted due to no activity on 2023/04/13 23:02
Last patch testing requests (10)
Created Duration User Patch Repo Result
2023/03/04 02:32 0m retest repro linux-4.14.y error
2023/03/04 01:32 0m retest repro linux-4.14.y error
2023/03/04 00:32 0m retest repro linux-4.14.y error
2023/03/03 23:32 0m retest repro linux-4.14.y error
2023/03/03 22:32 10m retest repro linux-4.14.y report log
2023/03/03 21:32 0m retest repro linux-4.14.y error
2023/03/03 20:32 0m retest repro linux-4.14.y error
2023/03/03 19:32 0m retest repro linux-4.14.y error
2023/03/03 18:32 0m retest repro linux-4.14.y error
2023/03/03 17:32 0m retest repro linux-4.14.y error
Fix bisection attempts (22)
Created Duration User Patch Repo Result
2022/09/08 13:26 11m bisect fix linux-4.14.y error job log
2022/08/09 10:07 23m bisect fix linux-4.14.y OK (0) job log log
2022/07/10 09:43 23m bisect fix linux-4.14.y OK (0) job log log
2022/06/10 09:18 24m bisect fix linux-4.14.y OK (0) job log log
2022/05/11 08:56 21m bisect fix linux-4.14.y OK (0) job log log
2022/04/09 18:55 24m bisect fix linux-4.14.y OK (0) job log log
2022/03/10 13:18 28m bisect fix linux-4.14.y OK (0) job log log
2022/02/08 12:46 32m bisect fix linux-4.14.y OK (0) job log log
2022/01/09 12:21 24m bisect fix linux-4.14.y OK (0) job log log
2021/12/10 11:52 28m bisect fix linux-4.14.y OK (0) job log log
2021/11/10 11:27 25m bisect fix linux-4.14.y OK (0) job log log
2021/10/11 10:55 31m bisect fix linux-4.14.y OK (0) job log log
2021/09/11 10:25 30m bisect fix linux-4.14.y OK (0) job log log
2021/08/12 09:56 28m bisect fix linux-4.14.y OK (0) job log log
2021/07/13 09:22 34m bisect fix linux-4.14.y OK (0) job log log
2021/06/13 08:53 28m bisect fix linux-4.14.y OK (0) job log log
2021/03/21 00:14 21m bisect fix linux-4.14.y OK (0) job log log
2021/02/17 16:21 18m bisect fix linux-4.14.y error job log
2021/02/02 21:47 0m (2) bisect fix linux-4.14.y error job log
2021/01/01 07:18 22m bisect fix linux-4.14.y OK (0) job log log
2020/10/28 15:30 22m bisect fix linux-4.14.y OK (0) job log log
2020/09/09 06:43 29m bisect fix linux-4.14.y OK (0) job log log

Sample crash report:
audit: type=1400 audit(1601306915.323:8): avc:  denied  { execmem } for  pid=6384 comm="syz-executor465" scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclass=process permissive=1
IPVS: ftp: loaded support on port[0] = 21
==================================================================
BUG: KASAN: use-after-free in hci_chan_del+0x131/0x180 net/bluetooth/hci_conn.c:1547
Read of size 8 at addr ffff8880926c63d8 by task syz-executor465/6385

CPU: 0 PID: 6385 Comm: syz-executor465 Not tainted 4.14.198-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x1b2/0x283 lib/dump_stack.c:58
 print_address_description.cold+0x54/0x1d3 mm/kasan/report.c:252
 kasan_report_error.cold+0x8a/0x194 mm/kasan/report.c:351
 kasan_report mm/kasan/report.c:409 [inline]
 __asan_report_load8_noabort+0x68/0x70 mm/kasan/report.c:430
 hci_chan_del+0x131/0x180 net/bluetooth/hci_conn.c:1547
 l2cap_conn_del+0x417/0x670 net/bluetooth/l2cap_core.c:1736
 l2cap_disconn_cfm net/bluetooth/l2cap_core.c:7435 [inline]
 l2cap_disconn_cfm+0x6b/0x80 net/bluetooth/l2cap_core.c:7428
 hci_disconn_cfm include/net/bluetooth/hci_core.h:1226 [inline]
 hci_conn_hash_flush+0x114/0x220 net/bluetooth/hci_conn.c:1376
 hci_dev_do_close+0x542/0xc50 net/bluetooth/hci_core.c:1620
 hci_unregister_dev+0x170/0x7a0 net/bluetooth/hci_core.c:3191
 vhci_release+0x70/0xe0 drivers/bluetooth/hci_vhci.c:354
 __fput+0x25f/0x7a0 fs/file_table.c:210
 task_work_run+0x11f/0x190 kernel/task_work.c:113
 exit_task_work include/linux/task_work.h:22 [inline]
 do_exit+0xa08/0x27f0 kernel/exit.c:865
 do_group_exit+0x100/0x2e0 kernel/exit.c:962
 SYSC_exit_group kernel/exit.c:973 [inline]
 SyS_exit_group+0x19/0x20 kernel/exit.c:971
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x46/0xbb
RIP: 0033:0x4450c8
RSP: 002b:00007ffea48c61c8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00000000004450c8
RDX: 0000000000000001 RSI: 000000000000003c RDI: 0000000000000001
RBP: 00000000004cce50 R08: 00000000000000e7 R09: ffffffffffffffd0
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00000000006e0200 R14: 0000000000000000 R15: 0000000000000000

Allocated by task 6388:
 save_stack mm/kasan/kasan.c:447 [inline]
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_kmalloc+0xeb/0x160 mm/kasan/kasan.c:551
 kmem_cache_alloc_trace+0x131/0x3d0 mm/slab.c:3618
 kmalloc include/linux/slab.h:488 [inline]
 kzalloc include/linux/slab.h:661 [inline]
 hci_chan_create+0x7c/0x300 net/bluetooth/hci_conn.c:1532
 l2cap_conn_add.part.0+0x18/0xc20 net/bluetooth/l2cap_core.c:7056
 l2cap_conn_add net/bluetooth/l2cap_core.c:7415 [inline]
 l2cap_connect_cfm+0x1d2/0xce0 net/bluetooth/l2cap_core.c:7373
 hci_connect_cfm include/net/bluetooth/hci_core.h:1211 [inline]
 hci_le_conn_complete_evt net/bluetooth/hci_event.c:4609 [inline]
 hci_le_meta_evt+0x3288/0x3fc0 net/bluetooth/hci_event.c:5168
 hci_event_packet+0x19eb/0x7d1d net/bluetooth/hci_event.c:5423
 hci_rx_work+0x3e6/0x970 net/bluetooth/hci_core.c:4244
 process_one_work+0x793/0x14a0 kernel/workqueue.c:2116
 worker_thread+0x5cc/0xff0 kernel/workqueue.c:2250
 kthread+0x30d/0x420 kernel/kthread.c:232
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404

Freed by task 1200:
 save_stack mm/kasan/kasan.c:447 [inline]
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_slab_free+0xc3/0x1a0 mm/kasan/kasan.c:524
 __cache_free mm/slab.c:3496 [inline]
 kfree+0xc9/0x250 mm/slab.c:3815
 hci_disconn_loglink_complete_evt net/bluetooth/hci_event.c:4440 [inline]
 hci_event_packet+0xee6/0x7d1d net/bluetooth/hci_event.c:5444
 hci_rx_work+0x3e6/0x970 net/bluetooth/hci_core.c:4244
 process_one_work+0x793/0x14a0 kernel/workqueue.c:2116
 worker_thread+0x5cc/0xff0 kernel/workqueue.c:2250
 kthread+0x30d/0x420 kernel/kthread.c:232
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404

The buggy address belongs to the object at ffff8880926c63c0
 which belongs to the cache kmalloc-128 of size 128
The buggy address is located 24 bytes inside of
 128-byte region [ffff8880926c63c0, ffff8880926c6440)
The buggy address belongs to the page:
page:ffffea000249b180 count:1 mapcount:0 mapping:ffff8880926c6000 index:0xffff8880926c6780
flags: 0xfffe0000000100(slab)
raw: 00fffe0000000100 ffff8880926c6000 ffff8880926c6780 0000000100000009
raw: ffffea0002692a20 ffffea0002376320 ffff88812fe50640 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8880926c6280: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
 ffff8880926c6300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8880926c6380: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb
                                                    ^
 ffff8880926c6400: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
 ffff8880926c6480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (21):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/09/28 15:30 linux-4.14.y cbfa1702aaf6 6bfdbe89 .config console log report syz C ci2-linux-4-14
2020/08/10 05:33 linux-4.14.y 14b58326976d 70301872 .config console log report syz C ci2-linux-4-14
2020/08/08 08:14 linux-4.14.y 14b58326976d ff51e522 .config console log report syz C ci2-linux-4-14
2020/08/07 04:15 linux-4.14.y ca4f2c56d416 cb436c69 .config console log report syz C ci2-linux-4-14
2020/08/06 18:29 linux-4.14.y ca4f2c56d416 4ca1c0ea .config console log report syz C ci2-linux-4-14
2020/08/06 08:14 linux-4.14.y ca4f2c56d416 0487ea6f .config console log report syz C ci2-linux-4-14
2020/08/10 05:02 linux-4.14.y 14b58326976d 70301872 .config console log report syz ci2-linux-4-14
2020/08/09 05:25 linux-4.14.y 14b58326976d f721e4a0 .config console log report syz ci2-linux-4-14
2020/08/06 17:37 linux-4.14.y ca4f2c56d416 4ca1c0ea .config console log report syz ci2-linux-4-14
2020/08/06 14:38 linux-4.14.y ca4f2c56d416 4ca1c0ea .config console log report syz ci2-linux-4-14
2020/08/06 13:40 linux-4.14.y ca4f2c56d416 4ca1c0ea .config console log report syz ci2-linux-4-14
2020/08/04 08:45 linux-4.14.y 7f2c5eb458b8 96dd3623 .config console log report syz ci2-linux-4-14
2020/08/03 19:26 linux-4.14.y 7f2c5eb458b8 96dd3623 .config console log report syz ci2-linux-4-14
2020/08/03 13:37 linux-4.14.y 7f2c5eb458b8 96dd3623 .config console log report syz ci2-linux-4-14
2021/05/14 08:53 linux-4.14.y 7d7d1c0ab3eb 8bdd5343 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in hci_chan_del
2021/05/10 18:56 linux-4.14.y 7d7d1c0ab3eb ca873091 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in hci_chan_del
2021/04/19 13:06 linux-4.14.y cf256fbcbe34 50f523d7 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in hci_chan_del
2021/02/19 00:14 linux-4.14.y 2c8a3fceddf0 14052202 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in hci_chan_del
2021/01/03 16:34 linux-4.14.y 1752938529c6 79264ae3 .config console log report info ci2-linux-4-14
2020/12/02 07:18 linux-4.14.y 87335852c5d9 c42a35e9 .config console log report info ci2-linux-4-14
2020/11/17 03:40 linux-4.14.y 27ce4f2a6817 1bf9a662 .config console log report info ci2-linux-4-14
* Struck through repros no longer work on HEAD.