================================================================== BUG: KASAN: use-after-free in instrument_atomic_read_write include/linux/instrumented.h:96 [inline] BUG: KASAN: use-after-free in atomic_fetch_add_relaxed include/linux/atomic/atomic-instrumented.h:252 [inline] BUG: KASAN: use-after-free in __refcount_add include/linux/refcount.h:184 [inline] BUG: KASAN: use-after-free in __refcount_inc include/linux/refcount.h:241 [inline] BUG: KASAN: use-after-free in refcount_inc include/linux/refcount.h:258 [inline] BUG: KASAN: use-after-free in sock_hold include/net/sock.h:774 [inline] BUG: KASAN: use-after-free in sco_sock_timeout+0x67/0x240 net/bluetooth/sco.c:88 Write of size 4 at addr ffff88806c55b080 by task kworker/0:6/5157 CPU: 0 PID: 5157 Comm: kworker/0:6 Not tainted 6.9.0-rc3-next-20240409-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 Workqueue: events sco_sock_timeout Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114 print_address_description mm/kasan/report.c:377 [inline] print_report+0x169/0x550 mm/kasan/report.c:488 kasan_report+0x143/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:184 [inline] __refcount_inc include/linux/refcount.h:241 [inline] refcount_inc include/linux/refcount.h:258 [inline] sock_hold include/net/sock.h:774 [inline] sco_sock_timeout+0x67/0x240 net/bluetooth/sco.c:88 process_one_work kernel/workqueue.c:3218 [inline] process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3299 worker_thread+0x86d/0xd70 kernel/workqueue.c:3380 kthread+0x2f0/0x390 kernel/kthread.c:388 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:243 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x6c55b flags: 0xfff80000000000(node=0|zone=1|lastcpupid=0xfff) raw: 00fff80000000000 0000000000000000 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 3, migratetype Unmovable, gfp_mask 0x1d2820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 5154, tgid -1828181360 (kworker/0:4), ts 5154, free_ts 416842471016 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1468 prep_new_page mm/page_alloc.c:1476 [inline] get_page_from_freelist+0x2ce2/0x2d90 mm/page_alloc.c:3438 __alloc_pages_noprof+0x256/0x6c0 mm/page_alloc.c:4696 __alloc_pages_node_noprof include/linux/gfp.h:244 [inline] alloc_pages_node_noprof include/linux/gfp.h:271 [inline] alloc_slab_page+0x5f/0x120 mm/slub.c:2259 allocate_slab+0x5a/0x2e0 mm/slub.c:2422 new_slab mm/slub.c:2475 [inline] ___slab_alloc+0xcd1/0x14b0 mm/slub.c:3624 __slab_alloc+0x58/0xa0 mm/slub.c:3714 __slab_alloc_node mm/slub.c:3767 [inline] slab_alloc_node mm/slub.c:3945 [inline] __do_kmalloc_node mm/slub.c:4077 [inline] kmalloc_node_track_caller_noprof+0x286/0x440 mm/slub.c:4098 kmalloc_reserve+0x111/0x2a0 net/core/skbuff.c:599 __alloc_skb+0x1f3/0x440 net/core/skbuff.c:668 alloc_skb include/linux/skbuff.h:1313 [inline] nsim_dev_trap_skb_build drivers/net/netdevsim/dev.c:748 [inline] nsim_dev_trap_report drivers/net/netdevsim/dev.c:805 [inline] nsim_dev_trap_report_work+0x254/0xaa0 drivers/net/netdevsim/dev.c:850 process_one_work kernel/workqueue.c:3218 [inline] process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3299 worker_thread+0x86d/0xd70 kernel/workqueue.c:3380 kthread+0x2f0/0x390 kernel/kthread.c:388 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:243 page last free pid 8668 tgid 8668 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1088 [inline] free_unref_page+0xd22/0xea0 mm/page_alloc.c:2601 discard_slab mm/slub.c:2521 [inline] __put_partials+0xeb/0x130 mm/slub.c:2989 put_cpu_partial+0x17c/0x250 mm/slub.c:3064 __slab_free+0x2ea/0x3d0 mm/slub.c:4263 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x9e/0x140 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x14f/0x170 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x23/0x80 mm/kasan/common.c:322 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3897 [inline] slab_alloc_node mm/slub.c:3957 [inline] kmem_cache_alloc_noprof+0x135/0x290 mm/slub.c:3964 vma_lock_alloc kernel/fork.c:441 [inline] vm_area_dup+0x61/0x290 kernel/fork.c:494 dup_mmap kernel/fork.c:697 [inline] dup_mm kernel/fork.c:1687 [inline] copy_mm+0xd0f/0x1fd0 kernel/fork.c:1736 copy_process+0x187a/0x3dc0 kernel/fork.c:2389 kernel_clone+0x226/0x8f0 kernel/fork.c:2796 __do_sys_clone kernel/fork.c:2939 [inline] __se_sys_clone kernel/fork.c:2923 [inline] __x64_sys_clone+0x258/0x2a0 kernel/fork.c:2923 do_syscall_64+0xfb/0x240 entry_SYSCALL_64_after_hwframe+0x72/0x7a Memory state around the buggy address: ffff88806c55af80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88806c55b000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88806c55b080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88806c55b100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88806c55b180: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================