syzbot


KASAN: use-after-free Read in __queue_work

Status: upstream: reported syz repro on 2020/08/03 15:06
Reported-by: syzbot+d50829dd9012153a5ad2@syzkaller.appspotmail.com
First crash: 1333d, last: 569d
Fix bisection: failed (error log, bisect log)
  
Similar bugs (7)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-49 KASAN: use-after-free Read in __queue_work C 19 2049d 1811d 0/3 public: reported C repro on 2019/04/13 00:00
linux-4.19 KASAN: use-after-free Read in __queue_work syz done 5 961d 1333d 1/1 fixed on 2021/09/10 09:12
upstream KASAN: use-after-free Read in __queue_work net syz 2 2380d 2344d 0/26 closed as invalid on 2017/10/27 09:34
upstream KASAN: use-after-free Read in __queue_work (3) bluetooth syz done done 83 499d 1327d 0/26 upstream: reported syz repro on 2020/08/08 21:27
upstream KASAN: use-after-free Read in __queue_work (2) C done done 577 1735d 2089d 15/26 fixed on 2020/01/08 01:07
upstream general protection fault in __queue_work (2) C done 7043 714d 1482d 0/26 auto-obsoleted due to no activity on 2022/11/16 06:42
linux-4.19 general protection fault in __queue_work (2) 1 805d 805d 0/1 auto-closed as invalid on 2022/05/12 22:08
Fix bisection attempts (25)
Created Duration User Patch Repo Result
2022/10/29 04:44 8m bisect fix linux-4.14.y error job log (0)
2022/09/06 18:13 33m bisect fix linux-4.14.y job log (0) log
2022/08/07 16:49 30m bisect fix linux-4.14.y job log (0) log
2022/07/08 16:15 34m bisect fix linux-4.14.y job log (0) log
2022/06/08 15:46 28m bisect fix linux-4.14.y job log (0) log
2022/05/09 13:56 29m bisect fix linux-4.14.y job log (0) log
2022/04/09 01:43 28m bisect fix linux-4.14.y job log (0) log
2022/03/10 01:07 29m bisect fix linux-4.14.y job log (0) log
2022/02/07 18:01 39m bisect fix linux-4.14.y job log (0) log
2022/01/08 17:32 28m bisect fix linux-4.14.y job log (0) log
2021/12/09 16:41 29m bisect fix linux-4.14.y job log (0) log
2021/11/09 16:07 33m bisect fix linux-4.14.y job log (0) log
2021/10/10 15:32 35m bisect fix linux-4.14.y job log (0) log
2021/09/10 14:56 35m bisect fix linux-4.14.y job log (0) log
2021/08/11 14:25 30m bisect fix linux-4.14.y job log (0) log
2021/07/12 10:43 27m bisect fix linux-4.14.y job log (0) log
2021/06/12 10:09 33m bisect fix linux-4.14.y job log (0) log
2021/05/13 09:28 41m bisect fix linux-4.14.y job log (0) log
2021/04/12 10:00 35m bisect fix linux-4.14.y job log (0) log
2021/03/13 08:58 33m bisect fix linux-4.14.y job log (0) log
2021/01/24 19:22 33m bisect fix linux-4.14.y job log (0) log
2020/12/25 18:45 36m bisect fix linux-4.14.y job log (0) log
2020/11/25 18:09 36m bisect fix linux-4.14.y job log (0) log
2020/10/26 17:36 32m bisect fix linux-4.14.y job log (0) log
2020/09/26 16:59 37m bisect fix linux-4.14.y job log (0) log

Sample crash report:
Bluetooth: hci0 command 0x0c1a tx timeout
Bluetooth: hci0 command 0x0c1a tx timeout
Bluetooth: hci0 command 0x0c1a tx timeout
Bluetooth: hci0 command 0x0c1a tx timeout
==================================================================
BUG: KASAN: use-after-free in __queue_work+0xc2e/0xf70 kernel/workqueue.c:1385
Read of size 4 at addr ffff8880b3d28980 by task syz-executor.5/10730

