================================================================== 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_add_relaxed include/linux/atomic/atomic-instrumented.h:252 [inline] BUG: KASAN: slab-use-after-free in __refcount_add include/linux/refcount.h:182 [inline] BUG: KASAN: slab-use-after-free in __refcount_inc include/linux/refcount.h:239 [inline] BUG: KASAN: slab-use-after-free in refcount_inc include/linux/refcount.h:256 [inline] BUG: KASAN: slab-use-after-free in sock_hold include/net/sock.h:774 [inline] BUG: KASAN: slab-use-after-free in sco_conn_del+0xa5/0x310 net/bluetooth/sco.c:195 Write of size 4 at addr ffff888079f38080 by task syz-executor.2/30213 CPU: 1 PID: 30213 Comm: syz-executor.2 Not tainted 6.8.0-rc5-syzkaller-01592-g25d434257464 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/25/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e7/0x2e0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:377 [inline] print_report+0x167/0x540 mm/kasan/report.c:488 kasan_report+0x142/0x180 mm/kasan/report.c:601 kasan_check_range+0x282/0x290 mm/kasan/generic.c:189 instrument_atomic_read_write include/linux/instrumented.h:96 [inline] atomic_fetch_add_relaxed include/linux/atomic/atomic-instrumented.h:252 [inline] __refcount_add include/linux/refcount.h:182 [inline] __refcount_inc include/linux/refcount.h:239 [inline] refcount_inc include/linux/refcount.h:256 [inline] sock_hold include/net/sock.h:774 [inline] sco_conn_del+0xa5/0x310 net/bluetooth/sco.c:195 hci_disconn_cfm include/net/bluetooth/hci_core.h:2001 [inline] hci_conn_hash_flush+0xff/0x240 net/bluetooth/hci_conn.c:2645 hci_dev_close_sync+0x9ab/0xff0 net/bluetooth/hci_sync.c:4954 hci_dev_do_close net/bluetooth/hci_core.c:554 [inline] hci_unregister_dev+0x1e3/0x4e0 net/bluetooth/hci_core.c:2739 vhci_release+0x83/0xd0 drivers/bluetooth/hci_vhci.c:674 __fput+0x429/0x8a0 fs/file_table.c:376 task_work_run+0x24e/0x310 kernel/task_work.c:180 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0xa2c/0x2740 kernel/exit.c:871 do_group_exit+0x206/0x2c0 kernel/exit.c:1020 get_signal+0x176d/0x1850 kernel/signal.c:2893 arch_do_signal_or_restart+0x96/0x860 arch/x86/kernel/signal.c:310 exit_to_user_mode_loop kernel/entry/common.c:105 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:201 [inline] syscall_exit_to_user_mode+0xc8/0x370 kernel/entry/common.c:212 do_syscall_64+0x108/0x240 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x6f/0x77 RIP: 0033:0x7f7eb5a7ca4c Code: Unable to access opcode bytes at 0x7f7eb5a7ca22. RSP: 002b:00007ffd8c8aea00 EFLAGS: 00000246 ORIG_RAX: 0000000000000000 RAX: fffffffffffffe00 RBX: 0000000000000003 RCX: 00007f7eb5a7ca4c RDX: 0000000000000040 RSI: 00007f7eb5ba8020 RDI: 00000000000000f9 RBP: 00007ffd8c8aea8c R08: 0000000000000000 R09: 0079746972756365 R10: 00007f7eb5b7c6a0 R11: 0000000000000246 R12: 0000000000000032 R13: 00000000001e88ed R14: 00000000001e88be R15: 0000000000000008 Allocated by task 30270: 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:372 [inline] __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:389 kasan_kmalloc include/linux/kasan.h:211 [inline] __do_kmalloc_node mm/slub.c:3981 [inline] __kmalloc+0x22e/0x490 mm/slub.c:3994 kmalloc include/linux/slab.h:594 [inline] sk_prot_alloc+0xe0/0x210 net/core/sock.c:2078 sk_alloc+0x38/0x370 net/core/sock.c:2131 bt_sock_alloc+0x3c/0x340 net/bluetooth/af_bluetooth.c:148 sco_sock_alloc net/bluetooth/sco.c:495 [inline] sco_sock_create+0xbb/0x390 net/bluetooth/sco.c:526 bt_sock_create+0x161/0x230 net/bluetooth/af_bluetooth.c:132 __sock_create+0x48f/0x920 net/socket.c:1571 sock_create net/socket.c:1622 [inline] __sys_socket_create net/socket.c:1659 [inline] __sys_socket+0x14f/0x3c0 net/socket.c:1706 __do_sys_socket net/socket.c:1720 [inline] __se_sys_socket net/socket.c:1718 [inline] __x64_sys_socket+0x7a/0x90 net/socket.c:1718 do_syscall_64+0xf9/0x240 entry_SYSCALL_64_after_hwframe+0x6f/0x77 Freed by task 30270: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 kasan_save_free_info+0x4e/0x60 mm/kasan/generic.c:640 poison_slab_object+0xa6/0xe0 mm/kasan/common.c:241 __kasan_slab_free+0x34/0x70 mm/kasan/common.c:257 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2121 [inline] slab_free mm/slub.c:4299 [inline] kfree+0x14a/0x380 mm/slub.c:4409 sk_prot_free net/core/sock.c:2114 [inline] __sk_destruct+0x476/0x5f0 net/core/sock.c:2206 sco_sock_release+0x25d/0x320 net/bluetooth/sco.c:1256 __sock_release net/socket.c:659 [inline] sock_close+0xbc/0x240 net/socket.c:1421 __fput+0x429/0x8a0 fs/file_table.c:376 task_work_run+0x24e/0x310 kernel/task_work.c:180 get_signal+0x1672/0x1850 kernel/signal.c:2669 arch_do_signal_or_restart+0x96/0x860 arch/x86/kernel/signal.c:310 exit_to_user_mode_loop kernel/entry/common.c:105 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:201 [inline] syscall_exit_to_user_mode+0xc8/0x370 kernel/entry/common.c:212 do_syscall_64+0x108/0x240 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x6f/0x77 The buggy address belongs to the object at ffff888079f38000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 128 bytes inside of freed 2048-byte region [ffff888079f38000, ffff888079f38800) The buggy address belongs to the physical page: page:ffffea0001e7ce00 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888079f3e000 pfn:0x79f38 head:ffffea0001e7ce00 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000a40(workingset|slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000a40 ffff888014c42000 ffffea000077d610 ffffea000086de10 raw: ffff888079f3e000 0000000000080005 00000001ffffffff 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 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 11, tgid 11 (kworker/u4:0), ts 1641909219022, free_ts 1641773655074 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x1ea/0x210 mm/page_alloc.c:1533 prep_new_page mm/page_alloc.c:1540 [inline] get_page_from_freelist+0x33ea/0x3580 mm/page_alloc.c:3311 __alloc_pages+0x255/0x680 mm/page_alloc.c:4567 __alloc_pages_node include/linux/gfp.h:238 [inline] alloc_pages_node include/linux/gfp.h:261 [inline] alloc_slab_page+0x5f/0x160 mm/slub.c:2190 allocate_slab mm/slub.c:2354 [inline] new_slab+0x84/0x2f0 mm/slub.c:2407 ___slab_alloc+0xd17/0x13e0 mm/slub.c:3540 __slab_alloc mm/slub.c:3625 [inline] __slab_alloc_node mm/slub.c:3678 [inline] slab_alloc_node mm/slub.c:3850 [inline] __do_kmalloc_node mm/slub.c:3980 [inline] __kmalloc_node_track_caller+0x2d1/0x4e0 mm/slub.c:4001 kmalloc_reserve+0xf3/0x260 net/core/skbuff.c:600 __alloc_skb+0x1b1/0x420 net/core/skbuff.c:669 alloc_skb include/linux/skbuff.h:1301 [inline] nlmsg_new include/net/netlink.h:1010 [inline] rtmsg_ifinfo_build_skb+0x89/0x290 net/core/rtnetlink.c:4051 unregister_netdevice_many_notify+0xe2f/0x16d0 net/core/dev.c:11131 unregister_netdevice_many net/core/dev.c:11185 [inline] default_device_exit_batch+0x970/0x9f0 net/core/dev.c:11662 ops_exit_list net/core/net_namespace.c:175 [inline] cleanup_net+0x89d/0xcc0 net/core/net_namespace.c:637 process_one_work kernel/workqueue.c:2633 [inline] process_scheduled_works+0x913/0x1420 kernel/workqueue.c:2706 worker_thread+0xa5f/0x1000 kernel/workqueue.c:2787 kthread+0x2ef/0x390 kernel/kthread.c:388 page last free pid 11 tgid 11 stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1140 [inline] free_unref_page_prepare+0x968/0xa90 mm/page_alloc.c:2346 free_unref_page+0x37/0x3f0 mm/page_alloc.c:2486 __slab_free+0x349/0x410 mm/slub.c:4211 qlink_free mm/kasan/quarantine.c:160 [inline] qlist_free_all+0x6d/0xd0 mm/kasan/quarantine.c:176 kasan_quarantine_reduce+0x14f/0x170 mm/kasan/quarantine.c:283 __kasan_slab_alloc+0x23/0x80 mm/kasan/common.c:324 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3813 [inline] slab_alloc_node mm/slub.c:3860 [inline] kmem_cache_alloc_node+0x18f/0x380 mm/slub.c:3903 __alloc_skb+0x181/0x420 net/core/skbuff.c:659 alloc_skb include/linux/skbuff.h:1301 [inline] nlmsg_new include/net/netlink.h:1010 [inline] inet6_netconf_notify_devconf+0xfc/0x1c0 net/ipv6/addrconf.c:586 __addrconf_sysctl_unregister net/ipv6/addrconf.c:7270 [inline] addrconf_sysctl_unregister net/ipv6/addrconf.c:7294 [inline] addrconf_ifdown+0x187e/0x1bc0 net/ipv6/addrconf.c:4015 addrconf_notify+0x3cb/0x1020 notifier_call_chain+0x18f/0x3b0 kernel/notifier.c:93 call_netdevice_notifiers_extack net/core/dev.c:1987 [inline] call_netdevice_notifiers net/core/dev.c:2001 [inline] unregister_netdevice_many_notify+0xd96/0x16d0 net/core/dev.c:11127 unregister_netdevice_many net/core/dev.c:11185 [inline] default_device_exit_batch+0x970/0x9f0 net/core/dev.c:11662 ops_exit_list net/core/net_namespace.c:175 [inline] cleanup_net+0x89d/0xcc0 net/core/net_namespace.c:637 process_one_work kernel/workqueue.c:2633 [inline] process_scheduled_works+0x913/0x1420 kernel/workqueue.c:2706 Memory state around the buggy address: ffff888079f37f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888079f38000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888079f38080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888079f38100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888079f38180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================