================================================================== BUG: KASAN: slab-use-after-free in sco_conn_free net/bluetooth/sco.c:87 [inline] BUG: KASAN: slab-use-after-free in kref_put include/linux/kref.h:65 [inline] BUG: KASAN: slab-use-after-free in sco_conn_put+0x471/0x4c0 net/bluetooth/sco.c:107 Write of size 8 at addr ffff8880584e25a0 by task syz-executor/12290 CPU: 0 UID: 0 PID: 12290 Comm: syz-executor Not tainted 6.14.0-rc6-syzkaller-00115-ge3a854b577cb #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 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 sco_conn_free net/bluetooth/sco.c:87 [inline] kref_put include/linux/kref.h:65 [inline] sco_conn_put+0x471/0x4c0 net/bluetooth/sco.c:107 sco_conn_del+0x26f/0x2e0 net/bluetooth/sco.c:271 sco_disconn_cfm+0x76/0xb0 net/bluetooth/sco.c:1436 hci_disconn_cfm include/net/bluetooth/hci_core.h:2044 [inline] hci_conn_hash_flush+0x10b/0x260 net/bluetooth/hci_conn.c:2698 hci_dev_close_sync+0x603/0x11a0 net/bluetooth/hci_sync.c:5197 hci_dev_do_close+0x2e/0x90 net/bluetooth/hci_core.c:483 hci_unregister_dev+0x213/0x620 net/bluetooth/hci_core.c:2678 vhci_release+0x79/0xf0 drivers/bluetooth/hci_vhci.c:664 __fput+0x3ff/0xb70 fs/file_table.c:464 task_work_run+0x14e/0x250 kernel/task_work.c:227 exit_task_work include/linux/task_work.h:40 [inline] do_exit+0xad8/0x2d70 kernel/exit.c:938 do_group_exit+0xd3/0x2a0 kernel/exit.c:1087 get_signal+0x24ed/0x26c0 kernel/signal.c:3036 arch_do_signal_or_restart+0x90/0x7e0 arch/x86/kernel/signal.c:337 exit_to_user_mode_loop kernel/entry/common.c:111 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:329 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline] syscall_exit_to_user_mode+0x150/0x2a0 kernel/entry/common.c:218 do_syscall_64+0xda/0x250 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fa3b4fbfa25 Code: Unable to access opcode bytes at 0x7fa3b4fbf9fb. RSP: 002b:00007ffdeaab7c40 EFLAGS: 00000293 ORIG_RAX: 00000000000000e6 RAX: fffffffffffffdfc RBX: 0000000000000128 RCX: 00007fa3b4fbfa25 RDX: 00007ffdeaab7c80 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 00007ffdeaab7cec R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000001388 R13: 00000000000927c0 R14: 00000000000385a3 R15: 00007ffdeaab7d40 Allocated by task 13511: 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 kasan_kmalloc include/linux/kasan.h:260 [inline] __do_kmalloc_node mm/slub.c:4294 [inline] __kmalloc_node_track_caller_noprof+0x222/0x510 mm/slub.c:4313 kmemdup_noprof+0x29/0x60 mm/util.c:135 kmemdup_noprof include/linux/fortify-string.h:765 [inline] ipv6_sysctl_net_init+0x30/0x2b0 net/ipv6/sysctl_net_ipv6.c:261 ops_init+0x1df/0x5f0 net/core/net_namespace.c:138 setup_net+0x21f/0x860 net/core/net_namespace.c:362 copy_net_ns+0x2a6/0x5f0 net/core/net_namespace.c:516 create_new_namespaces+0x3ea/0xad0 kernel/nsproxy.c:110 copy_namespaces+0x468/0x560 kernel/nsproxy.c:179 copy_process+0x29fc/0x8c50 kernel/fork.c:2406 kernel_clone+0xfd/0x960 kernel/fork.c:2815 __do_sys_clone+0xcf/0x120 kernel/fork.c:2958 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 8066: 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 ipv6_sysctl_net_exit+0x158/0x1d0 net/ipv6/sysctl_net_ipv6.c:326 ops_exit_list+0xb0/0x180 net/core/net_namespace.c:172 cleanup_net+0x5c6/0xb30 net/core/net_namespace.c:652 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 ffff8880584e2000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 1440 bytes inside of freed 2048-byte region [ffff8880584e2000, ffff8880584e2800) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff8880584e3000 pfn:0x584e0 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000240(workingset|head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000240 ffff88801b042f00 ffffea0000ac6e10 ffffea00004dea10 raw: ffff8880584e3000 0000000000080003 00000000f5000000 0000000000000000 head: 00fff00000000240 ffff88801b042f00 ffffea0000ac6e10 ffffea00004dea10 head: ffff8880584e3000 0000000000080003 00000000f5000000 0000000000000000 head: 00fff00000000003 ffffea0001613801 ffffffffffffffff 0000000000000000 head: 0000000000000008 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 9615, tgid 9614 (syz.1.1024), ts 130165655745, free_ts 130153806111 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_pages_mpol+0x1fc/0x540 mm/mempolicy.c:2270 alloc_slab_page mm/slub.c:2423 [inline] allocate_slab mm/slub.c:2587 [inline] new_slab+0x23d/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] __kmalloc_cache_noprof+0xfa/0x410 mm/slub.c:4320 kmalloc_noprof include/linux/slab.h:901 [inline] rtnl_newlink+0x109/0x1d60 net/core/rtnetlink.c:3922 rtnetlink_rcv_msg+0x95b/0xea0 net/core/rtnetlink.c:6912 netlink_rcv_skb+0x16b/0x440 net/netlink/af_netlink.c:2533 netlink_unicast_kernel net/netlink/af_netlink.c:1312 [inline] netlink_unicast+0x53c/0x7f0 net/netlink/af_netlink.c:1338 netlink_sendmsg+0x8b8/0xd70 net/netlink/af_netlink.c:1882 sock_sendmsg_nosec net/socket.c:718 [inline] __sock_sendmsg net/socket.c:733 [inline] ____sys_sendmsg+0xaaf/0xc90 net/socket.c:2573 ___sys_sendmsg+0x135/0x1e0 net/socket.c:2627 __sys_sendmsg+0x16e/0x220 net/socket.c:2659 page last free pid 5945 tgid 5945 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 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 ptlock_alloc+0x1f/0x70 mm/memory.c:7062 ptlock_init include/linux/mm.h:2972 [inline] pagetable_pte_ctor include/linux/mm.h:3020 [inline] __pte_alloc_one_noprof include/asm-generic/pgalloc.h:73 [inline] pte_alloc_one+0x74/0x390 arch/x86/mm/pgtable.c:44 __pte_alloc+0x6e/0x3d0 mm/memory.c:447 copy_pte_range mm/memory.c:1107 [inline] copy_pmd_range mm/memory.c:1262 [inline] copy_pud_range mm/memory.c:1299 [inline] copy_p4d_range mm/memory.c:1323 [inline] copy_page_range+0x3656/0x5570 mm/memory.c:1421 dup_mmap kernel/fork.c:748 [inline] dup_mm kernel/fork.c:1700 [inline] copy_mm kernel/fork.c:1752 [inline] copy_process+0x7ccb/0x8c50 kernel/fork.c:2403 kernel_clone+0xfd/0x960 kernel/fork.c:2815 __do_sys_clone+0xcf/0x120 kernel/fork.c:2958 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff8880584e2480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880584e2500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880584e2580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880584e2600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880584e2680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================