================================================================== BUG: KASAN: slab-use-after-free in mgmt_remove_adv_monitor_sync+0x40/0xe4 net/bluetooth/mgmt.c:5445 Read of size 8 at addr ffff0000dcad4018 by task kworker/u9:4/6284 CPU: 0 PID: 6284 Comm: kworker/u9:4 Tainted: G W 6.10.0-rc2-syzkaller-g8867bbd4a056 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024 Workqueue: hci0 hci_cmd_sync_work Call trace: dump_backtrace+0x1b8/0x1e4 arch/arm64/kernel/stacktrace.c:317 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:324 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xe4/0x150 lib/dump_stack.c:114 print_address_description mm/kasan/report.c:377 [inline] print_report+0x198/0x538 mm/kasan/report.c:488 kasan_report+0xd8/0x138 mm/kasan/report.c:601 __asan_report_load8_noabort+0x20/0x2c mm/kasan/report_generic.c:381 mgmt_remove_adv_monitor_sync+0x40/0xe4 net/bluetooth/mgmt.c:5445 hci_cmd_sync_work+0x1cc/0x34c net/bluetooth/hci_sync.c:310 process_one_work+0x7b0/0x15e8 kernel/workqueue.c:3231 process_scheduled_works kernel/workqueue.c:3312 [inline] worker_thread+0x938/0xef4 kernel/workqueue.c:3393 kthread+0x288/0x310 kernel/kthread.c:389 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:860 Allocated by task 6440: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x40/0x78 mm/kasan/common.c:68 kasan_save_alloc_info+0x40/0x50 mm/kasan/generic.c:565 poison_kmalloc_redzone mm/kasan/common.c:370 [inline] __kasan_kmalloc+0xac/0xc4 mm/kasan/common.c:387 kasan_kmalloc include/linux/kasan.h:211 [inline] kmalloc_trace_noprof+0x244/0x374 mm/slub.c:4152 kmalloc_noprof include/linux/slab.h:660 [inline] kzalloc_noprof include/linux/slab.h:778 [inline] mgmt_pending_new+0x70/0x248 net/bluetooth/mgmt_util.c:269 mgmt_pending_add+0x48/0x124 net/bluetooth/mgmt_util.c:296 remove_adv_monitor+0x110/0x1b0 net/bluetooth/mgmt.c:5470 hci_mgmt_cmd+0x97c/0xe60 net/bluetooth/hci_sock.c:1712 hci_sock_sendmsg+0x58c/0xd08 net/bluetooth/hci_sock.c:1832 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg net/socket.c:745 [inline] sock_write_iter+0x2d8/0x448 net/socket.c:1160 new_sync_write fs/read_write.c:497 [inline] vfs_write+0x828/0xc78 fs/read_write.c:590 ksys_write+0x15c/0x26c fs/read_write.c:643 __do_sys_write fs/read_write.c:655 [inline] __se_sys_write fs/read_write.c:652 [inline] __arm64_sys_write+0x7c/0x90 fs/read_write.c:652 __invoke_syscall arch/arm64/kernel/syscall.c:34 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:48 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:133 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:152 el0_svc+0x54/0x168 arch/arm64/kernel/entry-common.c:712 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:730 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:598 Freed by task 6413: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x40/0x78 mm/kasan/common.c:68 kasan_save_free_info+0x54/0x6c mm/kasan/generic.c:579 poison_slab_object+0x128/0x180 mm/kasan/common.c:240 __kasan_slab_free+0x3c/0x70 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2195 [inline] slab_free mm/slub.c:4436 [inline] kfree+0x15c/0x3f4 mm/slub.c:4557 mgmt_pending_free+0xc8/0x118 net/bluetooth/mgmt_util.c:309 mgmt_pending_remove+0xec/0x104 net/bluetooth/mgmt_util.c:315 cmd_complete_rsp+0xcc/0x17c mgmt_pending_foreach+0xd4/0x148 net/bluetooth/mgmt_util.c:259 __mgmt_power_off+0x174/0x3dc net/bluetooth/mgmt.c:9413 hci_dev_close_sync+0x444/0xec0 net/bluetooth/hci_sync.c:5058 hci_dev_do_close+0x38/0x9c net/bluetooth/hci_core.c:556 hci_rfkill_set_block+0x1c4/0x2a8 net/bluetooth/hci_core.c:982 rfkill_set_block+0x18c/0x37c net/rfkill/core.c:346 rfkill_fop_write+0x578/0x734 net/rfkill/core.c:1305 vfs_write+0x3c8/0xc78 fs/read_write.c:588 ksys_write+0x15c/0x26c fs/read_write.c:643 __do_sys_write fs/read_write.c:655 [inline] __se_sys_write fs/read_write.c:652 [inline] __arm64_sys_write+0x7c/0x90 fs/read_write.c:652 __invoke_syscall arch/arm64/kernel/syscall.c:34 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:48 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:133 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:152 el0_svc+0x54/0x168 arch/arm64/kernel/entry-common.c:712 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:730 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:598 The buggy address belongs to the object at ffff0000dcad4000 which belongs to the cache kmalloc-96 of size 96 The buggy address is located 24 bytes inside of freed 96-byte region [ffff0000dcad4000, ffff0000dcad4060) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11cad4 flags: 0x5ffc00000000000(node=0|zone=2|lastcpupid=0x7ff) page_type: 0xffffefff(slab) raw: 05ffc00000000000 ffff0000c0001280 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000200020 00000001ffffefff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000dcad3f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff0000dcad3f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff0000dcad4000: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ^ ffff0000dcad4080: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc ffff0000dcad4100: 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc ================================================================== Unable to handle kernel paging request at virtual address e0d3007ec0000321 KASAN: maybe wild-memory-access in range [0x069c03f600001908-0x069c03f60000190f] Mem abort info: ESR = 0x0000000096000004 EC = 0x25: DABT (current EL), IL = 32 bits SET = 0, FnV = 0 EA = 0, S1PTW = 0 FSC = 0x04: level 0 translation fault Data abort info: ISV = 0, ISS = 0x00000004, ISS2 = 0x00000000 CM = 0, WnR = 0, TnD = 0, TagAccess = 0 GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0 [e0d3007ec0000321] address between user and kernel address ranges Internal error: Oops: 0000000096000004 [#1] PREEMPT SMP Modules linked in: CPU: 0 PID: 6284 Comm: kworker/u9:4 Tainted: G B W 6.10.0-rc2-syzkaller-g8867bbd4a056 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024 Workqueue: hci0 hci_cmd_sync_work pstate: 00400005 (nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : __list_del_entry_valid_or_report+0x78/0x158 lib/list_debug.c:62 lr : __list_del_entry_valid_or_report+0x4c/0x158 lib/list_debug.c:50 sp : ffff800099297950 x29: ffff800099297950 x28: 1ffff00013252f3c x27: dfff800000000000 x26: 0000000000000053 x25: 0000000000000000 x24: ffff0000d5498000 x23: ffff0000d8e8c010 x22: dfff800000000000 x21: 069c03f60000190d x20: ffff0000d46a1800 x19: ffff0000dcad4000 x18: ffff0001fea889d0 x17: ffff80008a126e24 x16: ffff80008055b06c x15: 0000000000000001 x14: 1ffff00011f1619e x13: 0000000000000000 x12: 0000000000000000 x11: ffff80009928ffff x10: 0000000000ff0100 x9 : ffff8000938e6f80 x8 : 00d3807ec0000321 x7 : ffff800080a65938 x6 : ffff800080a622c8 x5 : ffff0000f20e67d0 x4 : ffff80008a131adc x3 : ffff800082fe1e88 x2 : dead000000000122 x1 : 0000000000000008 x0 : 0000000000000000 Call trace: __list_del_entry_valid_or_report+0x78/0x158 lib/list_debug.c:62 __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+0x30/0x104 net/bluetooth/mgmt_util.c:314 mgmt_remove_adv_monitor_complete+0x248/0x498 net/bluetooth/mgmt.c:5435 hci_cmd_sync_work+0x214/0x34c net/bluetooth/hci_sync.c:312 process_one_work+0x7b0/0x15e8 kernel/workqueue.c:3231 process_scheduled_works kernel/workqueue.c:3312 [inline] worker_thread+0x938/0xef4 kernel/workqueue.c:3393 kthread+0x288/0x310 kernel/kthread.c:389 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:860 Code: 91008902 eb0202bf 54000520 d343fea8 (38766908) ---[ end trace 0000000000000000 ]--- ---------------- Code disassembly (best guess): 0: 91008902 add x2, x8, #0x22 4: eb0202bf cmp x21, x2 8: 54000520 b.eq 0xac // b.none c: d343fea8 lsr x8, x21, #3 * 10: 38766908 ldrb w8, [x8, x22] <-- trapping instruction