==================================================================
BUG: KASAN: slab-use-after-free in __update_min_deadline kernel/sched/fair.c:805 [inline]
BUG: KASAN: slab-use-after-free in min_deadline_update kernel/sched/fair.c:819 [inline]
BUG: KASAN: slab-use-after-free in min_deadline_cb_propagate kernel/sched/fair.c:825 [inline]
BUG: KASAN: slab-use-after-free in reweight_entity+0x8e3/0xa60 kernel/sched/fair.c:3660
Read of size 8 at addr ffff888118dd57b0 by task syz-executor.0/22106
CPU: 1 PID: 22106 Comm: syz-executor.0 Not tainted 6.6.0-rc6-syzkaller-gec0989703642 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/06/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
__update_min_deadline kernel/sched/fair.c:805 [inline]
min_deadline_update kernel/sched/fair.c:819 [inline]
min_deadline_cb_propagate kernel/sched/fair.c:825 [inline]
reweight_entity+0x8e3/0xa60 kernel/sched/fair.c:3660
entity_tick kernel/sched/fair.c:5317 [inline]
task_tick_fair+0xb7/0x750 kernel/sched/fair.c:12392
scheduler_tick+0x1a4/0x480 kernel/sched/core.c:5657
update_process_times+0x19f/0x220 kernel/time/timer.c:2076
tick_sched_handle+0x8e/0x170 kernel/time/tick-sched.c:254
tick_sched_timer+0xe9/0x110 kernel/time/tick-sched.c:1492
__run_hrtimer kernel/time/hrtimer.c:1688 [inline]
__hrtimer_run_queues+0x647/0xc10 kernel/time/hrtimer.c:1752
hrtimer_interrupt+0x31b/0x800 kernel/time/hrtimer.c:1814
local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1063 [inline]
__sysvec_apic_timer_interrupt+0x105/0x3f0 arch/x86/kernel/apic/apic.c:1080
sysvec_apic_timer_interrupt+0x89/0xb0 arch/x86/kernel/apic/apic.c:1074
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+0x31/0x70 kernel/locking/spinlock.c:194
Code: f5 53 48 8b 74 24 10 48 89 fb 48 83 c7 18 e8 66 ef e4 fa 48 89 df e8 5e 6e e5 fa f7 c5 00 02 00 00 75 1f 9c 58 f6 c4 02 75 2f 01 00 00 00 e8 a5 db d9 fa 65 8b 05 c6 2a ba 79 85 c0 74 12 5b
RSP: 0018:ffffc9000fb0fe08 EFLAGS: 00000246
RAX: 0000000000000006 RBX: ffff88811e238008 RCX: 1ffffffff12660b1
RDX: 0000000000000000 RSI: ffffffff8687c980 RDI: ffffffff86a64d60
RBP: 0000000000000283 R08: 0000000000000001 R09: 0000000000000001
R10: ffffffff89332dd7 R11: 000000000036cd40 R12: ffff88811e238000
R13: ffff88811e238144 R14: ffff88811e238008 R15: 0000000000000005
spin_unlock_irqrestore include/linux/spinlock.h:406 [inline]
raw_ioctl_run drivers/usb/gadget/legacy/raw_gadget.c:574 [inline]
raw_ioctl+0x10dc/0x2b80 drivers/usb/gadget/legacy/raw_gadget.c:1266
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:871 [inline]
__se_sys_ioctl fs/ioctl.c:857 [inline]
__x64_sys_ioctl+0x18f/0x210 fs/ioctl.c:857
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
RIP: 0033:0x7f9640b2a84b
Code: 00 48 89 44 24 18 31 c0 48 8d 44 24 60 c7 04 24 10 00 00 00 48 89 44 24 08 48 8d 44 24 20 48 89 44 24 10 b8 10 00 00 00 0f 05 <89> c2 3d 00 f0 ff ff 77 1c 48 8b 44 24 18 64 48 2b 04 25 28 00 00
RSP: 002b:00007f963feaafa0 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000000005 RCX: 00007f9640b2a84b
RDX: 0000000000000000 RSI: 0000000000005501 RDI: 0000000000000005
RBP: 00007f963feac070 R08: 0000000000000010 R09: 00302e6364755f79
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f963feab040 R14: 0000000020000940 R15: 00007f9640d6f3f0
Allocated by task 22127:
kasan_save_stack+0x33/0x50 mm/kasan/common.c:45
kasan_set_track+0x25/0x30 mm/kasan/common.c:52
__kasan_slab_alloc+0x66/0x70 mm/kasan/common.c:328
kasan_slab_alloc include/linux/kasan.h:188 [inline]
slab_post_alloc_hook mm/slab.h:762 [inline]
slab_alloc_node mm/slub.c:3478 [inline]
kmem_cache_alloc_node+0x195/0x3b0 mm/slub.c:3523
alloc_task_struct_node kernel/fork.c:173 [inline]
dup_task_struct kernel/fork.c:1110 [inline]
copy_process+0x41c/0x72f0 kernel/fork.c:2327
kernel_clone+0xfc/0x850 kernel/fork.c:2909
__do_sys_clone+0xba/0x100 kernel/fork.c:3052
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
Freed by task 2382:
kasan_save_stack+0x33/0x50 mm/kasan/common.c:45
kasan_set_track+0x25/0x30 mm/kasan/common.c:52
kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:522
____kasan_slab_free mm/kasan/common.c:236 [inline]
____kasan_slab_free+0x13c/0x190 mm/kasan/common.c:200
kasan_slab_free include/linux/kasan.h:164 [inline]
slab_free_hook mm/slub.c:1800 [inline]
slab_free_freelist_hook mm/slub.c:1826 [inline]
slab_free mm/slub.c:3809 [inline]
kmem_cache_free+0x13a/0x4f0 mm/slub.c:3831
put_task_struct include/linux/sched/task.h:136 [inline]
put_task_struct include/linux/sched/task.h:123 [inline]
delayed_put_task_struct+0x21b/0x2b0 kernel/exit.c:226
rcu_do_batch kernel/rcu/tree.c:2139 [inline]
rcu_core+0x805/0x1bb0 kernel/rcu/tree.c:2403
__do_softirq+0x20b/0x94e kernel/softirq.c:553
Last potentially related work creation:
kasan_save_stack+0x33/0x50 mm/kasan/common.c:45
__kasan_record_aux_stack+0x9c/0xb0 mm/kasan/generic.c:492
__call_rcu_common.constprop.0+0x9a/0x790 kernel/rcu/tree.c:2653
put_task_struct_rcu_user kernel/exit.c:232 [inline]
put_task_struct_rcu_user+0x87/0xc0 kernel/exit.c:229
release_task+0xef7/0x1b70 kernel/exit.c:282
wait_task_zombie kernel/exit.c:1210 [inline]
wait_consider_task+0x17b5/0x4000 kernel/exit.c:1437
do_wait_thread kernel/exit.c:1500 [inline]
do_wait+0x72a/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
Second to last potentially related work creation:
kasan_save_stack+0x33/0x50 mm/kasan/common.c:45
__kasan_record_aux_stack+0x9c/0xb0 mm/kasan/generic.c:492
task_work_add+0x88/0x2a0 kernel/task_work.c:48
scheduler_tick+0x1b7/0x480 kernel/sched/core.c:5662
update_process_times+0x19f/0x220 kernel/time/timer.c:2076
tick_sched_handle+0x8e/0x170 kernel/time/tick-sched.c:254
tick_sched_timer+0xe9/0x110 kernel/time/tick-sched.c:1492
__run_hrtimer kernel/time/hrtimer.c:1688 [inline]
__hrtimer_run_queues+0x647/0xc10 kernel/time/hrtimer.c:1752
hrtimer_interrupt+0x31b/0x800 kernel/time/hrtimer.c:1814
local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1063 [inline]
__sysvec_apic_timer_interrupt+0x105/0x3f0 arch/x86/kernel/apic/apic.c:1080
sysvec_apic_timer_interrupt+0x89/0xb0 arch/x86/kernel/apic/apic.c:1074
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:645
The buggy address belongs to the object at ffff888118dd5700
which belongs to the cache task_struct of size 7168
The buggy address is located 176 bytes inside of
freed 7168-byte region [ffff888118dd5700, ffff888118dd7300)
The buggy address belongs to the physical page:
page:ffffea0004637400 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x118dd0
head:ffffea0004637400 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0
memcg:ffff8881126bcd01
flags: 0x200000000000840(slab|head|node=0|zone=2)
page_type: 0xffffffff()
raw: 0200000000000840 ffff888101670500 ffffea00041cd400 dead000000000002
raw: 0000000000000000 0000000000040004 00000001ffffffff ffff8881126bcd01
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), pid 12861, tgid 12861 (syz-executor.1), ts 1296855274381, free_ts 1296842080359
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x2cf/0x340 mm/page_alloc.c:1536
prep_new_page mm/page_alloc.c:1543 [inline]
get_page_from_freelist+0x10e1/0x2fd0 mm/page_alloc.c:3170
__alloc_pages+0x1d0/0x4a0 mm/page_alloc.c:4426
alloc_pages+0x1a9/0x270 mm/mempolicy.c:2297
alloc_slab_page mm/slub.c:1870 [inline]
allocate_slab+0x251/0x380 mm/slub.c:2017
new_slab mm/slub.c:2070 [inline]
___slab_alloc+0x8c7/0x1580 mm/slub.c:3223
__slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3322
__slab_alloc_node mm/slub.c:3375 [inline]
slab_alloc_node mm/slub.c:3468 [inline]
kmem_cache_alloc_node+0x12d/0x3b0 mm/slub.c:3523
alloc_task_struct_node kernel/fork.c:173 [inline]
dup_task_struct kernel/fork.c:1110 [inline]
copy_process+0x41c/0x72f0 kernel/fork.c:2327
kernel_clone+0xfc/0x850 kernel/fork.c:2909
__do_sys_clone+0xba/0x100 kernel/fork.c:3052
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:1136 [inline]
free_unref_page_prepare+0x460/0xa20 mm/page_alloc.c:2312
free_unref_page+0x33/0x2c0 mm/page_alloc.c:2405
__unfreeze_partials+0x21d/0x240 mm/slub.c:2655
qlink_free mm/kasan/quarantine.c:166 [inline]
qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:185
kasan_quarantine_reduce+0x18e/0x1d0 mm/kasan/quarantine.c:292
__kasan_slab_alloc+0x4a/0x70 mm/kasan/common.c:305
kasan_slab_alloc include/linux/kasan.h:188 [inline]
slab_post_alloc_hook mm/slab.h:762 [inline]
slab_alloc_node mm/slub.c:3478 [inline]
__kmem_cache_alloc_node+0x190/0x310 mm/slub.c:3517
kmalloc_trace+0x25/0xe0 mm/slab_common.c:1114
kmalloc include/linux/slab.h:599 [inline]
kzalloc include/linux/slab.h:720 [inline]
ext4_htree_create_dir_info fs/ext4/dir.c:438 [inline]
ext4_dx_readdir fs/ext4/dir.c:556 [inline]
ext4_readdir+0x1ef5/0x2fd0 fs/ext4/dir.c:142
iterate_dir+0x1e5/0x5f0 fs/readdir.c:106
__do_sys_getdents64 fs/readdir.c:405 [inline]
__se_sys_getdents64 fs/readdir.c:390 [inline]
__x64_sys_getdents64+0x14f/0x2e0 fs/readdir.c:390
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:
ffff888118dd5680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888118dd5700: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888118dd5780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888118dd5800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888118dd5880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess):
0: f5 cmc
1: 53 push %rbx
2: 48 8b 74 24 10 mov 0x10(%rsp),%rsi
7: 48 89 fb mov %rdi,%rbx
a: 48 83 c7 18 add $0x18,%rdi
e: e8 66 ef e4 fa call 0xfae4ef79
13: 48 89 df mov %rbx,%rdi
16: e8 5e 6e e5 fa call 0xfae56e79
1b: f7 c5 00 02 00 00 test $0x200,%ebp
21: 75 1f jne 0x42
23: 9c pushf
24: 58 pop %rax
25: f6 c4 02 test $0x2,%ah
28: 75 2f jne 0x59
* 2a: bf 01 00 00 00 mov $0x1,%edi <-- trapping instruction
2f: e8 a5 db d9 fa call 0xfad9dbd9
34: 65 8b 05 c6 2a ba 79 mov %gs:0x79ba2ac6(%rip),%eax # 0x79ba2b01
3b: 85 c0 test %eax,%eax
3d: 74 12 je 0x51
3f: 5b pop %rbx