================================================================== BUG: KASAN: use-after-free in mutex_can_spin_on_owner kernel/locking/mutex.c:617 [inline] BUG: KASAN: use-after-free in mutex_optimistic_spin kernel/locking/mutex.c:661 [inline] BUG: KASAN: use-after-free in __mutex_lock_common kernel/locking/mutex.c:973 [inline] BUG: KASAN: use-after-free in __mutex_lock+0xace/0xe30 kernel/locking/mutex.c:1114 Read of size 4 at addr ffff8881f00e1fb8 by task syz-executor/358 CPU: 0 PID: 358 Comm: syz-executor Not tainted 5.4.292-syzkaller-00021-gcd8e74fa0fa3 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025 Call Trace: __dump_stack+0x1e/0x20 lib/dump_stack.c:77 dump_stack+0x15b/0x1b8 lib/dump_stack.c:118 print_address_description+0x8d/0x4c0 mm/kasan/report.c:384 __kasan_report+0xef/0x120 mm/kasan/report.c:516 kasan_report+0x30/0x60 mm/kasan/common.c:653 __asan_report_load4_noabort+0x14/0x20 mm/kasan/generic_report.c:131 mutex_can_spin_on_owner kernel/locking/mutex.c:617 [inline] mutex_optimistic_spin kernel/locking/mutex.c:661 [inline] __mutex_lock_common kernel/locking/mutex.c:973 [inline] __mutex_lock+0xace/0xe30 kernel/locking/mutex.c:1114 __mutex_lock_killable_slowpath+0xe/0x10 kernel/locking/mutex.c:1381 mutex_lock_killable+0xd3/0xe0 kernel/locking/mutex.c:1348 lo_open+0x1d/0xc0 drivers/block/loop.c:1899 __blkdev_get+0x610/0x1560 fs/block_dev.c:1581 blkdev_get+0x68/0x380 fs/block_dev.c:1714 blkdev_open+0x1cb/0x2b0 fs/block_dev.c:1856 do_dentry_open+0x8b5/0x1030 fs/open.c:806 vfs_open+0x73/0x80 fs/open.c:920 do_last fs/namei.c:3565 [inline] path_openat+0x2a5e/0x35c0 fs/namei.c:3683 do_filp_open+0x1ae/0x3f0 fs/namei.c:3713 do_sys_open+0x2bb/0x5d0 fs/open.c:1123 __do_sys_openat fs/open.c:1150 [inline] __se_sys_openat fs/open.c:1144 [inline] __x64_sys_openat+0xa2/0xb0 fs/open.c:1144 do_syscall_64+0xcf/0x170 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 RIP: 0033:0x7fc8301be251 Code: 75 57 89 f0 25 00 00 41 00 3d 00 00 41 00 74 49 80 3d fa 72 1f 00 00 74 6d 89 da 48 89 ee bf 9c ff ff ff b8 01 01 00 00 0f 05 <48> 3d 00 f0 ff ff 0f 87 93 00 00 00 48 8b 54 24 28 64 48 2b 14 25 RSP: 002b:00007ffdb83b9e60 EFLAGS: 00000202 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 0000000000000002 RCX: 00007fc8301be251 RDX: 0000000000000002 RSI: 00007ffdb83b9f70 RDI: 00000000ffffff9c RBP: 00007ffdb83b9f70 R08: 000000000000000a R09: 00007ffdb83b9c27 R10: 0000000000000000 R11: 0000000000000202 R12: 000000000000001c R13: 0000000000000051 R14: 000000000000c5ac R15: 00007ffdb83b9f70 Allocated by task 1152: save_stack mm/kasan/common.c:70 [inline] set_track mm/kasan/common.c:78 [inline] __kasan_kmalloc+0x162/0x200 mm/kasan/common.c:529 kasan_slab_alloc+0x12/0x20 mm/kasan/common.c:537 slab_post_alloc_hook mm/slab.h:584 [inline] slab_alloc_node mm/slub.c:2829 [inline] slab_alloc mm/slub.c:2837 [inline] kmem_cache_alloc+0xe2/0x270 mm/slub.c:2842 kmem_cache_alloc_node include/linux/slab.h:427 [inline] alloc_task_struct_node kernel/fork.c:171 [inline] dup_task_struct+0x57/0x640 kernel/fork.c:882 copy_process+0x503/0x2cf0 kernel/fork.c:1889 _do_fork+0x190/0x860 kernel/fork.c:2399 __do_sys_clone3 kernel/fork.c:2688 [inline] __se_sys_clone3 kernel/fork.c:2675 [inline] __x64_sys_clone3+0x1de/0x1f0 kernel/fork.c:2675 do_syscall_64+0xcf/0x170 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 Freed by task 17: save_stack mm/kasan/common.c:70 [inline] set_track mm/kasan/common.c:78 [inline] kasan_set_free_info mm/kasan/common.c:345 [inline] __kasan_slab_free+0x1c3/0x280 mm/kasan/common.c:487 kasan_slab_free+0xe/0x10 mm/kasan/common.c:496 slab_free_hook mm/slub.c:1455 [inline] slab_free_freelist_hook+0xb7/0x180 mm/slub.c:1494 slab_free mm/slub.c:3080 [inline] kmem_cache_free+0x10c/0x2c0 mm/slub.c:3096 free_task_struct kernel/fork.c:176 [inline] free_task+0xe9/0x150 kernel/fork.c:480 __put_task_struct+0x2b7/0x420 kernel/fork.c:755 put_task_struct include/linux/sched/task.h:147 [inline] delayed_put_task_struct+0x71/0x210 kernel/exit.c:229 __rcu_reclaim kernel/rcu/rcu.h:222 [inline] rcu_do_batch+0x446/0x980 kernel/rcu/tree.c:2167 rcu_core+0x4bd/0xbd0 kernel/rcu/tree.c:2387 rcu_core_si+0x9/0x10 kernel/rcu/tree.c:2396 __do_softirq+0x236/0x660 kernel/softirq.c:292 The buggy address belongs to the object at ffff8881f00e1f80 which belongs to the cache task_struct of size 3904 The buggy address is located 56 bytes inside of 3904-byte region [ffff8881f00e1f80, ffff8881f00e2ec0) The buggy address belongs to the page: page:ffffea0007c03800 refcount:1 mapcount:0 mapping:ffff8881f5cf4280 index:0x0 compound_mapcount: 0 flags: 0x8000000000010200(slab|head) raw: 8000000000010200 dead000000000100 dead000000000122 ffff8881f5cf4280 raw: 0000000000000000 0000000080080008 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 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL) set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook mm/page_alloc.c:2165 [inline] prep_new_page+0x35e/0x370 mm/page_alloc.c:2171 get_page_from_freelist+0x1296/0x1310 mm/page_alloc.c:3794 __alloc_pages_nodemask+0x202/0x4b0 mm/page_alloc.c:4894 alloc_slab_page+0x3c/0x3b0 mm/slub.c:343 allocate_slab mm/slub.c:1683 [inline] new_slab+0x93/0x420 mm/slub.c:1749 new_slab_objects mm/slub.c:2505 [inline] ___slab_alloc+0x29e/0x420 mm/slub.c:2667 __slab_alloc+0x63/0xa0 mm/slub.c:2707 slab_alloc_node mm/slub.c:2792 [inline] slab_alloc mm/slub.c:2837 [inline] kmem_cache_alloc+0x12c/0x270 mm/slub.c:2842 kmem_cache_alloc_node include/linux/slab.h:427 [inline] alloc_task_struct_node kernel/fork.c:171 [inline] dup_task_struct+0x57/0x640 kernel/fork.c:882 copy_process+0x503/0x2cf0 kernel/fork.c:1889 _do_fork+0x190/0x860 kernel/fork.c:2399 __do_sys_clone3 kernel/fork.c:2688 [inline] __se_sys_clone3 kernel/fork.c:2675 [inline] __x64_sys_clone3+0x1de/0x1f0 kernel/fork.c:2675 do_syscall_64+0xcf/0x170 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1176 [inline] __free_pages_ok+0x7e4/0x910 mm/page_alloc.c:1438 free_compound_page+0x69/0x90 mm/page_alloc.c:687 __put_compound_page mm/swap.c:97 [inline] __put_page+0xf8/0x120 mm/swap.c:113 put_page include/linux/mm.h:1153 [inline] __skb_frag_unref include/linux/skbuff.h:3062 [inline] skb_release_data+0x210/0x610 net/core/skbuff.c:615 skb_release_all net/core/skbuff.c:675 [inline] __kfree_skb+0x50/0x70 net/core/skbuff.c:689 sk_eat_skb include/net/sock.h:2568 [inline] tcp_recvmsg+0x1480/0x2d50 net/ipv4/tcp.c:2183 inet_recvmsg+0x134/0x480 net/ipv4/af_inet.c:851 sock_recvmsg_nosec net/socket.c:891 [inline] sock_recvmsg net/socket.c:909 [inline] sock_read_iter+0x2a8/0x350 net/socket.c:987 call_read_iter include/linux/fs.h:1985 [inline] new_sync_read fs/read_write.c:414 [inline] __vfs_read+0x47d/0x5c0 fs/read_write.c:427 vfs_read+0x15a/0x370 fs/read_write.c:461 ksys_read+0x140/0x240 fs/read_write.c:587 __do_sys_read fs/read_write.c:597 [inline] __se_sys_read fs/read_write.c:595 [inline] __x64_sys_read+0x7b/0x90 fs/read_write.c:595 do_syscall_64+0xcf/0x170 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 Memory state around the buggy address: ffff8881f00e1e80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8881f00e1f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8881f00e1f80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881f00e2000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881f00e2080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================