syzbot


general protection fault in skb_dequeue (2)

Status: auto-closed as invalid on 2022/10/03 17:36
Subsystems: bluetooth
[Documentation on labels]
First crash: 1090d, last: 1006d
Cause bisection: the issue happens on the oldest tested release (bisect log)
Crash: BUG: unable to handle kernel paging request in h4_recv_buf (log)
Repro: C syz .config
  
Fix bisection: fixed by (bisect log) :
commit 0766ec82e5fb26fc5dc6d592bc61865608bdc651
Author: Stephen Brennan <stephen.s.brennan@oracle.com>
Date: Wed Sep 1 17:51:41 2021 +0000

  namei: Fix use after free in kern_path_locked

  
Similar bugs (8)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream general protection fault in skb_dequeue (3) wireless C done 6 517d 527d 22/27 fixed on 2023/06/08 14:41
upstream general protection fault in skb_dequeue net 1 1453d 1453d 0/27 auto-closed as invalid on 2020/09/18 07:31
android-54 KASAN: use-after-free Read in skb_dequeue syz 1 1060d 1060d 0/2 auto-obsoleted due to no activity on 2023/04/23 02:47
linux-4.19 KASAN: use-after-free Read in skb_dequeue (2) C done 2 1031d 1061d 1/1 fixed on 2021/10/15 14:38
android-49 KASAN: use-after-free Read in skb_dequeue (2) 8 2171d 2337d 0/3 auto-closed as invalid on 2019/02/22 12:37
upstream KASAN: use-after-free Read in skb_dequeue net C 4 2213d 2213d 8/27 fixed on 2018/07/09 18:05
linux-4.19 KASAN: use-after-free Read in skb_dequeue syz done 1 1234d 1438d 1/1 fixed on 2021/03/29 19:17
android-44 KASAN: use-after-free Read in skb_dequeue 1 2143d 2143d 0/2 auto-closed as invalid on 2019/02/25 16:09
Last patch testing requests (2)
Created Duration User Patch Repo Result
2022/10/03 16:30 19m retest repro upstream OK log
2022/10/02 09:30 15m retest repro upstream OK log

Sample crash report:
Bluetooth: hci1: sending frame failed (-49)
Bluetooth: hci1: sending frame failed (-49)
Bluetooth: hci1: Received unexpected HCI Event 00000000
==================================================================
BUG: KASAN: use-after-free in __skb_unlink include/linux/skbuff.h:2090 [inline]
BUG: KASAN: use-after-free in __skb_dequeue include/linux/skbuff.h:2109 [inline]
BUG: KASAN: use-after-free in skb_dequeue+0x90/0x140 net/core/skbuff.c:3159
Read of size 8 at addr ffff888025f8c3c0 by task kworker/u5:0/2026

CPU: 1 PID: 2026 Comm: kworker/u5:0 Not tainted 5.14.0-rc6-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: hci1 hci_rx_work
Call Trace:
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1ae/0x29f lib/dump_stack.c:105
 print_address_description+0x66/0x3b0 mm/kasan/report.c:233
 __kasan_report mm/kasan/report.c:419 [inline]
 kasan_report+0x163/0x210 mm/kasan/report.c:436
 __skb_unlink include/linux/skbuff.h:2090 [inline]
 __skb_dequeue include/linux/skbuff.h:2109 [inline]
 skb_dequeue+0x90/0x140 net/core/skbuff.c:3159
 hci_rx_work+0x2e0/0x410 net/bluetooth/hci_core.c:5084
 process_one_work+0x833/0x10c0 kernel/workqueue.c:2276
 worker_thread+0xac1/0x1320 kernel/workqueue.c:2422
 kthread+0x453/0x480 kernel/kthread.c:319
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295

