syzbot


KASAN: use-after-free Read in skb_release_data

Status: upstream: reported syz repro on 2024/04/17 18:13
Bug presence: origin:lts-only
[Documentation on labels]
Reported-by: syzbot+4b49d6561fa01e744179@syzkaller.appspotmail.com
First crash: 173d, last: 82d
Bug presence (2)
Date Name Commit Repro Result
2024/07/14 linux-6.1.y (ToT) 266ee8e06d5b C [report] INFO: rcu detected stall in corrupted
2024/07/14 upstream (ToT) 4d145e3f830b C Didn't crash
Similar bugs (10)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-49 KASAN: use-after-free Read in skb_release_data 1 2343d 2343d 0/3 auto-closed as invalid on 2019/02/22 12:31
linux-4.14 KASAN: use-after-free Read in skb_release_data 1 1891d 1891d 0/1 auto-closed as invalid on 2019/12/02 22:53
upstream KASAN: use-after-free Read in skb_release_data syz 7 2610d 2610d 3/28 fixed on 2017/10/24 06:54
linux-5.15 KASAN: use-after-free Read in skb_release_data 1 549d 549d 0/3 auto-obsoleted due to no activity on 2023/08/06 13:46
linux-4.14 KASAN: use-after-free Read in skb_release_data (2) syz inconclusive 1 1679d 1679d 0/1 upstream: reported syz repro on 2020/03/03 17:50
upstream general protection fault in skb_release_data (2) net bluetooth C done error 683 78d 1490d 0/28 upstream: reported C repro on 2020/09/09 09:58
upstream KASAN: use-after-free Read in skb_release_data (2) bluetooth syz done done 1 1682d 1681d 0/28 auto-obsoleted due to no activity on 2022/09/13 15:46
upstream KMSAN: uninit-value in skb_release_data (3) net C 10 811d 1490d 0/28 auto-obsoleted due to no activity on 2022/11/17 07:20
upstream KASAN: use-after-free Write in skb_release_data (2) net C done unreliable 875 1125d 2185d 0/28 auto-obsoleted due to no activity on 2023/04/16 03:59
linux-4.19 KASAN: use-after-free Write in skb_release_data (2) 3 1255d 1331d 0/1 auto-closed as invalid on 2021/08/30 12:28
Fix bisection attempts (1)
Created Duration User Patch Repo Result
2024/07/21 10:29 7h33m fix candidate upstream OK (2) job log

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in skb_release_data+0x6a5/0x7a0 net/core/skbuff.c:802
Read of size 1 at addr ffff8880218af6be by task syz-executor/3657

CPU: 0 PID: 3657 Comm: syz-executor Not tainted 6.1.98-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
 print_address_description mm/kasan/report.c:284 [inline]
 print_report+0x15f/0x4f0 mm/kasan/report.c:395
 kasan_report+0x136/0x160 mm/kasan/report.c:495
 skb_release_data+0x6a5/0x7a0 net/core/skbuff.c:802
 skb_release_all net/core/skbuff.c:856 [inline]
 __kfree_skb net/core/skbuff.c:870 [inline]
 kfree_skb_reason+0x16f/0x390 net/core/skbuff.c:893
 kfree_skb include/linux/skbuff.h:1220 [inline]
 __hci_req_sync+0x626/0x940 net/bluetooth/hci_request.c:184
 hci_req_sync+0xa5/0xc0 net/bluetooth/hci_request.c:206
 hci_dev_cmd+0x2fc/0xa30 net/bluetooth/hci_core.c:790
 sock_do_ioctl+0x152/0x450 net/socket.c:1204
 sock_ioctl+0x47f/0x770 net/socket.c:1321
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:870 [inline]
 __se_sys_ioctl+0xf1/0x160 fs/ioctl.c:856
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7fe9ba5757db
Code: 00 48 89 44 24 18 31 c0 48 8d 44 24 60 c7 04 24 10 00 00 00 48 89 44 24 08 48 8d 44 24 20 48 89 44 24 10 b8 10 00 00 00 0f 05 <89> c2 3d 00 f0 ff ff 77 1c 48 8b 44 24 18 64 48 2b 04 25 28 00 00
RSP: 002b:00007ffe51dc51d0 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007fe9ba5757db
RDX: 00007ffe51dc5248 RSI: 00000000400448dd RDI: 0000000000000003
RBP: 00005555561a14a8 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000008 R11: 0000000000000246 R12: 0000000000000001
R13: 0000000000000001 R14: 0000000000000009 R15: 0000000000000009
 </TASK>

