================================================================== BUG: KASAN: slab-use-after-free in instrument_atomic_read_write include/linux/instrumented.h:96 [inline] BUG: KASAN: slab-use-after-free in atomic_fetch_sub_release include/linux/atomic/atomic-instrumented.h:400 [inline] BUG: KASAN: slab-use-after-free in __refcount_sub_and_test include/linux/refcount.h:264 [inline] BUG: KASAN: slab-use-after-free in __refcount_dec_and_test include/linux/refcount.h:307 [inline] BUG: KASAN: slab-use-after-free in refcount_dec_and_test include/linux/refcount.h:325 [inline] BUG: KASAN: slab-use-after-free in kref_put include/linux/kref.h:64 [inline] BUG: KASAN: slab-use-after-free in sco_conn_put+0x3d/0x4c0 net/bluetooth/sco.c:107 Write of size 4 at addr ffff8880666c98fc by task kworker/u33:1/5313 CPU: 3 UID: 0 PID: 5313 Comm: kworker/u33:1 Not tainted 6.14.0-rc6-syzkaller-00003-g4d872d51bc9d #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Workqueue: hci1 hci_cmd_sync_work Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:408 [inline] print_report+0xc3/0x670 mm/kasan/report.c:521 kasan_report+0xd9/0x110 mm/kasan/report.c:634 check_region_inline mm/kasan/generic.c:183 [inline] kasan_check_range+0xef/0x1a0 mm/kasan/generic.c:189 instrument_atomic_read_write include/linux/instrumented.h:96 [inline] atomic_fetch_sub_release include/linux/atomic/atomic-instrumented.h:400 [inline] __refcount_sub_and_test include/linux/refcount.h:264 [inline] __refcount_dec_and_test include/linux/refcount.h:307 [inline] refcount_dec_and_test include/linux/refcount.h:325 [inline] kref_put include/linux/kref.h:64 [inline] sco_conn_put+0x3d/0x4c0 net/bluetooth/sco.c:107 sco_conn_del+0x26f/0x2e0 net/bluetooth/sco.c:263 sco_connect_cfm+0x1d4/0xc00 net/bluetooth/sco.c:1417 hci_connect_cfm include/net/bluetooth/hci_core.h:2051 [inline] hci_conn_failed+0x225/0x3e0 net/bluetooth/hci_conn.c:1266 hci_abort_conn_sync+0x91c/0xfe0 net/bluetooth/hci_sync.c:5588 abort_conn_sync+0x197/0x360 net/bluetooth/hci_conn.c:3023 hci_cmd_sync_work+0x1a4/0x410 net/bluetooth/hci_sync.c:332 process_one_work+0x9c5/0x1ba0 kernel/workqueue.c:3238 process_scheduled_works kernel/workqueue.c:3319 [inline] worker_thread+0x6c8/0xf00 kernel/workqueue.c:3400 kthread+0x3af/0x750 kernel/kthread.c:464 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Allocated by task 18595: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:377 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:394 kmalloc_noprof include/linux/slab.h:901 [inline] kzalloc_noprof include/linux/slab.h:1037 [inline] sco_conn_add.part.0+0x43/0x330 net/bluetooth/sco.c:199 sco_conn_add net/bluetooth/sco.c:325 [inline] sco_connect net/bluetooth/sco.c:339 [inline] sco_sock_connect+0x774/0xcc0 net/bluetooth/sco.c:648 __sys_connect_file+0x13e/0x1a0 net/socket.c:2045 __sys_connect+0x14f/0x170 net/socket.c:2064 __do_sys_connect net/socket.c:2070 [inline] __se_sys_connect net/socket.c:2067 [inline] __ia32_sys_connect+0x71/0xb0 net/socket.c:2067 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x73/0x120 arch/x86/entry/common.c:387 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:412 entry_SYSENTER_compat_after_hwframe+0x84/0x8e Freed by task 5313: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:576 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x51/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:4609 [inline] kfree+0x2c4/0x4d0 mm/slub.c:4757 sco_conn_free net/bluetooth/sco.c:97 [inline] kref_put include/linux/kref.h:65 [inline] sco_conn_put+0x2cd/0x4c0 net/bluetooth/sco.c:107 sco_conn_del+0x262/0x2e0 net/bluetooth/sco.c:260 sco_connect_cfm+0x1d4/0xc00 net/bluetooth/sco.c:1417 hci_connect_cfm include/net/bluetooth/hci_core.h:2051 [inline] hci_conn_failed+0x225/0x3e0 net/bluetooth/hci_conn.c:1266 hci_abort_conn_sync+0x91c/0xfe0 net/bluetooth/hci_sync.c:5588 abort_conn_sync+0x197/0x360 net/bluetooth/hci_conn.c:3023 hci_cmd_sync_work+0x1a4/0x410 net/bluetooth/hci_sync.c:332 process_one_work+0x9c5/0x1ba0 kernel/workqueue.c:3238 process_scheduled_works kernel/workqueue.c:3319 [inline] worker_thread+0x6c8/0xf00 kernel/workqueue.c:3400 kthread+0x3af/0x750 kernel/kthread.c:464 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 The buggy address belongs to the object at ffff8880666c9800 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 252 bytes inside of freed 256-byte region [ffff8880666c9800, ffff8880666c9900) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff8880666c9200 pfn:0x666c8 head: order:1 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0x4fff00000000040(head|node=1|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 04fff00000000040 ffff88801b042b40 ffffea0001a33000 dead000000000002 raw: ffff8880666c9200 000000008010000e 00000000f5000000 0000000000000000 head: 04fff00000000040 ffff88801b042b40 ffffea0001a33000 dead000000000002 head: ffff8880666c9200 000000008010000e 00000000f5000000 0000000000000000 head: 04fff00000000001 ffffea000199b201 ffffffffffffffff 0000000000000000 head: 0000000000000002 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 1, migratetype Unmovable, gfp_mask 0x252800(GFP_NOWAIT|__GFP_NORETRY|__GFP_COMP|__GFP_THISNODE), pid 15132, tgid 15131 (syz.1.2739), ts 379056300842, free_ts 373807632083 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x181/0x1b0 mm/page_alloc.c:1551 prep_new_page mm/page_alloc.c:1559 [inline] get_page_from_freelist+0xfce/0x2f80 mm/page_alloc.c:3477 __alloc_frozen_pages_noprof+0x221/0x2470 mm/page_alloc.c:4740 alloc_slab_page mm/slub.c:2425 [inline] allocate_slab mm/slub.c:2587 [inline] new_slab+0x94/0x330 mm/slub.c:2640 ___slab_alloc+0xc5d/0x1720 mm/slub.c:3826 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3916 __slab_alloc_node mm/slub.c:3991 [inline] slab_alloc_node mm/slub.c:4152 [inline] __do_kmalloc_node mm/slub.c:4293 [inline] __kmalloc_node_noprof+0x2f0/0x510 mm/slub.c:4300 kmalloc_array_node_noprof include/linux/slab.h:1018 [inline] alloc_slab_obj_exts+0x41/0xa0 mm/slub.c:1964 account_slab mm/slub.c:2550 [inline] allocate_slab mm/slub.c:2605 [inline] new_slab+0x285/0x330 mm/slub.c:2640 ___slab_alloc+0xc5d/0x1720 mm/slub.c:3826 __kmem_cache_alloc_bulk mm/slub.c:5045 [inline] kmem_cache_alloc_bulk_noprof+0x229/0xb10 mm/slub.c:5117 __io_alloc_req_refill+0x9d/0x5b0 io_uring/io_uring.c:965 io_alloc_req io_uring/io_uring.h:435 [inline] io_submit_sqes+0xe35/0x2670 io_uring/io_uring.c:2310 __do_sys_io_uring_enter+0xd60/0x1670 io_uring/io_uring.c:3372 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x73/0x120 arch/x86/entry/common.c:387 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:412 page last free pid 15021 tgid 15021 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_frozen_pages+0x6db/0xfb0 mm/page_alloc.c:2660 __put_partials+0x14c/0x170 mm/slub.c:3153 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x4e/0x120 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x195/0x1e0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:329 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4115 [inline] slab_alloc_node mm/slub.c:4164 [inline] kmem_cache_alloc_noprof+0x226/0x3d0 mm/slub.c:4171 vm_area_dup+0x21/0x2f0 kernel/fork.c:487 __split_vma+0x181/0x1160 mm/vma.c:466 vms_gather_munmap_vmas+0x38b/0x1730 mm/vma.c:1289 __mmap_prepare mm/vma.c:2246 [inline] __mmap_region+0x328/0x2760 mm/vma.c:2448 mmap_region+0x1ab/0x3f0 mm/vma.c:2539 do_mmap+0xd8d/0x11b0 mm/mmap.c:561 vm_mmap_pgoff+0x203/0x3a0 mm/util.c:575 ksys_mmap_pgoff+0x32c/0x5c0 mm/mmap.c:607 __do_sys_mmap arch/x86/kernel/sys_x86_64.c:89 [inline] __se_sys_mmap arch/x86/kernel/sys_x86_64.c:82 [inline] __x64_sys_mmap+0x125/0x190 arch/x86/kernel/sys_x86_64.c:82 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 Memory state around the buggy address: ffff8880666c9780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880666c9800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880666c9880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880666c9900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880666c9980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================