Allocated by task 8513:
 kasan_save_stack mm/kasan/common.c:38 [inline]
 kasan_set_track mm/kasan/common.c:46 [inline]
 set_alloc_info mm/kasan/common.c:434 [inline]
 __kasan_slab_alloc+0x96/0xd0 mm/kasan/common.c:467
 kasan_slab_alloc include/linux/kasan.h:254 [inline]
 slab_post_alloc_hook mm/slab.h:519 [inline]
 slab_alloc_node mm/slub.c:2959 [inline]
 kmem_cache_alloc_node+0x200/0x370 mm/slub.c:2995
 __alloc_skb+0xd8/0x580 net/core/skbuff.c:414
 alloc_skb include/linux/skbuff.h:1112 [inline]
 bt_skb_alloc include/net/bluetooth/bluetooth.h:389 [inline]
 h4_recv_buf+0x274/0xd50 drivers/bluetooth/hci_h4.c:181
 h4_recv+0xf4/0x1b0 drivers/bluetooth/hci_h4.c:115
 hci_uart_tty_receive+0x1d2/0x4a0 drivers/bluetooth/hci_ldisc.c:613
 tiocsti drivers/tty/tty_io.c:2311 [inline]
 tty_ioctl+0xde5/0x1720 drivers/tty/tty_io.c:2719
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:1069 [inline]
 __se_sys_ioctl+0xfb/0x170 fs/ioctl.c:1055
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae

Freed by task 2026:
 kasan_save_stack mm/kasan/common.c:38 [inline]
 kasan_set_track+0x3d/0x70 mm/kasan/common.c:46
 kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:360
 ____kasan_slab_free+0x109/0x150 mm/kasan/common.c:366
 kasan_slab_free include/linux/kasan.h:230 [inline]
 slab_free_hook mm/slub.c:1628 [inline]
 slab_free_freelist_hook+0x1d8/0x290 mm/slub.c:1653
 slab_free mm/slub.c:3213 [inline]
 kmem_cache_free+0x85/0x170 mm/slub.c:3229
 hci_event_packet+0x1238/0x1bd0 net/bluetooth/hci_event.c:6400
 hci_rx_work+0x229/0x410 net/bluetooth/hci_core.c:5120
 process_one_work+0x833/0x10c0 kernel/workqueue.c:2276
 worker_thread+0xac1/0x1320 kernel/workqueue.c:2422
 kthread+0x453/0x480 kernel/kthread.c:319
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295

The buggy address belongs to the object at ffff888025f8c3c0
 which belongs to the cache skbuff_head_cache of size 232
The buggy address is located 0 bytes inside of
 232-byte region [ffff888025f8c3c0, ffff888025f8c4a8)
The buggy address belongs to the page:
page:ffffea000097e300 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888025f8cc80 pfn:0x25f8c
flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000200 ffffea0000aa2380 0000000400000004 ffff8880122e9b40
raw: ffff888025f8cc80 00000000800c0008 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Unmovable, gfp_mask 0x12cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY), pid 1, ts 16939168005, free_ts 16936927313
 prep_new_page mm/page_alloc.c:2436 [inline]
 get_page_from_freelist+0x779/0xa30 mm/page_alloc.c:4169
 __alloc_pages+0x26c/0x5f0 mm/page_alloc.c:5391
 alloc_slab_page mm/slub.c:1691 [inline]
 allocate_slab+0xf1/0x540 mm/slub.c:1831
 ___slab

Crashes (9):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2021/08/16 04:58 upstream 7c60610d4767 2489ab88 .config console log report syz C ci-upstream-kasan-gce-smack-root KASAN: use-after-free Read in skb_dequeue
2021/10/10 11:49 upstream 7fd2bf83d59a 838e7e2c .config console log report syz ci-upstream-kasan-gce-root KASAN: use-after-free Read in skb_dequeue
2021/07/17 21:25 linux-next c1a6d08348fc f115ae98 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in skb_dequeue
2021/08/18 11:13 upstream 614cb2751d31 a2fe1cb5 .config console log report info ci-upstream-kasan-gce-smack-root KASAN: use-after-free Read in skb_dequeue
2021/08/17 15:23 upstream 794c7931a242 a2fe1cb5 .config console log report info ci-upstream-kasan-gce-smack-root KASAN: use-after-free Read in skb_dequeue
2021/08/16 22:23 upstream a2824f19e606 33c26cb7 .config console log report info ci-upstream-kasan-gce-selinux-root KASAN: use-after-free Read in skb_dequeue
2021/08/16 21:28 upstream a2824f19e606 33c26cb7 .config console log report info ci-upstream-kasan-gce-selinux-root KASAN: use-after-free Read in skb_dequeue
2021/08/16 14:19 upstream 7c60610d4767 33c26cb7 .config console log report info ci-upstream-kasan-gce-smack-root KASAN: use-after-free Read in skb_dequeue
2021/08/16 12:51 upstream 7c60610d4767 33c26cb7 .config console log report info ci-upstream-kasan-gce-smack-root KASAN: use-after-free Read in skb_dequeue
* Struck through repros no longer work on HEAD.