Allocated by task 3619:
 kasan_save_stack mm/kasan/common.c:45 [inline]
 kasan_set_track+0x4b/0x70 mm/kasan/common.c:52
 __kasan_slab_alloc+0x65/0x70 mm/kasan/common.c:328
 kasan_slab_alloc include/linux/kasan.h:201 [inline]
 slab_post_alloc_hook+0x52/0x3a0 mm/slab.h:737
 slab_alloc_node mm/slub.c:3398 [inline]
 slab_alloc mm/slub.c:3406 [inline]
 __kmem_cache_alloc_lru mm/slub.c:3413 [inline]
 kmem_cache_alloc+0x10c/0x2d0 mm/slub.c:3422
 skb_clone+0x1e5/0x360 net/core/skbuff.c:1660
 hci_send_cmd_sync net/bluetooth/hci_core.c:4178 [inline]
 hci_cmd_work+0x296/0x660 net/bluetooth/hci_core.c:4198
 process_one_work+0x8a9/0x11d0 kernel/workqueue.c:2292
 worker_thread+0xa47/0x1200 kernel/workqueue.c:2439
 kthread+0x28d/0x320 kernel/kthread.c:376
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308

Freed by task 3671:
 kasan_save_stack mm/kasan/common.c:45 [inline]
 kasan_set_track+0x4b/0x70 mm/kasan/common.c:52
 kasan_save_free_info+0x27/0x40 mm/kasan/generic.c:516
 ____kasan_slab_free+0xd6/0x120 mm/kasan/common.c:236
 kasan_slab_free include/linux/kasan.h:177 [inline]
 slab_free_hook mm/slub.c:1724 [inline]
 slab_free_freelist_hook mm/slub.c:1750 [inline]
 slab_free mm/slub.c:3661 [inline]
 kmem_cache_free+0x292/0x510 mm/slub.c:3683
 kfree_skb include/linux/skbuff.h:1220 [inline]
 hci_req_sync_complete+0xee/0x280 net/bluetooth/hci_request.c:109
 hci_event_packet+0xc49/0x1510 net/bluetooth/hci_event.c:7601
 hci_rx_work+0x3cd/0xce0 net/bluetooth/hci_core.c:4129
 process_one_work+0x8a9/0x11d0 kernel/workqueue.c:2292
 worker_thread+0xa47/0x1200 kernel/workqueue.c:2439
 kthread+0x28d/0x320 kernel/kthread.c:376
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308

The buggy address belongs to the object at ffff8880218af640
 which belongs to the cache skbuff_head_cache of size 240
The buggy address is located 126 bytes inside of
 240-byte region [ffff8880218af640, ffff8880218af730)

The buggy address belongs to the physical page:
page:ffffea0000862bc0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x218af
flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000200 0000000000000000 dead000000000122 ffff888141252500
raw: 0000000000000000 00000000800c000c 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 0x112cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY), pid 3663, tgid 3660 (syz-executor), ts 191166870741, free_ts 190550759675
 set_page_owner include/linux/page_owner.h:31 [inline]
 post_alloc_hook+0x18d/0x1b0 mm/page_alloc.c:2517
 prep_new_page mm/page_alloc.c:2524 [inline]
 get_page_from_freelist+0x322e/0x33b0 mm/page_alloc.c:4283
 __alloc_pages+0x28d/0x770 mm/page_alloc.c:5551
 alloc_slab_page+0x6a/0x150 mm/slub.c:1794
 allocate_slab mm/slub.c:1939 [inline]
 new_slab+0x84/0x2d0 mm/slub.c:1992
 ___slab_alloc+0xc20/0x1270 mm/slub.c:3180
 __slab_alloc mm/slub.c:3279 [inline]
 slab_alloc_node mm/slub.c:3364 [inline]
 kmem_cache_alloc_node+0x1cf/0x310 mm/slub.c:3443
 __alloc_skb+0xde/0x670 net/core/skbuff.c:505
 alloc_skb include/linux/skbuff.h:1271 [inline]
 bt_skb_alloc include/net/bluetooth/bluetooth.h:471 [inline]
 vhci_get_user drivers/bluetooth/hci_vhci.c:396 [inline]
 vhci_write+0xbc/0x440 drivers/bluetooth/hci_vhci.c:516
 do_iter_write+0x6e6/0xc40 fs/read_write.c:861
 vfs_writev fs/read_write.c:934 [inline]
 do_writev+0x27b/0x460 fs/read_write.c:977
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1444 [inline]
 free_pcp_prepare mm/page_alloc.c:1494 [inline]
 free_unref_page_prepare+0xf63/0x1120 mm/page_alloc.c:3362
 free_unref_page_list+0x663/0x900 mm/page_alloc.c:3503
 release_pages+0x2836/0x2b40 mm/swap.c:1055
 tlb_batch_pages_flush mm/mmu_gather.c:59 [inline]
 tlb_flush_mmu_free mm/mmu_gather.c:254 [inline]
 tlb_flush_mmu+0xfc/0x210 mm/mmu_gather.c:261
 tlb_finish_mmu+0xce/0x1f0 mm/mmu_gather.c:361
 exit_mmap+0x3c3/0x9f0 mm/mmap.c:3239
 __mmput+0x115/0x3c0 kernel/fork.c:1199
 exit_mm+0x226/0x300 kernel/exit.c:565
 do_exit+0x9f6/0x26a0 kernel/exit.c:858
 do_group_exit+0x202/0x2b0 kernel/exit.c:1021
 __do_sys_exit_group kernel/exit.c:1032 [inline]
 __se_sys_exit_group kernel/exit.c:1030 [inline]
 __x64_sys_exit_group+0x3b/0x40 kernel/exit.c:1030
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x68/0xd2

