================================================================== 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+0x68/0x2b0 net/bluetooth/sco.c:88 Write of size 4 at addr ffff88801fe55080 by task kworker/0:4/5225 CPU: 0 PID: 5225 Comm: kworker/0:4 Not tainted 6.8.0-rc7-syzkaller-00231-g09e5c48fea17 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 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:377 [inline] print_report+0xc4/0x620 mm/kasan/report.c:488 kasan_report+0xda/0x110 mm/kasan/report.c:601 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_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+0x68/0x2b0 net/bluetooth/sco.c:88 process_one_work+0x835/0x1570 kernel/workqueue.c:2633 process_scheduled_works kernel/workqueue.c:2706 [inline] worker_thread+0x8b9/0x12a0 kernel/workqueue.c:2787 kthread+0x2c6/0x3b0 kernel/kthread.c:388 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1b/0x30 arch/x86/entry/entry_64.S:243 Allocated by task 30973: 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:370 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:387 kasan_kmalloc include/linux/kasan.h:211 [inline] __do_kmalloc_node mm/slub.c:3981 [inline] __kmalloc+0x1f9/0x440 mm/slub.c:3994 kmalloc include/linux/slab.h:594 [inline] sk_prot_alloc+0x1a8/0x2a0 net/core/sock.c:2078 sk_alloc+0x36/0xb90 net/core/sock.c:2131 __netlink_create+0x63/0x380 net/netlink/af_netlink.c:647 netlink_create+0x3dc/0x670 net/netlink/af_netlink.c:712 __sock_create+0x32e/0x800 net/socket.c:1571 sock_create net/socket.c:1622 [inline] __sys_socket_create net/socket.c:1659 [inline] __sys_socket+0x150/0x260 net/socket.c:1706 __do_sys_socket net/socket.c:1720 [inline] __se_sys_socket net/socket.c:1718 [inline] __ia32_sys_socket+0x72/0xb0 net/socket.c:1718 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x7c/0x120 arch/x86/entry/common.c:321 do_fast_syscall_32+0x33/0x80 arch/x86/entry/common.c:346 entry_SYSENTER_compat_after_hwframe+0x7c/0x86 Freed by task 32: 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:589 poison_slab_object mm/kasan/common.c:240 [inline] __kasan_slab_free+0x11d/0x1a0 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+0x124/0x370 mm/slub.c:4409 sk_prot_free net/core/sock.c:2114 [inline] __sk_destruct+0x5e4/0x740 net/core/sock.c:2206 sk_destruct+0xc2/0xf0 net/core/sock.c:2221 __sk_free+0xf4/0x3e0 net/core/sock.c:2232 sk_free+0x7c/0xa0 net/core/sock.c:2243 deferred_put_nlk_sk+0x155/0x2f0 net/netlink/af_netlink.c:748 rcu_do_batch kernel/rcu/tree.c:2190 [inline] rcu_core+0x819/0x1680 kernel/rcu/tree.c:2465 __do_softirq+0x21c/0x8e7 kernel/softirq.c:553 Last potentially related work creation: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 __kasan_record_aux_stack+0xba/0xd0 mm/kasan/generic.c:551 __call_rcu_common.constprop.0+0x9a/0x7c0 kernel/rcu/tree.c:2715 netlink_release+0x1213/0x2000 net/netlink/af_netlink.c:831 __sock_release+0xb0/0x270 net/socket.c:659 sock_close+0x1c/0x30 net/socket.c:1421 __fput+0x270/0xb80 fs/file_table.c:376 task_work_run+0x14f/0x250 kernel/task_work.c:180 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0xa8a/0x2ad0 kernel/exit.c:871 do_group_exit+0xd4/0x2a0 kernel/exit.c:1020 get_signal+0x247e/0x26e0 kernel/signal.c:2893 arch_do_signal_or_restart+0x90/0x7f0 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+0x14d/0x2a0 kernel/entry/common.c:212 __do_fast_syscall_32+0x8c/0x120 arch/x86/entry/common.c:324 do_fast_syscall_32+0x33/0x80 arch/x86/entry/common.c:346 entry_SYSENTER_compat_after_hwframe+0x7c/0x86 The buggy address belongs to the object at ffff88801fe55000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 128 bytes inside of freed 2048-byte region [ffff88801fe55000, ffff88801fe55800) The buggy address belongs to the physical page: page:ffffea00007f9400 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88801fe55000 pfn:0x1fe50 head:ffffea00007f9400 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 ffff888014c42f00 ffffea0000667410 ffffea0000621e10 raw: ffff88801fe55000 0000000000080003 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 4890, tgid 4890 (dhcpcd), ts 31802414620, free_ts 31659576004 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2d4/0x350 mm/page_alloc.c:1533 prep_new_page mm/page_alloc.c:1540 [inline] get_page_from_freelist+0xa28/0x3780 mm/page_alloc.c:3311 __alloc_pages+0x22c/0x2430 mm/page_alloc.c:4569 __alloc_pages_node include/linux/gfp.h:238 [inline] alloc_pages_node include/linux/gfp.h:261 [inline] alloc_slab_page mm/slub.c:2190 [inline] allocate_slab mm/slub.c:2354 [inline] new_slab+0xcc/0x3a0 mm/slub.c:2407 ___slab_alloc+0x4b0/0x1780 mm/slub.c:3540 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3625 __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+0x3b8/0x440 mm/slub.c:3994 kmalloc include/linux/slab.h:594 [inline] sk_prot_alloc+0x1a8/0x2a0 net/core/sock.c:2078 sk_alloc+0x36/0xb90 net/core/sock.c:2131 __netlink_create+0x63/0x380 net/netlink/af_netlink.c:647 netlink_create+0x3dc/0x670 net/netlink/af_netlink.c:712 __sock_create+0x32e/0x800 net/socket.c:1571 sock_create net/socket.c:1622 [inline] __sys_socket_create net/socket.c:1659 [inline] __sys_socket+0x150/0x260 net/socket.c:1706 __do_sys_socket net/socket.c:1720 [inline] __se_sys_socket net/socket.c:1718 [inline] __x64_sys_socket+0x72/0xb0 net/socket.c:1718 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xd5/0x270 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x6f/0x77 page last free pid 5039 tgid 5039 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+0x527/0xb10 mm/page_alloc.c:2346 free_unref_page+0x33/0x3c0 mm/page_alloc.c:2486 __put_partials+0x14c/0x170 mm/slub.c:2922 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x4e/0x140 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x192/0x1e0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:322 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+0x136/0x320 mm/slub.c:3867 getname_flags.part.0+0x50/0x4f0 fs/namei.c:140 getname_flags include/linux/audit.h:322 [inline] getname+0x90/0xe0 fs/namei.c:219 do_sys_openat2+0x104/0x1e0 fs/open.c:1398 do_sys_open fs/open.c:1419 [inline] __do_sys_openat fs/open.c:1435 [inline] __se_sys_openat fs/open.c:1430 [inline] __x64_sys_openat+0x175/0x210 fs/open.c:1430 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xd5/0x270 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x6f/0x77 Memory state around the buggy address: ffff88801fe54f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88801fe55000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88801fe55080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88801fe55100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88801fe55180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================