================================================================== 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:760 [inline] BUG: KASAN: slab-use-after-free in sco_sock_timeout+0x64/0x25c net/bluetooth/sco.c:88 Write of size 4 at addr ffff0000c6e53080 by task kworker/0:2/1784 CPU: 0 PID: 1784 Comm: kworker/0:2 Not tainted 6.8.0-rc7-syzkaller-g707081b61156 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 Workqueue: events sco_sock_timeout Call trace: dump_backtrace+0x1b8/0x1e4 arch/arm64/kernel/stacktrace.c:291 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:298 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd0/0x124 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:377 [inline] print_report+0x178/0x518 mm/kasan/report.c:488 kasan_report+0xd8/0x138 mm/kasan/report.c:601 kasan_check_range+0x254/0x294 mm/kasan/generic.c:189 __kasan_check_write+0x20/0x30 mm/kasan/shadow.c:37 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:760 [inline] sco_sock_timeout+0x64/0x25c net/bluetooth/sco.c:88 process_one_work+0x694/0x1204 kernel/workqueue.c:2633 process_scheduled_works kernel/workqueue.c:2706 [inline] worker_thread+0x938/0xef4 kernel/workqueue.c:2787 kthread+0x288/0x310 kernel/kthread.c:388 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:860 Allocated by task 11296: 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:575 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] __do_kmalloc_node mm/slub.c:3981 [inline] __kmalloc+0x2bc/0x5d4 mm/slub.c:3994 kmalloc include/linux/slab.h:594 [inline] sk_prot_alloc+0xc4/0x1f0 net/core/sock.c:2078 sk_alloc+0x44/0x3f0 net/core/sock.c:2131 __netlink_create+0x80/0x298 net/netlink/af_netlink.c:647 netlink_create+0x40c/0x73c net/netlink/af_netlink.c:712 __sock_create+0x43c/0x884 net/socket.c:1571 sock_create net/socket.c:1622 [inline] __sys_socket_create net/socket.c:1659 [inline] __sys_socket+0x134/0x340 net/socket.c:1706 __do_sys_socket net/socket.c:1720 [inline] __se_sys_socket net/socket.c:1718 [inline] __arm64_sys_socket+0x7c/0x94 net/socket.c:1718 __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 16: 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:589 poison_slab_object+0x124/0x18c 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:2121 [inline] slab_free mm/slub.c:4299 [inline] kfree+0x144/0x3cc mm/slub.c:4409 sk_prot_free net/core/sock.c:2114 [inline] __sk_destruct+0x4b8/0x74c net/core/sock.c:2206 sk_destruct net/core/sock.c:2221 [inline] __sk_free+0x388/0x4f4 net/core/sock.c:2232 sk_free+0x60/0xc8 net/core/sock.c:2243 deferred_put_nlk_sk+0x1f8/0x260 net/netlink/af_netlink.c:748 rcu_do_batch kernel/rcu/tree.c:2190 [inline] rcu_core+0x890/0x1b34 kernel/rcu/tree.c:2465 rcu_core_si+0x10/0x1c kernel/rcu/tree.c:2482 __do_softirq+0x2d8/0xce4 kernel/softirq.c:553 Last potentially related work creation: kasan_save_stack+0x40/0x6c mm/kasan/common.c:47 __kasan_record_aux_stack+0xcc/0xe8 mm/kasan/generic.c:551 kasan_record_aux_stack_noalloc+0x14/0x20 mm/kasan/generic.c:561 __call_rcu_common kernel/rcu/tree.c:2715 [inline] call_rcu+0x104/0xaf4 kernel/rcu/tree.c:2829 netlink_release+0x13e4/0x1934 net/netlink/af_netlink.c:831 __sock_release net/socket.c:659 [inline] sock_close+0xa4/0x1e8 net/socket.c:1421 __fput+0x30c/0x738 fs/file_table.c:376 __fput_sync+0x60/0x9c fs/file_table.c:461 __do_sys_close fs/open.c:1554 [inline] __se_sys_close fs/open.c:1539 [inline] __arm64_sys_close+0x150/0x1e0 fs/open.c:1539 __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 ffff0000c6e53000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 128 bytes inside of freed 2048-byte region [ffff0000c6e53000, ffff0000c6e53800) The buggy address belongs to the physical page: page:00000000f54c2e1e refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff0000c6e57000 pfn:0x106e50 head:00000000f54c2e1e order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0x5ffc00000000a40(workingset|slab|head|node=0|zone=2|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 05ffc00000000a40 ffff0000c0002000 fffffdffc346cc10 fffffdffc3abc010 raw: ffff0000c6e57000 0000000000080002 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000c6e52f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff0000c6e53000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff0000c6e53080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff0000c6e53100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000c6e53180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ------------[ cut here ]------------ refcount_t: addition on 0; use-after-free. WARNING: CPU: 0 PID: 1784 at lib/refcount.c:25 refcount_warn_saturate+0x1a8/0x20c lib/refcount.c:25 Modules linked in: CPU: 0 PID: 1784 Comm: kworker/0:2 Tainted: G B 6.8.0-rc7-syzkaller-g707081b61156 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 Workqueue: events sco_sock_timeout pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : refcount_warn_saturate+0x1a8/0x20c lib/refcount.c:25 lr : refcount_warn_saturate+0x1a8/0x20c lib/refcount.c:25 sp : ffff80009b217af0 x29: ffff80009b217af0 x28: 1fffe0001964014a x27: dfff800000000000 x26: ffff0000c1084008 x25: ffff0000cb200a50 x24: ffff0001b4013700 x23: dfff800000000000 x22: 0000000000000000 x21: 0000000000000002 x20: ffff0000c6e53080 x19: ffff800091cc2000 x18: ffff80009b2177e0 x17: 0000000000000000 x16: ffff80008aca6b80 x15: 0000000000000001 x14: 1ffff00013642e78 x13: 0000000000000000 x12: 0000000000000000 x11: 0000000000000003 x10: 0000000000ff0100 x9 : 3914ad001673bf00 x8 : 3914ad001673bf00 x7 : 0000000000000001 x6 : 0000000000000001 x5 : ffff80009b2173d8 x4 : ffff80008ed822c0 x3 : ffff80008036f0d8 x2 : 0000000000000001 x1 : 0000000000000001 x0 : 0000000000000000 Call trace: refcount_warn_saturate+0x1a8/0x20c lib/refcount.c:25 __refcount_inc include/linux/refcount.h:239 [inline] refcount_inc include/linux/refcount.h:256 [inline] sock_hold include/net/sock.h:760 [inline] sco_sock_timeout+0x19c/0x25c net/bluetooth/sco.c:88 process_one_work+0x694/0x1204 kernel/workqueue.c:2633 process_scheduled_works kernel/workqueue.c:2706 [inline] worker_thread+0x938/0xef4 kernel/workqueue.c:2787 kthread+0x288/0x310 kernel/kthread.c:388 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:860 irq event stamp: 501383 hardirqs last enabled at (501383): [] __exit_to_kernel_mode arch/arm64/kernel/entry-common.c:85 [inline] hardirqs last enabled at (501383): [] exit_to_kernel_mode+0xdc/0x10c arch/arm64/kernel/entry-common.c:95 hardirqs last disabled at (501382): [] __do_softirq+0x958/0xce4 kernel/softirq.c:569 softirqs last enabled at (501092): [] spin_unlock_bh include/linux/spinlock.h:396 [inline] softirqs last enabled at (501092): [] ptr_ring_consume_bh include/linux/ptr_ring.h:367 [inline] softirqs last enabled at (501092): [] wg_packet_encrypt_worker+0x10a0/0x1130 drivers/net/wireguard/send.c:293 softirqs last disabled at (501090): [] spin_lock_bh include/linux/spinlock.h:356 [inline] softirqs last disabled at (501090): [] ptr_ring_consume_bh include/linux/ptr_ring.h:365 [inline] softirqs last disabled at (501090): [] wg_packet_encrypt_worker+0xe58/0x1130 drivers/net/wireguard/send.c:293 ---[ end trace 0000000000000000 ]--- ------------[ cut here ]------------ refcount_t: underflow; use-after-free. WARNING: CPU: 0 PID: 1784 at lib/refcount.c:28 refcount_warn_saturate+0x1c8/0x20c lib/refcount.c:28 Modules linked in: CPU: 0 PID: 1784 Comm: kworker/0:2 Tainted: G B W 6.8.0-rc7-syzkaller-g707081b61156 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 Workqueue: events sco_sock_timeout pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : refcount_warn_saturate+0x1c8/0x20c lib/refcount.c:28 lr : refcount_warn_saturate+0x1c8/0x20c lib/refcount.c:28 sp : ffff80009b217af0 x29: ffff80009b217af0 x28: 1fffe0001964014a x27: dfff800000000000 x26: ffff0000c1084008 x25: ffff0000cb200a50 x24: ffff0001b4013700 x23: dfff800000000000 x22: 0000000000000000 x21: 0000000000000003 x20: ffff0000c6e53080 x19: ffff800091cc2000 x18: 1fffe000367fff96 x17: 0000000000000000 x16: ffff80008aca6b80 x15: 0000000000000001 x14: 1ffff00013642e78 x13: 0000000000000000 x12: 0000000000000000 x11: 0000000000000002 x10: 0000000000ff0100 x9 : 3914ad001673bf00 x8 : 3914ad001673bf00 x7 : 0000000000000001 x6 : 0000000000000001 x5 : ffff80009b2173d8 x4 : ffff80008ed822c0 x3 : ffff80008036f0d8 x2 : 0000000000000001 x1 : 0000000100000000 x0 : 0000000000000000 Call trace: refcount_warn_saturate+0x1c8/0x20c lib/refcount.c:28 __refcount_sub_and_test include/linux/refcount.h:272 [inline] __refcount_dec_and_test include/linux/refcount.h:304 [inline] refcount_dec_and_test include/linux/refcount.h:322 [inline] sock_put include/net/sock.h:1960 [inline] sco_sock_timeout+0x1b0/0x25c net/bluetooth/sco.c:100 process_one_work+0x694/0x1204 kernel/workqueue.c:2633 process_scheduled_works kernel/workqueue.c:2706 [inline] worker_thread+0x938/0xef4 kernel/workqueue.c:2787 kthread+0x288/0x310 kernel/kthread.c:388 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:860 irq event stamp: 501383 hardirqs last enabled at (501383): [] __exit_to_kernel_mode arch/arm64/kernel/entry-common.c:85 [inline] hardirqs last enabled at (501383): [] exit_to_kernel_mode+0xdc/0x10c arch/arm64/kernel/entry-common.c:95 hardirqs last disabled at (501382): [] __do_softirq+0x958/0xce4 kernel/softirq.c:569 softirqs last enabled at (501092): [] spin_unlock_bh include/linux/spinlock.h:396 [inline] softirqs last enabled at (501092): [] ptr_ring_consume_bh include/linux/ptr_ring.h:367 [inline] softirqs last enabled at (501092): [] wg_packet_encrypt_worker+0x10a0/0x1130 drivers/net/wireguard/send.c:293 softirqs last disabled at (501090): [] spin_lock_bh include/linux/spinlock.h:356 [inline] softirqs last disabled at (501090): [] ptr_ring_consume_bh include/linux/ptr_ring.h:365 [inline] softirqs last disabled at (501090): [] wg_packet_encrypt_worker+0xe58/0x1130 drivers/net/wireguard/send.c:293 ---[ end trace 0000000000000000 ]--- bridge0: port 2(bridge_slave_1) entered blocking state bridge0: port 2(bridge_slave_1) entered forwarding state wlan1: Created IBSS using preconfigured BSSID 50:50:50:50:50:50 wlan1: Creating new IBSS network, BSSID 50:50:50:50:50:50