Memory state around the buggy address:
 ffff8880218af580: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc
 ffff8880218af600: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb
>ffff8880218af680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                        ^
 ffff8880218af700: fb fb fb fb fb fb fc fc fc fc fc fc fc fc fc fc
 ffff8880218af780: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================

Crashes (26):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/07/14 02:43 linux-6.1.y 266ee8e06d5b eaeb5c15 .config console log report syz / log [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in skb_release_data
2024/05/08 09:27 linux-6.1.y 909ba1f1b414 4cf3f9b3 .config console log report syz [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in skb_release_data
2024/07/17 21:40 linux-6.1.y cac15753b8ce 0f902625 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf KASAN: use-after-free Read in skb_release_data
2024/05/20 10:40 linux-6.1.y 4078fa637fcd c0f1611a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf KASAN: use-after-free Read in skb_release_data
2024/05/19 04:33 linux-6.1.y 4078fa637fcd c0f1611a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf KASAN: use-after-free Read in skb_release_data
2024/04/29 03:24 linux-6.1.y f2295faba5e8 07b455f9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in skb_release_data
2024/07/12 10:52 linux-6.1.y 266ee8e06d5b eaeb5c15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in skb_release_data
2024/07/05 06:39 linux-6.1.y 99e6a620de00 3f2748a3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in skb_release_data
2024/07/03 01:46 linux-6.1.y 99e6a620de00 07f0a0a0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in skb_release_data
2024/07/02 15:46 linux-6.1.y 99e6a620de00 07f0a0a0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in skb_release_data
2024/06/27 20:23 linux-6.1.y 99e6a620de00 6ef39602 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in skb_release_data
2024/06/25 18:12 linux-6.1.y eb44d83053d6 04bd2a30 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in skb_release_data
2024/06/25 15:52 linux-6.1.y eb44d83053d6 04bd2a30 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in skb_release_data
2024/06/21 18:53 linux-6.1.y eb44d83053d6 edc5149a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in skb_release_data
2024/06/12 12:32 linux-6.1.y ae9f2a70d69e f815599d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in skb_release_data
2024/06/03 12:40 linux-6.1.y 88690811da69 0aba2352 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in skb_release_data
2024/05/25 16:24 linux-6.1.y 88690811da69 a10a183e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in skb_release_data
2024/05/19 07:28 linux-6.1.y 4078fa637fcd c0f1611a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in skb_release_data
2024/05/18 04:45 linux-6.1.y 4078fa637fcd c0f1611a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in skb_release_data
2024/05/11 18:17 linux-6.1.y 909ba1f1b414 9026e142 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in skb_release_data
2024/05/07 01:56 linux-6.1.y 909ba1f1b414 fa7a5cf0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in skb_release_data
2024/05/06 22:51 linux-6.1.y 909ba1f1b414 fa7a5cf0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in skb_release_data
2024/05/03 02:46 linux-6.1.y 909ba1f1b414 ddfc15a1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in skb_release_data
2024/04/30 12:43 linux-6.1.y dcbc050cb0d3 3ce4924c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in skb_release_data
2024/04/24 12:41 linux-6.1.y 6741e066ec76 21339d7b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in skb_release_data
2024/04/17 18:13 linux-6.1.y 6741e066ec76 acc528cb .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in skb_release_data
* Struck through repros no longer work on HEAD.