================================================================== BUG: KASAN: slab-use-after-free in __lock_acquire+0x3ffd/0x5df0 kernel/locking/lockdep.c:4942 Read of size 8 at addr ffff888027508a00 by task syz-executor341/5731 CPU: 1 PID: 5731 Comm: syz-executor341 Not tainted 6.4.0-rc2-syzkaller-00015-g1b66c114d161 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/28/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106 print_address_description.constprop.0+0x2c/0x3c0 mm/kasan/report.c:351 print_report mm/kasan/report.c:462 [inline] kasan_report+0x11c/0x130 mm/kasan/report.c:572 __lock_acquire+0x3ffd/0x5df0 kernel/locking/lockdep.c:4942 lock_acquire kernel/locking/lockdep.c:5691 [inline] lock_acquire+0x1b1/0x520 kernel/locking/lockdep.c:5656 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x3d/0x60 kernel/locking/spinlock.c:162 try_to_wake_up+0xab/0x1c40 kernel/sched/core.c:4191 call_timer_fn+0x1a0/0x580 kernel/time/timer.c:1700 expire_timers+0x29b/0x4b0 kernel/time/timer.c:1751 __run_timers kernel/time/timer.c:2022 [inline] __run_timers kernel/time/timer.c:1995 [inline] run_timer_softirq+0x326/0x910 kernel/time/timer.c:2035 __do_softirq+0x1d4/0x905 kernel/softirq.c:571 invoke_softirq kernel/softirq.c:445 [inline] __irq_exit_rcu+0x114/0x190 kernel/softirq.c:650 irq_exit_rcu+0x9/0x20 kernel/softirq.c:662 sysvec_apic_timer_interrupt+0x97/0xc0 arch/x86/kernel/apic/apic.c:1106 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:645 RIP: 0010:__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline] RIP: 0010:_raw_spin_unlock_irqrestore+0x3c/0x70 kernel/locking/spinlock.c:194 Code: 74 24 10 e8 f6 fa 52 f7 48 89 ef e8 1e 69 53 f7 81 e3 00 02 00 00 75 25 9c 58 f6 c4 02 75 2d 48 85 db 74 01 fb bf 01 00 00 00 df 3f 45 f7 65 8b 05 00 d2 f0 75 85 c0 74 0a 5b 5d c3 e8 6c f5 RSP: 0018:ffffc9000540f4a0 EFLAGS: 00000206 RAX: 0000000000000006 RBX: 0000000000000200 RCX: 1ffffffff22ae966 RDX: 0000000000000000 RSI: 0000000000000002 RDI: 0000000000000001 RBP: ffff888014af36c0 R08: 0000000000000001 R09: ffffffff91528dcf R10: 0000000000000001 R11: 0000000000000000 R12: ffff888014af36c0 R13: ffff888014ef2c80 R14: ffff8880227cadc0 R15: ffff888014e838c0 spin_unlock_irqrestore include/linux/spinlock.h:405 [inline] get_partial_node.part.0+0x209/0x3d0 mm/slub.c:2307 get_partial_node mm/slub.c:2267 [inline] get_partial mm/slub.c:2385 [inline] ___slab_alloc+0xcd7/0x1400 mm/slub.c:3187 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3291 __slab_alloc_node mm/slub.c:3344 [inline] slab_alloc_node mm/slub.c:3441 [inline] slab_alloc mm/slub.c:3459 [inline] __kmem_cache_alloc_lru mm/slub.c:3466 [inline] kmem_cache_alloc+0x38e/0x3b0 mm/slub.c:3475 mempool_alloc+0x158/0x360 mm/mempool.c:398 bio_alloc_bioset+0x41e/0x900 block/bio.c:543 bio_alloc include/linux/bio.h:427 [inline] submit_bh_wbc+0x281/0x650 fs/buffer.c:2757 submit_bh fs/buffer.c:2782 [inline] __bh_read+0xa7/0x1f0 fs/buffer.c:3047 bh_readahead include/linux/buffer_head.h:427 [inline] __breadahead+0xf9/0x160 fs/buffer.c:1394 nilfs_search_super_root+0xea6/0x14b0 fs/nilfs2/recovery.c:871 load_nilfs+0x101e/0x1340 fs/nilfs2/the_nilfs.c:296 nilfs_fill_super fs/nilfs2/super.c:1069 [inline] nilfs_mount+0xb52/0x1160 fs/nilfs2/super.c:1326 legacy_get_tree+0x109/0x220 fs/fs_context.c:610 vfs_get_tree+0x8d/0x350 fs/super.c:1510 do_new_mount fs/namespace.c:3039 [inline] path_mount+0x134b/0x1e40 fs/namespace.c:3369 do_mount fs/namespace.c:3382 [inline] __do_sys_mount fs/namespace.c:3591 [inline] __se_sys_mount fs/namespace.c:3568 [inline] __x64_sys_mount+0x283/0x300 fs/namespace.c:3568 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f5dc0360faa Code: 48 c7 c2 c0 ff ff ff f7 d8 64 89 02 b8 ff ff ff ff eb d2 e8 a8 00 00 00 0f 1f 84 00 00 00 00 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffec904ca98 EFLAGS: 00000286 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007f5dc0360faa RDX: 0000000020000dc0 RSI: 0000000020000100 RDI: 00007ffec904cab0 RBP: 00007ffec904cab0 R08: 00007ffec904caf0 R09: 0000000000000da0 R10: 0000000000010018 R11: 0000000000000286 R12: 0000000000000004 R13: 0000555555ac42c0 R14: 0000000000010018 R15: 00007ffec904caf0 Allocated by task 2: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 __kasan_slab_alloc+0x7f/0x90 mm/kasan/common.c:328 kasan_slab_alloc include/linux/kasan.h:186 [inline] slab_post_alloc_hook mm/slab.h:711 [inline] slab_alloc_node mm/slub.c:3451 [inline] kmem_cache_alloc_node+0x185/0x3e0 mm/slub.c:3496 alloc_task_struct_node kernel/fork.c:173 [inline] dup_task_struct kernel/fork.c:1108 [inline] copy_process+0x3c0/0x7600 kernel/fork.c:2333 kernel_clone+0xeb/0x890 kernel/fork.c:2918 kernel_thread+0xc0/0x100 kernel/fork.c:2980 create_kthread kernel/kthread.c:402 [inline] kthreadd+0x50c/0x790 kernel/kthread.c:737 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Last potentially related work creation: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:491 __call_rcu_common.constprop.0+0x99/0x7e0 kernel/rcu/tree.c:2627 put_task_struct_rcu_user+0x87/0xc0 kernel/exit.c:232 context_switch kernel/sched/core.c:5346 [inline] __schedule+0xca2/0x5880 kernel/sched/core.c:6669 preempt_schedule_common+0x45/0xb0 kernel/sched/core.c:6838 preempt_schedule_thunk+0x1a/0x20 arch/x86/entry/thunk_64.S:34 __raw_spin_unlock include/linux/spinlock_api_smp.h:143 [inline] _raw_spin_unlock+0x3a/0x40 kernel/locking/spinlock.c:186 spin_unlock include/linux/spinlock.h:390 [inline] fsnotify_add_mark_locked+0x280/0x1470 fs/notify/mark.c:724 fsnotify_add_inode_mark_locked include/linux/fsnotify_backend.h:787 [inline] inotify_new_watch fs/notify/inotify/inotify_user.c:621 [inline] inotify_update_watch+0x9e8/0xc30 fs/notify/inotify/inotify_user.c:648 __do_sys_inotify_add_watch fs/notify/inotify/inotify_user.c:787 [inline] __se_sys_inotify_add_watch fs/notify/inotify/inotify_user.c:730 [inline] __x64_sys_inotify_add_watch+0x2bf/0x350 fs/notify/inotify/inotify_user.c:730 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Second to last potentially related work creation: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:491 __call_rcu_common.constprop.0+0x99/0x7e0 kernel/rcu/tree.c:2627 put_task_struct_rcu_user+0x87/0xc0 kernel/exit.c:232 context_switch kernel/sched/core.c:5346 [inline] __schedule+0xca2/0x5880 kernel/sched/core.c:6669 schedule+0xde/0x1a0 kernel/sched/core.c:6745 do_wait+0x6fc/0xc30 kernel/exit.c:1633 kernel_wait4+0x150/0x260 kernel/exit.c:1777 __do_sys_wait4+0x13f/0x150 kernel/exit.c:1805 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff888027508000 which belongs to the cache task_struct of size 7360 The buggy address is located 2560 bytes inside of freed 7360-byte region [ffff888027508000, ffff888027509cc0) The buggy address belongs to the physical page: page:ffffea00009d4200 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888027509dc0 pfn:0x27508 head:ffffea00009d4200 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000010200 ffff888140007500 ffffea00007f2c10 ffffea0000925a10 raw: ffff888027509dc0 0000000000040002 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 12, tgid 12 (kworker/u4:1), ts 7435077998, free_ts 0 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2db/0x350 mm/page_alloc.c:1731 prep_new_page mm/page_alloc.c:1738 [inline] get_page_from_freelist+0xf41/0x2c00 mm/page_alloc.c:3502 __alloc_pages+0x1cb/0x4a0 mm/page_alloc.c:4768 alloc_pages+0x1aa/0x270 mm/mempolicy.c:2279 alloc_slab_page mm/slub.c:1851 [inline] allocate_slab+0x25f/0x390 mm/slub.c:1998 new_slab mm/slub.c:2051 [inline] ___slab_alloc+0xa91/0x1400 mm/slub.c:3192 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3291 __slab_alloc_node mm/slub.c:3344 [inline] slab_alloc_node mm/slub.c:3441 [inline] kmem_cache_alloc_node+0x138/0x3e0 mm/slub.c:3496 alloc_task_struct_node kernel/fork.c:173 [inline] dup_task_struct kernel/fork.c:1108 [inline] copy_process+0x3c0/0x7600 kernel/fork.c:2333 kernel_clone+0xeb/0x890 kernel/fork.c:2918 user_mode_thread+0xb1/0xf0 kernel/fork.c:2996 call_usermodehelper_exec_work kernel/umh.c:172 [inline] call_usermodehelper_exec_work+0xd0/0x180 kernel/umh.c:158 process_one_work+0x99a/0x15e0 kernel/workqueue.c:2405 worker_thread+0x67d/0x10c0 kernel/workqueue.c:2552 kthread+0x344/0x440 kernel/kthread.c:379 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 page_owner free stack trace missing Memory state around the buggy address: ffff888027508900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888027508980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888027508a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888027508a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888027508b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: 74 24 je 0x26 2: 10 e8 adc %ch,%al 4: f6 fa idiv %dl 6: 52 push %rdx 7: f7 48 89 ef e8 1e 69 testl $0x691ee8ef,-0x77(%rax) e: 53 push %rbx f: f7 81 e3 00 02 00 00 testl $0x9c257500,0x200e3(%rcx) 16: 75 25 9c 19: 58 pop %rax 1a: f6 c4 02 test $0x2,%ah 1d: 75 2d jne 0x4c 1f: 48 85 db test %rbx,%rbx 22: 74 01 je 0x25 24: fb sti 25: bf 01 00 00 00 mov $0x1,%edi * 2a: e8 df 3f 45 f7 callq 0xf745400e <-- trapping instruction 2f: 65 8b 05 00 d2 f0 75 mov %gs:0x75f0d200(%rip),%eax # 0x75f0d236 36: 85 c0 test %eax,%eax 38: 74 0a je 0x44 3a: 5b pop %rbx 3b: 5d pop %rbp 3c: c3 retq 3d: e8 .byte 0xe8 3e: 6c insb (%dx),%es:(%rdi) 3f: f5 cmc