================================================================== 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:193 [inline] BUG: KASAN: slab-use-after-free in __refcount_inc include/linux/refcount.h:250 [inline] BUG: KASAN: slab-use-after-free in refcount_inc include/linux/refcount.h:267 [inline] BUG: KASAN: slab-use-after-free in sock_hold include/net/sock.h:777 [inline] BUG: KASAN: slab-use-after-free in sco_sock_timeout+0x68/0x2b0 net/bluetooth/sco.c:88 Write of size 4 at addr ffff888079dcc080 by task kworker/0:0/8 CPU: 0 PID: 8 Comm: kworker/0:0 Not tainted 6.7.0-rc4-syzkaller-00009-gbee0e7762ad2 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/2023 Workqueue: events sco_sock_timeout Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0xc4/0x620 mm/kasan/report.c:475 kasan_report+0xda/0x110 mm/kasan/report.c:588 check_region_inline mm/kasan/generic.c:181 [inline] kasan_check_range+0xef/0x190 mm/kasan/generic.c:187 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:193 [inline] __refcount_inc include/linux/refcount.h:250 [inline] refcount_inc include/linux/refcount.h:267 [inline] sock_hold include/net/sock.h:777 [inline] sco_sock_timeout+0x68/0x2b0 net/bluetooth/sco.c:88 process_one_work+0x886/0x15d0 kernel/workqueue.c:2630 process_scheduled_works kernel/workqueue.c:2703 [inline] worker_thread+0x8b9/0x1290 kernel/workqueue.c:2784 kthread+0x2c6/0x3a0 kernel/kthread.c:388 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242 Allocated by task 10658: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0xa2/0xb0 mm/kasan/common.c:383 kasan_kmalloc include/linux/kasan.h:198 [inline] __do_kmalloc_node mm/slab_common.c:1007 [inline] __kmalloc+0x59/0x90 mm/slab_common.c:1020 kmalloc include/linux/slab.h:604 [inline] sk_prot_alloc+0x1a4/0x2a0 net/core/sock.c:2075 sk_alloc+0x36/0xb80 net/core/sock.c:2128 bt_sock_alloc+0x3b/0x3e0 net/bluetooth/af_bluetooth.c:148 sco_sock_alloc net/bluetooth/sco.c:495 [inline] sco_sock_create+0xe3/0x3b0 net/bluetooth/sco.c:526 bt_sock_create+0x180/0x340 net/bluetooth/af_bluetooth.c:132 __sock_create+0x328/0x800 net/socket.c:1569 sock_create net/socket.c:1620 [inline] __sys_socket_create net/socket.c:1657 [inline] __sys_socket+0x14c/0x260 net/socket.c:1704 __do_sys_socket net/socket.c:1718 [inline] __se_sys_socket net/socket.c:1716 [inline] __x64_sys_socket+0x72/0xb0 net/socket.c:1716 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x40/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b Freed by task 10659: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:522 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x15b/0x1b0 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:164 [inline] slab_free_hook mm/slub.c:1800 [inline] slab_free_freelist_hook+0x114/0x1e0 mm/slub.c:1826 slab_free mm/slub.c:3809 [inline] __kmem_cache_free+0xc0/0x180 mm/slub.c:3822 sk_prot_free net/core/sock.c:2111 [inline] __sk_destruct+0x602/0x770 net/core/sock.c:2203 sk_destruct+0xc2/0xf0 net/core/sock.c:2218 __sk_free+0xf4/0x3e0 net/core/sock.c:2229 sk_free+0x7c/0xa0 net/core/sock.c:2240 sock_put include/net/sock.h:1990 [inline] sco_sock_kill net/bluetooth/sco.c:426 [inline] sco_sock_kill+0x19d/0x1c0 net/bluetooth/sco.c:416 sco_sock_release+0x154/0x2c0 net/bluetooth/sco.c:1256 __sock_release+0xae/0x260 net/socket.c:659 sock_close+0x1c/0x20 net/socket.c:1419 __fput+0x270/0xbb0 fs/file_table.c:394 task_work_run+0x14d/0x240 kernel/task_work.c:180 get_signal+0x106f/0x2790 kernel/signal.c:2680 arch_do_signal_or_restart+0x90/0x7f0 arch/x86/kernel/signal.c:309 exit_to_user_mode_loop kernel/entry/common.c:168 [inline] exit_to_user_mode_prepare+0x121/0x240 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x1e/0x60 kernel/entry/common.c:296 do_syscall_64+0x4d/0x110 arch/x86/entry/common.c:88 entry_SYSCALL_64_after_hwframe+0x63/0x6b Last potentially related work creation: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:492 insert_work+0x38/0x230 kernel/workqueue.c:1647 __queue_work+0x62e/0x11f0 kernel/workqueue.c:1799 queue_work_on+0xed/0x110 kernel/workqueue.c:1834 __bpf_prog_release net/core/filter.c:1176 [inline] __bpf_prog_release net/core/filter.c:1170 [inline] bpf_prog_destroy+0xb7/0xf0 net/core/filter.c:1455 seccomp_filter_free kernel/seccomp.c:526 [inline] seccomp_filter_free kernel/seccomp.c:523 [inline] __put_seccomp_filter+0xb6/0x100 kernel/seccomp.c:546 release_task+0xe58/0x1b10 kernel/exit.c:279 wait_task_zombie kernel/exit.c:1187 [inline] wait_consider_task+0x17df/0x40c0 kernel/exit.c:1414 do_wait_pid kernel/exit.c:1553 [inline] __do_wait+0x746/0x890 kernel/exit.c:1588 do_wait+0x212/0x530 kernel/exit.c:1629 kernel_wait4+0x16d/0x280 kernel/exit.c:1788 __do_sys_wait4+0x15b/0x170 kernel/exit.c:1816 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x40/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b The buggy address belongs to the object at ffff888079dcc000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 128 bytes inside of freed 2048-byte region [ffff888079dcc000, ffff888079dcc800) The buggy address belongs to the physical page: page:ffffea0001e77200 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x79dc8 head:ffffea0001e77200 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 anon flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000840 ffff888013042000 0000000000000000 0000000000000001 raw: 0000000000000000 0000000000080008 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 4518, tgid 4518 (udevd), ts 101680258607, free_ts 45013800009 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2d0/0x350 mm/page_alloc.c:1537 prep_new_page mm/page_alloc.c:1544 [inline] get_page_from_freelist+0xa25/0x36d0 mm/page_alloc.c:3312 __alloc_pages+0x22e/0x2420 mm/page_alloc.c:4568 alloc_pages_mpol+0x258/0x5f0 mm/mempolicy.c:2133 alloc_slab_page mm/slub.c:1870 [inline] allocate_slab mm/slub.c:2017 [inline] new_slab+0x283/0x3c0 mm/slub.c:2070 ___slab_alloc+0x979/0x1500 mm/slub.c:3223 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3322 __slab_alloc_node mm/slub.c:3375 [inline] slab_alloc_node mm/slub.c:3468 [inline] __kmem_cache_alloc_node+0x131/0x310 mm/slub.c:3517 __do_kmalloc_node mm/slab_common.c:1006 [inline] __kmalloc+0x49/0x90 mm/slab_common.c:1020 kmalloc include/linux/slab.h:604 [inline] sk_prot_alloc+0x1a4/0x2a0 net/core/sock.c:2075 sk_alloc+0x36/0xb80 net/core/sock.c:2128 __netlink_create+0x63/0x380 net/netlink/af_netlink.c:647 netlink_create+0x3dc/0x670 net/netlink/af_netlink.c:712 __sock_create+0x328/0x800 net/socket.c:1569 sock_create net/socket.c:1620 [inline] __sys_socket_create net/socket.c:1657 [inline] __sys_socket+0x14c/0x260 net/socket.c:1704 __do_sys_socket net/socket.c:1718 [inline] __se_sys_socket net/socket.c:1716 [inline] __x64_sys_socket+0x72/0xb0 net/socket.c:1716 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1137 [inline] free_unref_page_prepare+0x4fa/0xaa0 mm/page_alloc.c:2347 free_unref_page+0x33/0x3b0 mm/page_alloc.c:2487 __folio_put_small mm/swap.c:106 [inline] __folio_put+0xc3/0x110 mm/swap.c:129 folio_put include/linux/mm.h:1483 [inline] put_page include/linux/mm.h:1552 [inline] anon_pipe_buf_release+0x3fa/0x4b0 fs/pipe.c:138 pipe_buf_release include/linux/pipe_fs_i.h:219 [inline] pipe_update_tail fs/pipe.c:234 [inline] pipe_read+0x645/0x1400 fs/pipe.c:354 call_read_iter include/linux/fs.h:2014 [inline] new_sync_read fs/read_write.c:389 [inline] vfs_read+0x7c5/0x8f0 fs/read_write.c:470 ksys_read+0x1f0/0x250 fs/read_write.c:613 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x40/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b Memory state around the buggy address: ffff888079dcbf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888079dcc000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888079dcc080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888079dcc100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888079dcc180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================