KASAN: use-after-free Read in mgmt_pending_remove (2)

Status: upstream: reported C repro on 2026/10/05 18:01
Reported-by: syzbot+7b37c1e835e520f0543b@syzkaller.appspotmail.com
First crash: 9d08h, last: 8d05h
▶ ▼ Similar bugs (7)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-5.15 KASAN: use-after-free Read in mgmt_pending_remove 19 1 631d 631d 0/3 auto-obsoleted due to no activity on 2025/05/01 22:08
upstream KASAN: use-after-free Read in mgmt_pending_remove bluetooth 19 syz, C unreliable 9 1499d 1519d 22/29 fixed on 2023/02/24 14:17
linux-6.1 KASAN: use-after-free Read in mgmt_pending_remove 19 1 348d 348d 0/3 auto-obsoleted due to no activity on 2026/02/08 16:52
linux-6.6 BUG: corrupted list in mgmt_pending_remove origin:lts-only 8 syz, C 98 7h21m 34d 0/2 upstream: reported C repro on 2026/09/10 17:17
upstream KASAN: slab-use-after-free Read in mgmt_pending_remove bluetooth 19 syz 2 336d 332d 29/29 fixed on 2026/01/07 12:29
linux-5.15 BUG: corrupted list in mgmt_pending_remove 8 1 198d 198d 0/3 auto-obsoleted due to no activity on 2026/07/08 05:18
upstream BUG: corrupted list in mgmt_pending_remove bluetooth 19 syz, C error 44 502d 773d 29/29 fixed on 2025/08/06 17:37

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in __list_del_entry_valid+0x2b/0x120 lib/list_debug.c:46
Read of size 8 at addr ffff88801f25b188 by task syz.0.19/4318

CPU: 1 PID: 4318 Comm: syz.0.19 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/16/2026
Call Trace:
 <TASK>
 dump_stack_lvl+0x188/0x250 lib/dump_stack.c:106
 print_address_description+0x60/0x2d0 mm/kasan/report.c:248
 __kasan_report mm/kasan/report.c:434 [inline]
 kasan_report+0xdf/0x130 mm/kasan/report.c:451
 __list_del_entry_valid+0x2b/0x120 lib/list_debug.c:46
 __list_del_entry include/linux/list.h:139 [inline]
 list_del include/linux/list.h:153 [inline]
 mgmt_pending_remove+0x24/0x1a0 net/bluetooth/mgmt_util.c:268
 mgmt_pending_foreach+0xc1/0x110 net/bluetooth/mgmt_util.c:226
 mgmt_index_removed+0x125/0x2a0 net/bluetooth/mgmt.c:8554
 hci_sock_bind+0xa77/0xe00 net/bluetooth/hci_sock.c:1257
 __sys_bind+0x2e9/0x3e0 net/socket.c:1730
 __do_sys_bind net/socket.c:1741 [inline]
 __se_sys_bind net/socket.c:1739 [inline]
 __x64_sys_bind+0x76/0x80 net/socket.c:1739
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7f72c96c2199
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 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 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffe7be6a848 EFLAGS: 00000246 ORIG_RAX: 0000000000000031
RAX: ffffffffffffffda RBX: 00007f72c9949fa0 RCX: 00007f72c96c2199
RDX: 0000000000000006 RSI: 0000200000000100 RDI: 0000000000000006
RBP: 00007f72c97598e0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f72c9949fac R14: 00007f72c9949fa0 R15: 00007f72c9949fa0
 </TASK>

Allocated by task 4318:
 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_kmalloc mm/kasan/common.c:513 [inline]
 __kasan_kmalloc+0xaf/0xe0 mm/kasan/common.c:522
 kmalloc include/linux/slab.h:607 [inline]
 kzalloc include/linux/slab.h:738 [inline]
 mgmt_pending_add+0x60/0x310 net/bluetooth/mgmt_util.c:236
 set_powered+0x315/0x830 net/bluetooth/mgmt.c:1230
 hci_mgmt_cmd+0x94d/0xd80 net/bluetooth/hci_sock.c:1663
 hci_sock_sendmsg+0x379/0xaa0 net/bluetooth/hci_sock.c:1798
 sock_sendmsg_nosec net/socket.c:706 [inline]
 __sock_sendmsg net/socket.c:718 [inline]
 sock_write_iter+0x2a6/0x3a0 net/socket.c:1090
 call_write_iter include/linux/fs.h:2179 [inline]
 new_sync_write fs/read_write.c:507 [inline]
 vfs_write+0x748/0xd70 fs/read_write.c:594
 ksys_write+0x153/0x260 fs/read_write.c:647
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0

