================================================================== 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 ffff8880390c6080 by task kworker/0:7/5153 CPU: 0 PID: 5153 Comm: kworker/0:7 Not tainted 6.8.0-rc6-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/25/2024 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+0x889/0x15e0 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 5153: 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:372 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:389 kasan_kmalloc include/linux/kasan.h:211 [inline] __do_kmalloc_node mm/slub.c:3981 [inline] __kmalloc_node_track_caller+0x219/0x460 mm/slub.c:4001 kmalloc_reserve+0xef/0x260 net/core/skbuff.c:582 __alloc_skb+0x12b/0x330 net/core/skbuff.c:651 alloc_skb include/linux/skbuff.h:1296 [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+0x2a4/0xc80 drivers/net/netdevsim/dev.c:850 process_one_work+0x889/0x15e0 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 Freed by task 5153: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3f/0x60 mm/kasan/generic.c:643 poison_slab_object mm/kasan/common.c:241 [inline] __kasan_slab_free+0x121/0x1c0 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+0x124/0x370 mm/slub.c:4409 skb_kfree_head net/core/skbuff.c:986 [inline] skb_free_head+0x110/0x1b0 net/core/skbuff.c:998 skb_release_data+0x5c0/0x880 net/core/skbuff.c:1028 skb_release_all net/core/skbuff.c:1094 [inline] __kfree_skb net/core/skbuff.c:1108 [inline] consume_skb net/core/skbuff.c:1324 [inline] consume_skb+0xd2/0x170 net/core/skbuff.c:1318 nsim_dev_trap_report drivers/net/netdevsim/dev.c:821 [inline] nsim_dev_trap_report_work+0x878/0xc80 drivers/net/netdevsim/dev.c:850 process_one_work+0x889/0x15e0 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 The buggy address belongs to the object at ffff8880390c6000 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 128 bytes inside of freed 4096-byte region [ffff8880390c6000, ffff8880390c7000) The buggy address belongs to the physical page: page:ffffea0000e43000 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x390c0 head:ffffea0000e43000 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000840 ffff888014c42140 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000040004 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 0x1d2040(__GFP_IO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 5088, tgid 5088 (syz-executor.4), ts 553962280693, free_ts 553851858223 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+0x22f/0x2440 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 mm/slub.c:2190 [inline] allocate_slab mm/slub.c:2354 [inline] new_slab+0xcc/0x3a0 mm/slub.c:2407 ___slab_alloc+0x4af/0x19a0 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] tomoyo_realpath_from_path+0xb9/0x720 security/tomoyo/realpath.c:251 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_number_perm+0x245/0x590 security/tomoyo/file.c:723 tomoyo_path_mkdir+0x9c/0xe0 security/tomoyo/tomoyo.c:179 security_path_mkdir+0x111/0x170 security/security.c:1819 do_mkdirat+0x176/0x3a0 fs/namei.c:4146 __do_sys_mkdirat fs/namei.c:4164 [inline] __se_sys_mkdirat fs/namei.c:4162 [inline] __x64_sys_mkdirat+0x115/0x170 fs/namei.c:4162 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 5100 tgid 5100 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:160 [inline] qlist_free_all+0x58/0x150 mm/kasan/quarantine.c:176 kasan_quarantine_reduce+0x192/0x1e0 mm/kasan/quarantine.c:283 __kasan_slab_alloc+0x69/0x90 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+0x136/0x320 mm/slub.c:3867 getname_flags.part.0+0x50/0x4f0 fs/namei.c:140 getname_flags+0x9c/0xf0 include/linux/audit.h:322 user_path_at_empty+0x2c/0x60 fs/namei.c:2923 user_path_at include/linux/namei.h:57 [inline] ksys_umount fs/namespace.c:1916 [inline] __do_sys_umount fs/namespace.c:1924 [inline] __se_sys_umount fs/namespace.c:1922 [inline] __x64_sys_umount+0x10e/0x1a0 fs/namespace.c:1922 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: ffff8880390c5f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880390c6000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880390c6080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880390c6100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880390c6180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================