================================================================== BUG: KASAN: slab-use-after-free in udf_close_lvid+0x508/0x5c0 fs/udf/super.c:2035 Write of size 1 at addr ffff88808609da38 by task syz-executor.2/7142 CPU: 1 PID: 7142 Comm: syz-executor.2 Not tainted 6.5.0-rc6-syzkaller-00253-g9e6c269de404 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/2023 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:364 [inline] print_report+0xc4/0x620 mm/kasan/report.c:475 kasan_report+0xda/0x110 mm/kasan/report.c:588 udf_close_lvid+0x508/0x5c0 fs/udf/super.c:2035 udf_put_super+0x19c/0x200 fs/udf/super.c:2322 generic_shutdown_super+0x158/0x480 fs/super.c:499 kill_block_super+0x64/0xb0 fs/super.c:1417 deactivate_locked_super+0x9a/0x170 fs/super.c:330 deactivate_super+0xde/0x100 fs/super.c:361 cleanup_mnt+0x222/0x3d0 fs/namespace.c:1254 task_work_run+0x14d/0x240 kernel/task_work.c:179 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0xa99/0x2a20 kernel/exit.c:874 do_group_exit+0xd4/0x2a0 kernel/exit.c:1024 get_signal+0x23ea/0x2770 kernel/signal.c:2881 arch_do_signal_or_restart+0x89/0x5f0 arch/x86/kernel/signal.c:308 exit_to_user_mode_loop kernel/entry/common.c:168 [inline] exit_to_user_mode_prepare+0x11f/0x240 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline] syscall_exit_to_user_mode+0x1d/0x60 kernel/entry/common.c:297 do_syscall_64+0x44/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f5619aa7ef5 Code: Unable to access opcode bytes at 0x7f5619aa7ecb. RSP: 002b:00007f561a8b3010 EFLAGS: 00000293 ORIG_RAX: 00000000000000e6 RAX: fffffffffffffdfc RBX: 00007f5619b9bf80 RCX: 00007f5619aa7ef5 RDX: 00007f561a8b3050 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 00007f5619ac847a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000000 R13: 000000000000000b R14: 00007f5619b9bf80 R15: 00007fff3d64f0c8 Allocated by task 2: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 __kasan_slab_alloc+0x81/0x90 mm/kasan/common.c:328 kasan_slab_alloc include/linux/kasan.h:186 [inline] slab_post_alloc_hook mm/slab.h:762 [inline] slab_alloc_node mm/slab.c:3237 [inline] kmem_cache_alloc_node+0x179/0x540 mm/slab.c:3509 alloc_task_struct_node kernel/fork.c:173 [inline] dup_task_struct kernel/fork.c:1105 [inline] copy_process+0x41c/0x7400 kernel/fork.c:2330 kernel_clone+0xfd/0x8f0 kernel/fork.c:2912 kernel_thread+0xc0/0x100 kernel/fork.c:2974 create_kthread kernel/kthread.c:412 [inline] kthreadd+0x4fc/0x7b0 kernel/kthread.c:747 ret_from_fork+0x2c/0x70 arch/x86/kernel/process.c:145 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 Freed by task 6124: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x28/0x40 mm/kasan/generic.c:522 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x13f/0x190 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:162 [inline] __cache_free mm/slab.c:3370 [inline] __do_kmem_cache_free mm/slab.c:3557 [inline] kmem_cache_free+0x104/0x380 mm/slab.c:3582 put_task_struct include/linux/sched/task.h:125 [inline] delayed_put_task_struct+0x1f5/0x280 kernel/exit.c:226 rcu_do_batch kernel/rcu/tree.c:2135 [inline] rcu_core+0x7fb/0x1bb0 kernel/rcu/tree.c:2399 __do_softirq+0x218/0x965 kernel/softirq.c:553 Last potentially related work creation: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 __kasan_record_aux_stack+0x78/0x80 mm/kasan/generic.c:492 __call_rcu_common.constprop.0+0x9a/0x790 kernel/rcu/tree.c:2649 put_task_struct_rcu_user kernel/exit.c:232 [inline] put_task_struct_rcu_user+0x87/0xc0 kernel/exit.c:229 context_switch kernel/sched/core.c:5384 [inline] __schedule+0xee9/0x59f0 kernel/sched/core.c:6710 preempt_schedule_common+0x45/0xc0 kernel/sched/core.c:6879 preempt_schedule_thunk+0x1a/0x30 arch/x86/entry/thunk_64.S:45 try_to_wake_up+0x98f/0x15a0 kernel/sched/core.c:4351 kthread_stop+0x185/0x5b0 kernel/kthread.c:709 destroy_workqueue+0x15a/0x8d0 kernel/workqueue.c:4770 ext4_put_super+0x111/0xe80 fs/ext4/super.c:1297 generic_shutdown_super+0x158/0x480 fs/super.c:499 kill_block_super+0x64/0xb0 fs/super.c:1417 deactivate_locked_super+0x9a/0x170 fs/super.c:330 deactivate_super+0xde/0x100 fs/super.c:361 cleanup_mnt+0x222/0x3d0 fs/namespace.c:1254 task_work_run+0x14d/0x240 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop kernel/entry/common.c:171 [inline] exit_to_user_mode_prepare+0x210/0x240 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline] syscall_exit_to_user_mode+0x1d/0x60 kernel/entry/common.c:297 do_syscall_64+0x44/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd Second to last potentially related work creation: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 __kasan_record_aux_stack+0x78/0x80 mm/kasan/generic.c:492 __call_rcu_common.constprop.0+0x9a/0x790 kernel/rcu/tree.c:2649 put_task_struct_rcu_user kernel/exit.c:232 [inline] put_task_struct_rcu_user+0x87/0xc0 kernel/exit.c:229 release_task+0xf0a/0x1b90 kernel/exit.c:282 wait_task_zombie kernel/exit.c:1210 [inline] wait_consider_task+0x17c9/0x3f70 kernel/exit.c:1437 do_wait_thread kernel/exit.c:1500 [inline] do_wait+0x72b/0xc70 kernel/exit.c:1617 kernel_wait4+0x16d/0x280 kernel/exit.c:1780 __do_sys_wait4+0x15b/0x170 kernel/exit.c:1808 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff88808609c180 which belongs to the cache task_struct of size 7360 The buggy address is located 6328 bytes inside of freed 7360-byte region [ffff88808609c180, ffff88808609de40) The buggy address belongs to the physical page: page:ffffea0002182700 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x8609c head:ffffea0002182700 order:1 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff8880787ad101 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0x1() raw: 00fff00000010200 ffff888140051500 ffffea0000fcdf10 ffffea0002026690 raw: 0000000000000000 ffff88808609c180 0000000100000001 ffff8880787ad101 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 1, migratetype Unmovable, gfp_mask 0x3420c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_COMP|__GFP_HARDWALL|__GFP_THISNODE), pid 5307, tgid 5307 (syz-executor.1), ts 3027946189298, free_ts 3027931632296 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2d2/0x350 mm/page_alloc.c:1570 prep_new_page mm/page_alloc.c:1577 [inline] get_page_from_freelist+0x10a9/0x31e0 mm/page_alloc.c:3221 __alloc_pages+0x1d0/0x4a0 mm/page_alloc.c:4477 __alloc_pages_node include/linux/gfp.h:237 [inline] kmem_getpages mm/slab.c:1356 [inline] cache_grow_begin+0x99/0x3a0 mm/slab.c:2550 cache_alloc_refill+0x294/0x3a0 mm/slab.c:2923 ____cache_alloc mm/slab.c:2999 [inline] ____cache_alloc mm/slab.c:2982 [inline] __do_cache_alloc mm/slab.c:3182 [inline] slab_alloc_node mm/slab.c:3230 [inline] kmem_cache_alloc_node+0x487/0x540 mm/slab.c:3509 alloc_task_struct_node kernel/fork.c:173 [inline] dup_task_struct kernel/fork.c:1105 [inline] copy_process+0x41c/0x7400 kernel/fork.c:2330 kernel_clone+0xfd/0x8f0 kernel/fork.c:2912 __do_sys_clone+0xba/0x100 kernel/fork.c:3055 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1161 [inline] free_unref_page_prepare+0x508/0xb90 mm/page_alloc.c:2348 free_unref_page+0x33/0x3b0 mm/page_alloc.c:2443 slab_destroy mm/slab.c:1608 [inline] slabs_destroy+0x85/0xc0 mm/slab.c:1628 cache_flusharray mm/slab.c:3341 [inline] ___cache_free+0x2b6/0x420 mm/slab.c:3404 qlink_free mm/kasan/quarantine.c:166 [inline] qlist_free_all+0x4c/0x1b0 mm/kasan/quarantine.c:185 kasan_quarantine_reduce+0x18b/0x1d0 mm/kasan/quarantine.c:292 __kasan_slab_alloc+0x65/0x90 mm/kasan/common.c:305 kasan_slab_alloc include/linux/kasan.h:186 [inline] slab_post_alloc_hook mm/slab.h:762 [inline] slab_alloc_node mm/slab.c:3237 [inline] slab_alloc mm/slab.c:3246 [inline] __kmem_cache_alloc_lru mm/slab.c:3423 [inline] kmem_cache_alloc+0x15e/0x400 mm/slab.c:3432 getname_flags.part.0+0x50/0x4d0 fs/namei.c:140 getname_flags+0x9c/0xf0 include/linux/audit.h:319 user_path_at_empty+0x2c/0x60 fs/namei.c:2906 do_readlinkat+0xdd/0x2f0 fs/stat.c:477 __do_sys_readlink fs/stat.c:510 [inline] __se_sys_readlink fs/stat.c:507 [inline] __x64_sys_readlink+0x78/0xb0 fs/stat.c:507 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Memory state around the buggy address: ffff88808609d900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88808609d980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88808609da00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88808609da80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88808609db00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================