CPU: 1 PID: 10730 Comm: syz-executor.5 Not tainted 4.14.230-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/0x281 lib/dump_stack.c:58
 print_address_description.cold+0x54/0x1d3 mm/kasan/report.c:252
 kasan_report_error.cold+0x8a/0x191 mm/kasan/report.c:351
 kasan_report mm/kasan/report.c:409 [inline]
 __asan_report_load4_noabort+0x68/0x70 mm/kasan/report.c:429
 __queue_work+0xc2e/0xf70 kernel/workqueue.c:1385
 queue_work_on+0x159/0x1d0 kernel/workqueue.c:1490
 queue_work include/linux/workqueue.h:491 [inline]
 req_run+0x2ca/0x4f0 net/bluetooth/hci_request.c:77
 hci_req_run_skb net/bluetooth/hci_request.c:89 [inline]
 __hci_req_sync+0x2b5/0x7e0 net/bluetooth/hci_request.c:214
 hci_req_sync+0x71/0xa0 net/bluetooth/hci_request.c:285
 hci_dev_cmd+0x451/0x710 net/bluetooth/hci_core.c:1890
 hci_sock_ioctl+0x344/0x690 net/bluetooth/hci_sock.c:1040
 sock_do_ioctl net/socket.c:974 [inline]
 sock_ioctl+0x2cc/0x4c0 net/socket.c:1071
 vfs_ioctl fs/ioctl.c:46 [inline]
 file_ioctl fs/ioctl.c:500 [inline]
 do_vfs_ioctl+0x75a/0xff0 fs/ioctl.c:684
 SYSC_ioctl fs/ioctl.c:701 [inline]
 SyS_ioctl+0x7f/0xb0 fs/ioctl.c:692
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x46/0xbb
RIP: 0033:0x466459
RSP: 002b:00007f8434343188 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 000000000056bf60 RCX: 0000000000466459
RDX: 0000000020000200 RSI: 00000000400448dd RDI: 0000000000000005
RBP: 00000000004bf9fb R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056bf60
R13: 00007ffce5d8b6df R14: 00007f8434343300 R15: 0000000000022000

Allocated by task 3547:
 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
 __do_kmalloc mm/slab.c:3720 [inline]
 __kmalloc+0x15a/0x400 mm/slab.c:3729
 kmalloc include/linux/slab.h:493 [inline]
 kzalloc include/linux/slab.h:661 [inline]
 __alloc_workqueue_key+0x10e/0x1080 kernel/workqueue.c:4003
 hci_register_dev+0x1af/0x8f0 net/bluetooth/hci_core.c:3101
 __vhci_create_device+0x28d/0x540 drivers/bluetooth/hci_vhci.c:139
 vhci_create_device drivers/bluetooth/hci_vhci.c:163 [inline]
 vhci_open_timeout+0x35/0x50 drivers/bluetooth/hci_vhci.c:319
 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 7:
 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
 __rcu_reclaim kernel/rcu/rcu.h:195 [inline]
 rcu_do_batch kernel/rcu/tree.c:2699 [inline]
 invoke_rcu_callbacks kernel/rcu/tree.c:2962 [inline]
 __rcu_process_callbacks kernel/rcu/tree.c:2929 [inline]
 rcu_process_callbacks+0x780/0x1180 kernel/rcu/tree.c:2946
 __do_softirq+0x24d/0x9ff kernel/softirq.c:288

The buggy address belongs to the object at ffff8880b3d28800
 which belongs to the cache kmalloc-512 of size 512
The buggy address is located 384 bytes inside of
 512-byte region [ffff8880b3d28800, ffff8880b3d28a00)
The buggy address belongs to the page:
page:ffffea0002cf4a00 count:1 mapcount:0 mapping:ffff8880b3d28080 index:0x0
flags: 0xfff00000000100(slab)
raw: 00fff00000000100 ffff8880b3d28080 0000000000000000 0000000100000006
raw: ffffea0002a98d20 ffffea0002a67320 ffff88813fe80940 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8880b3d28880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8880b3d28900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8880b3d28980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                   ^
 ffff8880b3d28a00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff8880b3d28a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2021/04/13 08:36 linux-4.14.y 958e517f4e16 6a81331a .config console log report syz ci2-linux-4-14 KASAN: use-after-free Read in __queue_work
2021/02/11 08:58 linux-4.14.y 2c8a3fceddf0 a52ee10a .config console log report syz ci2-linux-4-14 KASAN: use-after-free Read in __queue_work
2020/08/03 15:05 linux-4.14.y 7f2c5eb458b8 96dd3623 .config console log report syz ci2-linux-4-14
2020/08/27 16:47 linux-4.14.y d7e78d08fa77 816e0689 .config console log report ci2-linux-4-14
* Struck through repros no longer work on HEAD.