Freed by task 146:
 kasan_save_stack mm/kasan/common.c:38 [inline]
 kasan_set_track+0x4b/0x70 mm/kasan/common.c:46
 kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:360
 ____kasan_slab_free+0xd5/0x110 mm/kasan/common.c:366
 kasan_slab_free include/linux/kasan.h:230 [inline]
 slab_free_hook mm/slub.c:1710 [inline]
 slab_free_freelist_hook+0xec/0x170 mm/slub.c:1736
 slab_free mm/slub.c:3504 [inline]
 kfree+0xef/0x2a0 mm/slub.c:4564
 hci_power_on+0x2b0/0x5f0 net/bluetooth/hci_core.c:2286
 process_one_work+0x867/0xff0 kernel/workqueue.c:2310
 worker_thread+0xad7/0x12a0 kernel/workqueue.c:2457
 kthread+0x42e/0x520 kernel/kthread.c:334
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287

The buggy address belongs to the object at ffff88801f25b180
 which belongs to the cache kmalloc-64 of size 64
The buggy address is located 8 bytes inside of
 64-byte region [ffff88801f25b180, ffff88801f25b1c0)
The buggy address belongs to the page:
page:ffffea00007c96c0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1f25b
flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000200 ffffea00008fe800 0000001200000008 ffff888016c41640
raw: 0000000000000000 0000000080200020 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 0x12c40(GFP_NOFS|__GFP_NOWARN|__GFP_NORETRY), pid 3964, ts 41119844539, free_ts 41115971256
 prep_new_page mm/page_alloc.c:2426 [inline]
 get_page_from_freelist+0x24f6/0x2670 mm/page_alloc.c:4192
 __alloc_pages+0x1ee/0x480 mm/page_alloc.c:5501
 alloc_slab_page mm/slub.c:1780 [inline]
 allocate_slab mm/slub.c:1917 [inline]
 new_slab+0xc0/0x4b0 mm/slub.c:1980
 ___slab_alloc+0x807/0xdd0 mm/slub.c:3013
 __slab_alloc mm/slub.c:3100 [inline]
 slab_alloc_node mm/slub.c:3191 [inline]
 slab_alloc mm/slub.c:3233 [inline]
 __kmalloc+0x11d/0x340 mm/slub.c:4408
 kmalloc include/linux/slab.h:612 [inline]
 kzalloc include/linux/slab.h:738 [inline]
 tomoyo_encode2 security/tomoyo/realpath.c:45 [inline]
 tomoyo_encode+0x28a/0x550 security/tomoyo/realpath.c:80
 tomoyo_realpath_from_path+0x5a2/0x5e0 security/tomoyo/realpath.c:288
 tomoyo_get_realpath security/tomoyo/file.c:151 [inline]
 tomoyo_path_perm+0x23f/0x5d0 security/tomoyo/file.c:822
 security_inode_getattr+0xcf/0x120 security/security.c:1398
 vfs_getattr+0x26/0x3a0 fs/stat.c:157
 vfs_fstat fs/stat.c:182 [inline]
 __do_sys_newfstat fs/stat.c:421 [inline]
 __se_sys_newfstat fs/stat.c:418 [inline]
 __x64_sys_newfstat+0x137/0x210 fs/stat.c:418
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1340 [inline]
 free_pcp_prepare mm/page_alloc.c:1391 [inline]
 free_unref_page_prepare+0x637/0x6c0 mm/page_alloc.c:3317
 free_unref_page_list+0x119/0x830 mm/page_alloc.c:3433
 release_pages+0x185f/0x1bd0 mm/swap.c:963
 tlb_batch_pages_flush mm/mmu_gather.c:50 [inline]
 tlb_flush_mmu_free mm/mmu_gather.c:241 [inline]
 tlb_flush_mmu mm/mmu_gather.c:248 [inline]
 tlb_finish_mmu+0x1b4/0x370 mm/mmu_gather.c:371
 exit_mmap+0x3d0/0x640 mm/mmap.c:3218
 __mmput+0x115/0x390 kernel/fork.c:1133
 exit_mm+0x632/0x7b0 kernel/exit.c:557
 do_exit+0x5b8/0x2110 kernel/exit.c:877
 do_group_exit+0x12c/0x2f0 kernel/exit.c:1004
 __do_sys_exit_group kernel/exit.c:1015 [inline]
 __se_sys_exit_group kernel/exit.c:1013 [inline]
 __x64_sys_exit_group+0x3b/0x40 kernel/exit.c:1013
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0

Memory state around the buggy address:
 ffff88801f25b080: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
 ffff88801f25b100: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
>ffff88801f25b180: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
                      ^
 ffff88801f25b200: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
 ffff88801f25b280: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
==================================================================

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/10/06 20:36 linux-5.15.y a051a4bf909f f7710056 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in mgmt_pending_remove
2026/10/06 17:11 linux-5.15.y a051a4bf909f f7710056 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in mgmt_pending_remove
2026/10/06 19:36 linux-5.15.y a051a4bf909f f7710056 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan BUG: corrupted list in mgmt_pending_remove
2026/10/05 18:01 linux-5.15.y a051a4bf909f af63e995 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in mgmt_pending_remove
* Struck through repros no longer work on HEAD.