==================================================================
BUG: KASAN: slab-use-after-free in min_deadline_update kernel/sched/fair.c:818 [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+0x8c7/0xa60 kernel/sched/fair.c:3660
Read of size 8 at addr ffff8880763300a8 by task syz-executor.5/15614
CPU: 1 PID: 15614 Comm: syz-executor.5 Not tainted 6.6.0-rc6-syzkaller-00217-gcd8892c07876 #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
min_deadline_update kernel/sched/fair.c:818 [inline]
min_deadline_cb_propagate kernel/sched/fair.c:825 [inline]
reweight_entity+0x8c7/0xa60 kernel/sched/fair.c:3660
entity_tick kernel/sched/fair.c:5317 [inline]
task_tick_fair+0xee/0xcd0 kernel/sched/fair.c:12392
scheduler_tick+0x210/0x650 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+0x42/0xc0 arch/x86/kernel/apic/apic.c:1074
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:645
RIP: 0010:check_kcov_mode kernel/kcov.c:173 [inline]
RIP: 0010:__sanitizer_cov_trace_pc+0xb/0x70 kernel/kcov.c:207
Code: 0f 1e fa 48 8b be b0 01 00 00 e8 b0 ff ff ff 31 c0 c3 66 66 2e 0f 1f 84 00 00 00 00 00 66 90 f3 0f 1e fa 65 8b 05 cd e2 7b 7e <89> c1 48 8b 34 24 81 e1 00 01 00 00 65 48 8b 14 25 c0 bc 03 00 a9
RSP: 0018:ffffc900001f0558 EFLAGS: 00000202
RAX: 0000000000000102 RBX: ffffc900001f0638 RCX: ffffc900001f066c
RDX: ffff8880211a8000 RSI: 0000000000000100 RDI: 0000000000000001
RBP: 0000000000000002 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000001 R11: dd8622aaaaaaaaaa R12: ffffc900001f0600
R13: 0000000000000001 R14: 0000000000000001 R15: 0000000000000001
deref_stack_reg arch/x86/kernel/unwind_orc.c:406 [inline]
unwind_next_frame+0x1ab6/0x2390 arch/x86/kernel/unwind_orc.c:648
__unwind_start+0x5a4/0x880 arch/x86/kernel/unwind_orc.c:760
unwind_start arch/x86/include/asm/unwind.h:64 [inline]
arch_stack_walk+0xaf/0x170 arch/x86/kernel/stacktrace.c:24
stack_trace_save+0x96/0xd0 kernel/stacktrace.c:122
kasan_save_stack+0x33/0x50 mm/kasan/common.c:45
kasan_set_track+0x25/0x30 mm/kasan/common.c:52
____kasan_kmalloc mm/kasan/common.c:374 [inline]
__kasan_kmalloc+0xa2/0xb0 mm/kasan/common.c:383
kmalloc include/linux/slab.h:599 [inline]
dst_cow_metrics_generic+0x4c/0x1f0 net/core/dst.c:180
dst_metrics_write_ptr include/net/dst.h:133 [inline]
dst_metric_set include/net/dst.h:194 [inline]
icmp6_dst_alloc+0x4a2/0x620 net/ipv6/route.c:3276
ndisc_send_skb+0xffe/0x1420 net/ipv6/ndisc.c:489
ndisc_send_rs+0x133/0x690 net/ipv6/ndisc.c:719
addrconf_rs_timer+0x412/0x840 net/ipv6/addrconf.c:3973
call_timer_fn+0x19e/0x580 kernel/time/timer.c:1700
expire_timers kernel/time/timer.c:1751 [inline]
__run_timers+0x764/0xb10 kernel/time/timer.c:2022
run_timer_softirq+0x58/0xd0 kernel/time/timer.c:2035
__do_softirq+0x218/0x965 kernel/softirq.c:553
invoke_softirq kernel/softirq.c:427 [inline]
__irq_exit_rcu kernel/softirq.c:632 [inline]
irq_exit_rcu+0xb7/0x120 kernel/softirq.c:644
sysvec_apic_timer_interrupt+0x93/0xc0 arch/x86/kernel/apic/apic.c:1074
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:645
RIP: 0010:__schedule+0xee9/0x5a10 kernel/sched/core.c:6577
Code: fa 48 c1 ea 03 80 3c 02 00 0f 85 dc 43 00 00 48 8b bd 10 ff ff ff 49 89 5f 10 48 89 de e8 1f 84 c0 f6 48 89 c7 e8 f7 5d 1b f7 <48> 8b 9d 98 fe ff ff 48 b8 00 00 00 00 00 fc ff df 48 01 c3 48 c7
RSP: 0018:ffffc90004f1f4b8 EFLAGS: 00000202
RAX: 0000000000c87dab RBX: ffff8880b993d1d0 RCX: 1ffffffff233b6dc
RDX: 0000000000000000 RSI: ffffffff8a8caca0 RDI: ffffffff8ae93420
RBP: ffffc90004f1f650 R08: 0000000000000001 R09: fffffbfff23389d6
R10: ffffffff919c4eb7 R11: 0000000000000001 R12: ffff8880211a8290
R13: 0000000000000000 R14: ffff8880211a8000 R15: ffff8880b993c700
preempt_schedule_common+0x45/0xc0 kernel/sched/core.c:6864
preempt_schedule_thunk+0x1a/0x30 arch/x86/entry/thunk_64.S:45
__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline]
_raw_spin_unlock_irqrestore+0x5d/0x70 kernel/locking/spinlock.c:194
rcu_read_unlock_special kernel/rcu/tree_plugin.h:681 [inline]
__rcu_read_unlock+0x2ad/0x570 kernel/rcu/tree_plugin.h:426
rcu_read_unlock+0x24/0xb0 include/linux/rcupdate.h:781
pte_unmap include/linux/pgtable.h:113 [inline]
zap_pte_range mm/memory.c:1525 [inline]
zap_pmd_range mm/memory.c:1573 [inline]
zap_pud_range mm/memory.c:1602 [inline]
zap_p4d_range mm/memory.c:1623 [inline]
unmap_page_range+0x147a/0x2c10 mm/memory.c:1644
unmap_single_vma+0x194/0x2b0 mm/memory.c:1690
unmap_vmas+0x1e2/0x330 mm/memory.c:1731
exit_mmap+0x1ad/0xa60 mm/mmap.c:3210
__mmput+0x12a/0x4d0 kernel/fork.c:1349
mmput+0x62/0x70 kernel/fork.c:1371
exit_mm kernel/exit.c:567 [inline]
do_exit+0x9ad/0x2a20 kernel/exit.c:861
do_group_exit+0xd4/0x2a0 kernel/exit.c:1024
get_signal+0x23ba/0x2790 kernel/signal.c:2892
arch_do_signal_or_restart+0x90/0x7f0 arch/x86/kernel/signal.c:309
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:285 [inline]
syscall_exit_to_user_mode+0x1d/0x60 kernel/entry/common.c:296
do_syscall_64+0x44/0xb0 arch/x86/entry/common.c:86
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f321d27cae9
Code: Unable to access opcode bytes at 0x7f321d27cabf.
RSP: 002b:00007f321e0b10c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000035
RAX: 0000000000000000 RBX: 00007f321d39bf80 RCX: 00007f321d27cae9
RDX: 0000000000000000 RSI: 0000000000000005 RDI: 0000000000000001
RBP: 00007f321d2c847a R08: 0000000000000000 R09: 0000000000000000
R10: 00000000200029c0 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007f321d39bf80 R15: 00007ffe673ca5b8
Allocated by task 4703:
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:188 [inline]
slab_post_alloc_hook mm/slab.h:762 [inline]
slab_alloc_node mm/slub.c:3478 [inline]
kmem_cache_alloc_node+0x180/0x3f0 mm/slub.c:3523
alloc_task_struct_node kernel/fork.c:173 [inline]
dup_task_struct kernel/fork.c:1110 [inline]
copy_process+0x41c/0x73f0 kernel/fork.c:2327
kernel_clone+0xfd/0x920 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 16:
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+0x15b/0x1b0 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+0x114/0x1e0 mm/slub.c:1826
slab_free mm/slub.c:3809 [inline]
kmem_cache_free+0xf0/0x480 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+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+0xbc/0xd0 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
context_switch kernel/sched/core.c:5385 [inline]
__schedule+0xee9/0x5a10 kernel/sched/core.c:6695
preempt_schedule_common+0x45/0xc0 kernel/sched/core.c:6864
preempt_schedule_thunk+0x1a/0x30 arch/x86/entry/thunk_64.S:45
unwind_next_frame+0x1c80/0x2390 arch/x86/kernel/unwind_orc.c:672
arch_stack_walk+0xfa/0x170 arch/x86/kernel/stacktrace.c:25
stack_trace_save+0x96/0xd0 kernel/stacktrace.c:122
kasan_save_stack+0x33/0x50 mm/kasan/common.c:45
kasan_set_track+0x25/0x30 mm/kasan/common.c:52
____kasan_kmalloc mm/kasan/common.c:374 [inline]
__kasan_kmalloc+0xa2/0xb0 mm/kasan/common.c:383
kasan_kmalloc include/linux/kasan.h:198 [inline]
__do_kmalloc_node mm/slab_common.c:1026 [inline]
__kmalloc+0x60/0x100 mm/slab_common.c:1039
kmalloc include/linux/slab.h:603 [inline]
kzalloc include/linux/slab.h:720 [inline]
cfg80211_inform_single_bss_frame_data+0x388/0xf30 net/wireless/scan.c:2856
cfg80211_inform_bss_frame_data+0xbf/0x290 net/wireless/scan.c:2916
ieee80211_bss_info_update+0x374/0x990 net/mac80211/scan.c:211
ieee80211_rx_bss_info net/mac80211/ibss.c:1124 [inline]
ieee80211_rx_mgmt_probe_beacon net/mac80211/ibss.c:1613 [inline]
ieee80211_ibss_rx_queued_mgmt+0x195a/0x2ed0 net/mac80211/ibss.c:1642
ieee80211_iface_process_skb net/mac80211/iface.c:1604 [inline]
ieee80211_iface_work+0xa1f/0xd40 net/mac80211/iface.c:1658
cfg80211_wiphy_work+0x24e/0x330 net/wireless/core.c:435
process_one_work+0x884/0x15c0 kernel/workqueue.c:2630
process_scheduled_works kernel/workqueue.c:2703 [inline]
worker_thread+0x8b9/0x1290 kernel/workqueue.c:2784
kthread+0x33c/0x440 kernel/kthread.c:388
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304
Second to last potentially related work creation:
kasan_save_stack+0x33/0x50 mm/kasan/common.c:45
__kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:492
task_work_add+0x88/0x2a0 kernel/task_work.c:48
scheduler_tick+0x228/0x650 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+0x8e/0xc0 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 ffff888076330000
which belongs to the cache task_struct of size 7360
The buggy address is located 168 bytes inside of
freed 7360-byte region [ffff888076330000, ffff888076331cc0)
The buggy address belongs to the physical page:
page:ffffea0001d8cc00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x76330
head:ffffea0001d8cc00 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0
memcg:ffff888053eba2c1
anon flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000000840 ffff888140007500 0000000000000000 dead000000000001
raw: 0000000000000000 0000000000040004 00000001ffffffff ffff888053eba2c1
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 9351, tgid 9351 (syz-executor.2), ts 753705718954, free_ts 753650730454
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+0xee0/0x2f20 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+0x132/0x3f0 mm/slub.c:3523
alloc_task_struct_node kernel/fork.c:173 [inline]
dup_task_struct kernel/fork.c:1110 [inline]
copy_process+0x41c/0x73f0 kernel/fork.c:2327
kernel_clone+0xfd/0x920 kernel/fork.c:2909
__do_sys_clone3+0x1f1/0x260 kernel/fork.c:3210
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+0x476/0xa40 mm/page_alloc.c:2312
free_unref_page+0x33/0x3b0 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+0x65/0x90 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]
slab_alloc mm/slub.c:3486 [inline]
__kmem_cache_alloc_lru mm/slub.c:3493 [inline]
kmem_cache_alloc+0x16c/0x3b0 mm/slub.c:3502
kmem_cache_zalloc include/linux/slab.h:710 [inline]
jbd2_alloc_handle include/linux/jbd2.h:1592 [inline]
new_handle fs/jbd2/transaction.c:476 [inline]
jbd2__journal_start+0x190/0x690 fs/jbd2/transaction.c:503
__ext4_journal_start_sb+0x40f/0x5c0 fs/ext4/ext4_jbd2.c:112
__ext4_journal_start fs/ext4/ext4_jbd2.h:326 [inline]
ext4_handle_inode_extension+0x228/0x860 fs/ext4/file.c:350
ext4_dio_write_iter fs/ext4/file.c:611 [inline]
ext4_file_write_iter+0x148e/0x1860 fs/ext4/file.c:715
call_write_iter include/linux/fs.h:1956 [inline]
new_sync_write fs/read_write.c:491 [inline]
vfs_write+0x650/0xe40 fs/read_write.c:584
ksys_write+0x12f/0x250 fs/read_write.c:637
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:
ffff88807632ff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff888076330000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888076330080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888076330100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888076330180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess):
0: 0f 1e fa nop %edx
3: 48 8b be b0 01 00 00 mov 0x1b0(%rsi),%rdi
a: e8 b0 ff ff ff call 0xffffffbf
f: 31 c0 xor %eax,%eax
11: c3 ret
12: 66 66 2e 0f 1f 84 00 data16 cs nopw 0x0(%rax,%rax,1)
19: 00 00 00 00
1d: 66 90 xchg %ax,%ax
1f: f3 0f 1e fa endbr64
23: 65 8b 05 cd e2 7b 7e mov %gs:0x7e7be2cd(%rip),%eax # 0x7e7be2f7
* 2a: 89 c1 mov %eax,%ecx <-- trapping instruction
2c: 48 8b 34 24 mov (%rsp),%rsi
30: 81 e1 00 01 00 00 and $0x100,%ecx
36: 65 48 8b 14 25 c0 bc mov %gs:0x3bcc0,%rdx
3d: 03 00
3f: a9 .byte 0xa9