================================================================== BUG: KASAN: use-after-free in __list_del_entry_valid+0xde/0x110 lib/list_debug.c:46 Read of size 8 at addr ffff888025f51388 by task syz-executor.5/7531 CPU: 0 PID: 7531 Comm: syz-executor.5 Not tainted 6.0.0-rc1-syzkaller-00162-ge82c649e851c #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/22/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:317 [inline] print_report.cold+0x2ba/0x719 mm/kasan/report.c:433 kasan_report+0xb1/0x1e0 mm/kasan/report.c:495 __list_del_entry_valid+0xde/0x110 lib/list_debug.c:46 __list_del_entry include/linux/list.h:134 [inline] list_del include/linux/list.h:148 [inline] mgmt_pending_remove+0x1a/0x160 net/bluetooth/mgmt_util.c:314 remove_adv_monitor+0x1b9/0x1c0 net/bluetooth/mgmt.c:5057 hci_mgmt_cmd net/bluetooth/hci_sock.c:1619 [inline] hci_sock_sendmsg+0x1dee/0x2490 net/bluetooth/hci_sock.c:1739 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:734 sock_write_iter+0x291/0x3d0 net/socket.c:1108 call_write_iter include/linux/fs.h:2187 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x9e9/0xdd0 fs/read_write.c:578 ksys_write+0x1e8/0x250 fs/read_write.c:631 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f1f8be89279 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f1f8d0d6168 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f1f8bf9bf80 RCX: 00007f1f8be89279 RDX: 0000000000000008 RSI: 00000000200000c0 RDI: 0000000000000005 RBP: 00007f1f8d0d61d0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 R13: 00007ffcd3e5fb6f R14: 00007f1f8d0d6300 R15: 0000000000022000 Allocated by task 7531: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:437 [inline] ____kasan_kmalloc mm/kasan/common.c:516 [inline] ____kasan_kmalloc mm/kasan/common.c:475 [inline] __kasan_kmalloc+0xa9/0xd0 mm/kasan/common.c:525 kmalloc include/linux/slab.h:600 [inline] kzalloc include/linux/slab.h:733 [inline] mgmt_pending_new+0x57/0x290 net/bluetooth/mgmt_util.c:269 mgmt_pending_add+0x34/0x160 net/bluetooth/mgmt_util.c:296 remove_adv_monitor+0x120/0x1c0 net/bluetooth/mgmt.c:5040 hci_mgmt_cmd net/bluetooth/hci_sock.c:1619 [inline] hci_sock_sendmsg+0x1dee/0x2490 net/bluetooth/hci_sock.c:1739 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:734 sock_write_iter+0x291/0x3d0 net/socket.c:1108 call_write_iter include/linux/fs.h:2187 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x9e9/0xdd0 fs/read_write.c:578 ksys_write+0x1e8/0x250 fs/read_write.c:631 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 7531: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track+0x21/0x30 mm/kasan/common.c:45 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:370 ____kasan_slab_free mm/kasan/common.c:367 [inline] ____kasan_slab_free+0x166/0x1c0 mm/kasan/common.c:329 kasan_slab_free include/linux/kasan.h:200 [inline] slab_free_hook mm/slub.c:1754 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1780 slab_free mm/slub.c:3534 [inline] kfree+0xe2/0x580 mm/slub.c:4562 remove_adv_monitor+0x18b/0x1c0 net/bluetooth/mgmt.c:5050 hci_mgmt_cmd net/bluetooth/hci_sock.c:1619 [inline] hci_sock_sendmsg+0x1dee/0x2490 net/bluetooth/hci_sock.c:1739 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:734 sock_write_iter+0x291/0x3d0 net/socket.c:1108 call_write_iter include/linux/fs.h:2187 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x9e9/0xdd0 fs/read_write.c:578 ksys_write+0x1e8/0x250 fs/read_write.c:631 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff888025f51380 which belongs to the cache kmalloc-96 of size 96 The buggy address is located 8 bytes inside of 96-byte region [ffff888025f51380, ffff888025f513e0) The buggy address belongs to the physical page: page:ffffea000097d440 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x25f51 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea0001d11c00 dead000000000002 ffff888011841780 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 2971, tgid 2971 (udevd), ts 14517197363, free_ts 13129943472 prep_new_page mm/page_alloc.c:2532 [inline] get_page_from_freelist+0x109b/0x2ce0 mm/page_alloc.c:4283 __alloc_pages+0x1c7/0x510 mm/page_alloc.c:5515 alloc_pages+0x1a6/0x270 mm/mempolicy.c:2270 alloc_slab_page mm/slub.c:1824 [inline] allocate_slab+0x27e/0x3d0 mm/slub.c:1969 new_slab mm/slub.c:2029 [inline] ___slab_alloc+0x7f1/0xe10 mm/slub.c:3031 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3118 slab_alloc_node mm/slub.c:3209 [inline] slab_alloc mm/slub.c:3251 [inline] __kmalloc+0x32b/0x340 mm/slub.c:4420 kmalloc_array include/linux/slab.h:640 [inline] kcalloc include/linux/slab.h:671 [inline] ext4_find_extent+0xa38/0xd10 fs/ext4/extents.c:905 ext4_ext_map_blocks+0x1dd/0x5f50 fs/ext4/extents.c:4097 ext4_map_blocks+0xa7b/0x18d0 fs/ext4/inode.c:570 ext4_mpage_readpages+0xe89/0x2700 fs/ext4/readpage.c:303 ext4_readahead+0x102/0x140 fs/ext4/inode.c:3236 read_pages+0x19e/0xfc0 mm/readahead.c:158 page_cache_ra_unbounded+0x3f5/0x550 mm/readahead.c:263 do_page_cache_ra mm/readahead.c:293 [inline] page_cache_ra_order+0x69a/0x970 mm/readahead.c:550 ondemand_readahead+0x6fc/0x1160 mm/readahead.c:672 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1449 [inline] free_pcp_prepare+0x5e4/0xd20 mm/page_alloc.c:1499 free_unref_page_prepare mm/page_alloc.c:3380 [inline] free_unref_page+0x19/0x4d0 mm/page_alloc.c:3476 kasan_depopulate_vmalloc_pte+0x5c/0x70 mm/kasan/shadow.c:372 apply_to_pte_range mm/memory.c:2633 [inline] apply_to_pmd_range mm/memory.c:2677 [inline] apply_to_pud_range mm/memory.c:2713 [inline] apply_to_p4d_range mm/memory.c:2749 [inline] __apply_to_page_range+0x686/0x1030 mm/memory.c:2783 kasan_release_vmalloc+0xa7/0xc0 mm/kasan/shadow.c:486 __purge_vmap_area_lazy+0x885/0x1c50 mm/vmalloc.c:1753 _vm_unmap_aliases.part.0+0x425/0x560 mm/vmalloc.c:2156 _vm_unmap_aliases mm/vmalloc.c:2130 [inline] vm_unmap_aliases+0x45/0x50 mm/vmalloc.c:2179 change_page_attr_set_clr+0x241/0x500 arch/x86/mm/pat/set_memory.c:1732 change_page_attr_set arch/x86/mm/pat/set_memory.c:1782 [inline] set_memory_nx+0xb2/0x110 arch/x86/mm/pat/set_memory.c:1975 free_init_pages+0x73/0xc0 arch/x86/mm/init.c:908 kernel_init+0x2e/0x1d0 init/main.c:1509 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 Memory state around the buggy address: ffff888025f51280: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc ffff888025f51300: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc >ffff888025f51380: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ^ ffff888025f51400: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc ffff888025f51480: 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc ==================================================================