syzbot


KASAN: use-after-free Read in skb_dequeue

Status: fixed on 2021/03/29 19:17
Reported-by: syzbot+f086977f0ce58311420d@syzkaller.appspotmail.com
Fix commit: c1a77dbcaa2d btrfs: raid56: simplify tracking of Q stripe presence
First crash: 1570d, last: 1365d
Fix bisection: fixed by (bisect log) :
commit c1a77dbcaa2d7f45fc9cb9f0c525e1c11957bf2a
Author: David Sterba <dsterba@suse.com>
Date: Wed Feb 19 14:17:20 2020 +0000

  btrfs: raid56: simplify tracking of Q stripe presence

  
Similar bugs (6)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-54 KASAN: use-after-free Read in skb_dequeue syz 1 1192d 1192d 0/2 auto-obsoleted due to no activity on 2023/04/23 02:47
android-49 KASAN: use-after-free Read in skb_dequeue (2) 8 2303d 2469d 0/3 auto-closed as invalid on 2019/02/22 12:37
upstream general protection fault in skb_dequeue (2) bluetooth C inconclusive done 9 1138d 1222d 0/28 auto-closed as invalid on 2022/10/03 17:36
upstream KASAN: use-after-free Read in skb_dequeue net C 4 2345d 2345d 8/28 fixed on 2018/07/09 18:05
android-44 KASAN: use-after-free Read in skb_dequeue 1 2275d 2275d 0/2 auto-closed as invalid on 2019/02/25 16:09
linux-4.19 KASAN: use-after-free Read in skb_dequeue (2) C done 2 1163d 1193d 1/1 fixed on 2021/10/15 14:38
Fix bisection attempts (8)
Created Duration User Patch Repo Result
2021/03/26 15:03 3h59m bisect fix linux-4.19.y OK (1) job log
2021/02/24 14:27 35m bisect fix linux-4.19.y OK (0) job log log
2021/01/31 13:51 1m bisect fix linux-4.19.y error job log
2021/01/01 13:17 34m bisect fix linux-4.19.y OK (0) job log log
2020/12/02 12:32 44m bisect fix linux-4.19.y OK (0) job log log
2020/11/02 11:05 37m bisect fix linux-4.19.y OK (0) job log log
2020/10/03 10:27 37m bisect fix linux-4.19.y OK (0) job log log
2020/09/03 04:52 41m bisect fix linux-4.19.y OK (0) job log log

Sample crash report:
IPv6: ADDRCONF(NETDEV_CHANGE): batadv_slave_1: link becomes ready
IPv6: ADDRCONF(NETDEV_CHANGE): veth1_to_batadv: link becomes ready
Bluetooth: hci1: command 0x0409 tx timeout
==================================================================
BUG: KASAN: use-after-free in __lock_acquire+0x2cb4/0x3ff0 kernel/locking/lockdep.c:3294
Read of size 8 at addr ffff8880940ab640 by task syz-executor.3/11210

CPU: 0 PID: 11210 Comm: syz-executor.3 Not tainted 4.19.136-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+0x1fc/0x2fe lib/dump_stack.c:118
 print_address_description.cold+0x54/0x219 mm/kasan/report.c:256
 kasan_report_error.cold+0x8a/0x1c7 mm/kasan/report.c:354
 kasan_report mm/kasan/report.c:412 [inline]
 __asan_report_load8_noabort+0x88/0x90 mm/kasan/report.c:433
 __lock_acquire+0x2cb4/0x3ff0 kernel/locking/lockdep.c:3294
 lock_acquire+0x170/0x3c0 kernel/locking/lockdep.c:3907
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
 _raw_spin_lock_irqsave+0x8c/0xc0 kernel/locking/spinlock.c:152
 skb_dequeue+0x1c/0x170 net/core/skbuff.c:2819
 skb_queue_purge+0x21/0x30 net/core/skbuff.c:2857
 vhci_flush+0x37/0x50 drivers/bluetooth/hci_vhci.c:292
 hci_dev_do_reset net/bluetooth/hci_core.c:1772 [inline]
 hci_dev_reset+0x240/0x400 net/bluetooth/hci_core.c:1807
 hci_sock_ioctl+0x4d8/0x7a0 net/bluetooth/hci_sock.c:1028
 sock_do_ioctl+0xcb/0x2d0 net/socket.c:950
 sock_ioctl+0x2ef/0x5d0 net/socket.c:1074
 vfs_ioctl fs/ioctl.c:46 [inline]
 file_ioctl fs/ioctl.c:501 [inline]
 do_vfs_ioctl+0xcdb/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:0x45cc79
Code: 2d 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 fb b5 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007fe940f51c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 000000000001d300 RCX: 000000000045cc79
RDX: 0000000000000000 RSI: 00000000400448cb RDI: 0000000000000004
RBP: 000000000078bf40 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000078bf0c
R13: 00007ffeac8b2b2f R14: 00007fe940f529c0 R15: 000000000078bf0c

Allocated by task 6491:
 kmem_cache_alloc_trace+0x12f/0x380 mm/slab.c:3625
 kmalloc include/linux/slab.h:515 [inline]
 kzalloc include/linux/slab.h:709 [inline]
 vhci_open+0x48/0x310 drivers/bluetooth/hci_vhci.c:326
 misc_open+0x372/0x4a0 drivers/char/misc.c:141
 chrdev_open+0x266/0x770 fs/char_dev.c:423
 do_dentry_open+0x4aa/0x1160 fs/open.c:796
 do_last fs/namei.c:3421 [inline]
 path_openat+0x793/0x2df0 fs/namei.c:3537
 do_filp_open+0x18c/0x3f0 fs/namei.c:3567
 do_sys_open+0x3b3/0x520 fs/open.c:1085
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 6491:
 __cache_free mm/slab.c:3503 [inline]
 kfree+0xcc/0x210 mm/slab.c:3822
 vhci_release+0xb0/0xe0 drivers/bluetooth/hci_vhci.c:360
 __fput+0x2ce/0x890 fs/file_table.c:278
 task_work_run+0x148/0x1c0 kernel/task_work.c:113
 exit_task_work include/linux/task_work.h:22 [inline]
 do_exit+0xbb2/0x2b70 kernel/exit.c:887
 do_group_exit+0x125/0x310 kernel/exit.c:990
 __do_sys_exit_group kernel/exit.c:1001 [inline]
 __se_sys_exit_group kernel/exit.c:999 [inline]
 __x64_sys_exit_group+0x3a/0x50 kernel/exit.c:999
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

The buggy address belongs to the object at ffff8880940ab5c0
 which belongs to the cache kmalloc-512 of size 512
The buggy address is located 128 bytes inside of
 512-byte region [ffff8880940ab5c0, ffff8880940ab7c0)
The buggy address belongs to the page:
page:ffffea0002502ac0 count:1 mapcount:0 mapping:ffff88812c39c940 index:0x0
flags: 0xfffe0000000100(slab)
raw: 00fffe0000000100 ffffea00025194c8 ffffea00025169c8 ffff88812c39c940
raw: 0000000000000000 ffff8880940ab0c0 0000000100000006 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8880940ab500: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
 ffff8880940ab580: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb
>ffff8880940ab600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                           ^
 ffff8880940ab680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8880940ab700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/08/04 04:52 linux-4.19.y 13af6c74b14a 96dd3623 .config console log report syz ci2-linux-4-19
* Struck through repros no longer work on HEAD.