================================================================== BUG: KASAN: slab-use-after-free in __list_del_entry_valid_or_report+0x2f/0x140 lib/list_debug.c:49 Read of size 8 at addr ffff88802f2b8788 by task syz.0.436/7460 CPU: 1 UID: 0 PID: 7460 Comm: syz.0.436 Not tainted 6.13.0-syzkaller-04046-g0ad9617c78ac #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 12/27/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0x169/0x550 mm/kasan/report.c:489 kasan_report+0x143/0x180 mm/kasan/report.c:602 __list_del_entry_valid_or_report+0x2f/0x140 lib/list_debug.c:49 __list_del_entry_valid include/linux/list.h:124 [inline] __list_del_entry include/linux/list.h:215 [inline] list_del include/linux/list.h:229 [inline] mgmt_pending_remove+0x26/0x1a0 net/bluetooth/mgmt_util.c:314 mgmt_pending_foreach+0xd1/0x130 net/bluetooth/mgmt_util.c:259 __mgmt_power_off+0x183/0x430 net/bluetooth/mgmt.c:9463 hci_dev_close_sync+0x6c4/0x11c0 net/bluetooth/hci_sync.c:5193 hci_dev_do_close net/bluetooth/hci_core.c:482 [inline] hci_dev_close+0x112/0x210 net/bluetooth/hci_core.c:507 sock_do_ioctl+0x158/0x460 net/socket.c:1194 sock_ioctl+0x626/0x8e0 net/socket.c:1313 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:906 [inline] __se_sys_ioctl+0xf5/0x170 fs/ioctl.c:892 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f96a218cda9 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f96a3061038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f96a23a6080 RCX: 00007f96a218cda9 RDX: 0000000000000000 RSI: 00000000400448ca RDI: 0000000000000006 RBP: 00007f96a220e2a0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f96a23a6080 R15: 00007fff10249198 Allocated by task 6663: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:377 [inline] __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:394 kasan_kmalloc include/linux/kasan.h:260 [inline] __kmalloc_cache_noprof+0x243/0x390 mm/slub.c:4329 kmalloc_noprof include/linux/slab.h:901 [inline] kzalloc_noprof include/linux/slab.h:1037 [inline] mgmt_pending_new+0x65/0x250 net/bluetooth/mgmt_util.c:269 mgmt_pending_add+0x36/0x120 net/bluetooth/mgmt_util.c:296 set_link_security+0x5da/0x820 net/bluetooth/mgmt.c:1903 hci_mgmt_cmd+0xc47/0x11d0 net/bluetooth/hci_sock.c:1712 hci_sock_sendmsg+0x7b8/0x11c0 net/bluetooth/hci_sock.c:1832 sock_sendmsg_nosec net/socket.c:713 [inline] __sock_sendmsg+0x221/0x270 net/socket.c:728 sock_write_iter+0x2d7/0x3f0 net/socket.c:1132 new_sync_write fs/read_write.c:586 [inline] vfs_write+0xaeb/0xd30 fs/read_write.c:679 ksys_write+0x18f/0x2b0 fs/read_write.c:731 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 7461: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:582 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x59/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2353 [inline] slab_free mm/slub.c:4613 [inline] kfree+0x196/0x430 mm/slub.c:4761 mgmt_pending_foreach+0xd1/0x130 net/bluetooth/mgmt_util.c:259 mgmt_index_removed+0x133/0x390 net/bluetooth/mgmt.c:9396 hci_sock_bind+0xcce/0x1150 net/bluetooth/hci_sock.c:1307 __sys_bind_socket net/socket.c:1812 [inline] __sys_bind+0x1e4/0x290 net/socket.c:1843 __do_sys_bind net/socket.c:1848 [inline] __se_sys_bind net/socket.c:1846 [inline] __x64_sys_bind+0x7a/0x90 net/socket.c:1846 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff88802f2b8780 which belongs to the cache kmalloc-96 of size 96 The buggy address is located 8 bytes inside of freed 96-byte region [ffff88802f2b8780, ffff88802f2b87e0) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88802f2b8a80 pfn:0x2f2b8 flags: 0xfff00000000200(workingset|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000200 ffff88801ac41280 ffffea0000a5acd0 ffffea000081ce10 raw: ffff88802f2b8a80 000000000020000d 00000001f5000000 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 0x52c40(GFP_NOFS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 5829, tgid 5829 (syz-executor), ts 66168604363, free_ts 65632516336 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1558 prep_new_page mm/page_alloc.c:1566 [inline] get_page_from_freelist+0x365c/0x37a0 mm/page_alloc.c:3476 __alloc_pages_noprof+0x292/0x710 mm/page_alloc.c:4753 alloc_pages_mpol_noprof+0x3e1/0x780 mm/mempolicy.c:2269 alloc_slab_page+0x6a/0x110 mm/slub.c:2423 allocate_slab+0x5a/0x2b0 mm/slub.c:2589 new_slab mm/slub.c:2642 [inline] ___slab_alloc+0xc27/0x14a0 mm/slub.c:3830 __slab_alloc+0x58/0xa0 mm/slub.c:3920 __slab_alloc_node mm/slub.c:3995 [inline] slab_alloc_node mm/slub.c:4156 [inline] __do_kmalloc_node mm/slub.c:4297 [inline] __kmalloc_noprof+0x2e6/0x4c0 mm/slub.c:4310 kmalloc_noprof include/linux/slab.h:905 [inline] kmalloc_array_noprof include/linux/slab.h:946 [inline] ext4_find_extent+0x22a/0xd50 fs/ext4/extents.c:916 ext4_ext_map_blocks+0x2e4/0x7d30 fs/ext4/extents.c:4205 ext4_map_query_blocks+0x97/0x2c0 fs/ext4/inode.c:468 ext4_map_blocks+0x3d0/0x1990 fs/ext4/inode.c:666 ext4_mpage_readpages+0xae4/0x1df0 fs/ext4/readpage.c:289 read_pages+0x176/0x750 mm/readahead.c:160 page_cache_ra_unbounded+0x606/0x720 mm/readahead.c:295 page last free pid 5196 tgid 5196 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_unref_page+0xd3f/0x1010 mm/page_alloc.c:2659 __slab_free+0x2c2/0x380 mm/slub.c:4524 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x9a/0x140 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x14f/0x170 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x23/0x80 mm/kasan/common.c:329 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4119 [inline] slab_alloc_node mm/slub.c:4168 [inline] kmem_cache_alloc_node_noprof+0x1d9/0x380 mm/slub.c:4220 __alloc_skb+0x1c3/0x440 net/core/skbuff.c:668 alloc_skb include/linux/skbuff.h:1331 [inline] alloc_skb_with_frags+0xc3/0x820 net/core/skbuff.c:6612 sock_alloc_send_pskb+0x91a/0xa60 net/core/sock.c:2897 unix_dgram_sendmsg+0x5f1/0x1df0 net/unix/af_unix.c:2017 sock_sendmsg_nosec net/socket.c:713 [inline] __sock_sendmsg+0x221/0x270 net/socket.c:728 __sys_sendto+0x363/0x4c0 net/socket.c:2182 __do_sys_sendto net/socket.c:2189 [inline] __se_sys_sendto net/socket.c:2185 [inline] __x64_sys_sendto+0xde/0x100 net/socket.c:2185 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff88802f2b8680: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ffff88802f2b8700: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc >ffff88802f2b8780: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ^ ffff88802f2b8800: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc ffff88802f2b8880: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc ==================================================================