================================================================== BUG: KASAN: slab-use-after-free in task_pgrp include/linux/sched/signal.h:689 [inline] BUG: KASAN: slab-use-after-free in kill_orphaned_pgrp+0x41/0x560 kernel/exit.c:379 Read of size 8 at addr ffff888075c4a708 by task vhost-5633/5635 CPU: 0 PID: 5635 Comm: vhost-5633 Not tainted 6.8.0-syzkaller-08073-g480e035fc4c7 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 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 task_pgrp include/linux/sched/signal.h:689 [inline] kill_orphaned_pgrp+0x41/0x560 kernel/exit.c:379 exit_notify kernel/exit.c:739 [inline] do_exit+0x1673/0x27e0 kernel/exit.c:898 vhost_task_fn+0x2ff/0x320 kernel/vhost_task.c:61 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:243 Allocated by task 5097: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:312 [inline] __kasan_slab_alloc+0x66/0x80 mm/kasan/common.c:338 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3798 [inline] slab_alloc_node mm/slub.c:3845 [inline] kmem_cache_alloc_node+0x194/0x380 mm/slub.c:3888 alloc_task_struct_node kernel/fork.c:176 [inline] dup_task_struct+0x57/0x7d0 kernel/fork.c:1106 copy_process+0x5d1/0x3df0 kernel/fork.c:2219 kernel_clone+0x21e/0x8d0 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+0x6d/0x75 Freed by task 15: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:579 poison_slab_object+0xa6/0xe0 mm/kasan/common.c:240 __kasan_slab_free+0x37/0x60 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2106 [inline] slab_free mm/slub.c:4280 [inline] kmem_cache_free+0x102/0x2b0 mm/slub.c:4344 put_task_struct include/linux/sched/task.h:138 [inline] delayed_put_task_struct+0x115/0x2d0 kernel/exit.c:229 rcu_do_batch kernel/rcu/tree.c:2196 [inline] rcu_core+0xafd/0x1830 kernel/rcu/tree.c:2471 __do_softirq+0x2bc/0x943 kernel/softirq.c:554 Last potentially related work creation: kasan_save_stack+0x3f/0x60 mm/kasan/common.c:47 __kasan_record_aux_stack+0xac/0xc0 mm/kasan/generic.c:541 __call_rcu_common kernel/rcu/tree.c:2734 [inline] call_rcu+0x167/0xa70 kernel/rcu/tree.c:2838 release_task+0x16d2/0x1810 de_thread fs/exec.c:1171 [inline] begin_new_exec+0xfde/0x1ce0 fs/exec.c:1277 load_elf_binary+0x961/0x2590 fs/binfmt_elf.c:996 search_binary_handler fs/exec.c:1777 [inline] exec_binprm fs/exec.c:1819 [inline] bprm_execve+0xaf8/0x1790 fs/exec.c:1871 do_execveat_common+0x553/0x700 fs/exec.c:1978 do_execveat fs/exec.c:2063 [inline] __do_sys_execveat fs/exec.c:2137 [inline] __se_sys_execveat fs/exec.c:2131 [inline] __x64_sys_execveat+0xc4/0xe0 fs/exec.c:2131 do_syscall_64+0xfb/0x240 entry_SYSCALL_64_after_hwframe+0x6d/0x75 Second to last potentially related work creation: kasan_save_stack+0x3f/0x60 mm/kasan/common.c:47 __kasan_record_aux_stack+0xac/0xc0 mm/kasan/generic.c:541 task_work_add+0x8b/0x3a0 kernel/task_work.c:48 task_tick_mm_cid kernel/sched/core.c:11982 [inline] scheduler_tick+0x2e8/0x6e0 kernel/sched/core.c:5689 update_process_times+0x202/0x230 kernel/time/timer.c:2481 tick_sched_handle kernel/time/tick-sched.c:273 [inline] tick_nohz_handler+0x39e/0x540 kernel/time/tick-sched.c:294 __run_hrtimer kernel/time/hrtimer.c:1692 [inline] __hrtimer_run_queues+0x54b/0xd00 kernel/time/hrtimer.c:1756 hrtimer_interrupt+0x396/0x990 kernel/time/hrtimer.c:1818 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1032 [inline] __sysvec_apic_timer_interrupt+0x107/0x3a0 arch/x86/kernel/apic/apic.c:1049 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline] sysvec_apic_timer_interrupt+0xa1/0xc0 arch/x86/kernel/apic/apic.c:1043 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 The buggy address belongs to the object at ffff888075c49e00 which belongs to the cache task_struct of size 7424 The buggy address is located 2312 bytes inside of freed 7424-byte region [ffff888075c49e00, ffff888075c4bb00) The buggy address belongs to the physical page: page:ffffea0001d71200 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888075c48000 pfn:0x75c48 head:ffffea0001d71200 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff88807d678ac1 flags: 0xfff00000000a40(workingset|slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000a40 ffff888015aec500 ffff888014ca8a08 ffffea000060c410 raw: ffff888075c48000 0000000000040003 00000001ffffffff ffff88807d678ac1 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 4822, tgid 4822 (sshd), ts 54564376509, free_ts 53952817359 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x1ea/0x210 mm/page_alloc.c:1533 prep_new_page mm/page_alloc.c:1540 [inline] get_page_from_freelist+0x33ea/0x3580 mm/page_alloc.c:3311 __alloc_pages+0x256/0x680 mm/page_alloc.c:4569 __alloc_pages_node include/linux/gfp.h:238 [inline] alloc_pages_node include/linux/gfp.h:261 [inline] alloc_slab_page+0x5f/0x160 mm/slub.c:2175 allocate_slab mm/slub.c:2338 [inline] new_slab+0x84/0x2f0 mm/slub.c:2391 ___slab_alloc+0xc73/0x1260 mm/slub.c:3525 __slab_alloc mm/slub.c:3610 [inline] __slab_alloc_node mm/slub.c:3663 [inline] slab_alloc_node mm/slub.c:3835 [inline] kmem_cache_alloc_node+0x24a/0x380 mm/slub.c:3888 alloc_task_struct_node kernel/fork.c:176 [inline] dup_task_struct+0x57/0x7d0 kernel/fork.c:1106 copy_process+0x5d1/0x3df0 kernel/fork.c:2219 kernel_clone+0x21e/0x8d0 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+0x6d/0x75 page last free pid 4918 tgid 4918 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+0x968/0xa90 mm/page_alloc.c:2346 free_unref_page+0x37/0x3f0 mm/page_alloc.c:2486 discard_slab mm/slub.c:2437 [inline] __put_partials+0xeb/0x130 mm/slub.c:2906 put_cpu_partial+0x17c/0x250 mm/slub.c:2981 __slab_free+0x2ea/0x3d0 mm/slub.c:4151 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x5e/0xc0 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:3798 [inline] slab_alloc_node mm/slub.c:3845 [inline] __do_kmalloc_node mm/slub.c:3965 [inline] __kmalloc+0x1e2/0x4a0 mm/slub.c:3979 kmalloc include/linux/slab.h:632 [inline] tomoyo_realpath_from_path+0xcf/0x5e0 security/tomoyo/realpath.c:251 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_perm+0x2b7/0x740 security/tomoyo/file.c:822 security_inode_getattr+0xd8/0x130 security/security.c:2263 vfs_getattr+0x45/0x430 fs/stat.c:173 vfs_fstat fs/stat.c:198 [inline] vfs_fstatat+0xd6/0x190 fs/stat.c:300 __do_sys_newfstatat fs/stat.c:468 [inline] __se_sys_newfstatat fs/stat.c:462 [inline] __x64_sys_newfstatat+0x117/0x190 fs/stat.c:462 do_syscall_64+0xfb/0x240 Memory state around the buggy address: ffff888075c4a600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888075c4a680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888075c4a700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888075c4a780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888075c4a800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================