==================================================================
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 ffff888078f4bc30 by task syz-executor.5/18815
CPU: 0 PID: 18815 Comm: syz-executor.5 Not tainted 6.6.0-rc6-syzkaller-01801-ge43e6d9582e0 #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
enqueue_task_fair+0x2e6/0xbc0 kernel/sched/fair.c:6556
enqueue_task kernel/sched/core.c:2102 [inline]
activate_task kernel/sched/core.c:2132 [inline]
ttwu_do_activate+0x214/0xd90 kernel/sched/core.c:3787
ttwu_queue kernel/sched/core.c:4029 [inline]
try_to_wake_up+0x8e7/0x15b0 kernel/sched/core.c:4346
hrtimer_wakeup+0x47/0x60 kernel/time/hrtimer.c:1942
__run_hrtimer kernel/time/hrtimer.c:1688 [inline]
__hrtimer_run_queues+0x203/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
RIP: 0010:check_kcov_mode kernel/kcov.c:173 [inline]
RIP: 0010:__sanitizer_cov_trace_pc+0x20/0x70 kernel/kcov.c:207
Code: 0f 1f 84 00 00 00 00 00 66 90 f3 0f 1e fa 65 8b 05 5d d7 7b 7e 89 c1 48 8b 34 24 81 e1 00 01 00 00 65 48 8b 14 25 c0 bc 03 00 00 01 ff 00 74 0e 85 c9 74 35 8b 82 04 16 00 00 85 c0 74 2b 8b
RSP: 0018:ffffc900053a7230 EFLAGS: 00000246
RAX: 0000000080000001 RBX: ffffc900053a7300 RCX: 0000000000000000
RDX: ffff888079688000 RSI: ffffffff813a5585 RDI: 0000000000000005
RBP: ffffc900053a76b8 R08: 0000000000000005 R09: 0000000000000000
R10: 0000000000000001 R11: dffffc0000000000 R12: ffffc900053a7308
R13: ffffc900053a7310 R14: ffffc900053a0000 R15: 0000000000000001
on_stack arch/x86/include/asm/stacktrace.h:59 [inline]
stack_access_ok+0x1c5/0x270 arch/x86/kernel/unwind_orc.c:393
deref_stack_reg arch/x86/kernel/unwind_orc.c:403 [inline]
unwind_next_frame+0xd87/0x2390 arch/x86/kernel/unwind_orc.c:585
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_node_track_caller+0x61/0x100 mm/slab_common.c:1046
kstrdup+0x3c/0x70 mm/util.c:62
kstrdup_const+0x5f/0x70 mm/util.c:85
__kernfs_new_node+0x9c/0x890 fs/kernfs/dir.c:611
kernfs_new_node+0x94/0x110 fs/kernfs/dir.c:679
__kernfs_create_file+0x53/0x340 fs/kernfs/file.c:1047
sysfs_add_file_mode_ns+0x1ff/0x3b0 fs/sysfs/file.c:294
create_files fs/sysfs/group.c:64 [inline]
internal_create_group+0x31c/0xb40 fs/sysfs/group.c:152
internal_create_groups+0x9d/0x150 fs/sysfs/group.c:192
setup_gid_attrs drivers/infiniband/core/sysfs.c:1169 [inline]
ib_setup_port_attrs+0x3ef/0x5b0 drivers/infiniband/core/sysfs.c:1446
add_one_compat_dev+0x4bf/0x720 drivers/infiniband/core/device.c:969
rdma_dev_init_net+0x2b2/0x520 drivers/infiniband/core/device.c:1185
ops_init+0xb9/0x650 net/core/net_namespace.c:136
setup_net+0x422/0xa40 net/core/net_namespace.c:339
copy_net_ns+0x2fa/0x670 net/core/net_namespace.c:491
create_new_namespaces+0x3ea/0xb10 kernel/nsproxy.c:110
unshare_nsproxy_namespaces+0xc1/0x1f0 kernel/nsproxy.c:228
ksys_unshare+0x3da/0x930 kernel/fork.c:3435
__do_sys_unshare kernel/fork.c:3506 [inline]
__se_sys_unshare kernel/fork.c:3504 [inline]
__x64_sys_unshare+0x31/0x40 kernel/fork.c:3504
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:0x7f748647cae9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f74872440c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000110
RAX: ffffffffffffffda RBX: 00007f748659bf80 RCX: 00007f748647cae9
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 000000006c060000
RBP: 00007f74864c847a R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007f748659bf80 R15: 00007ffdf87e5688
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: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
kernel_thread+0xc0/0x100 kernel/fork.c:2971
create_kthread kernel/kthread.c:411 [inline]
kthreadd+0x4fb/0x7d0 kernel/kthread.c:746
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304
Freed by task 9831:
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
schedule+0xe7/0x1b0 kernel/sched/core.c:6771
schedule_timeout+0x278/0x2c0 kernel/time/timer.c:2143
do_wait_for_common kernel/sched/completion.c:95 [inline]
__wait_for_common+0x3e0/0x5f0 kernel/sched/completion.c:116
kthread_stop+0x18e/0x5f0 kernel/kthread.c:709
rxrpc_unuse_local+0x102/0x130 net/rxrpc/local_object.c:401
rxrpc_release_sock net/rxrpc/af_rxrpc.c:906 [inline]
rxrpc_release+0x211/0x560 net/rxrpc/af_rxrpc.c:933
__sock_release+0xae/0x260 net/socket.c:659
sock_close+0x1c/0x20 net/socket.c:1419
__fput+0x3f7/0xa70 fs/file_table.c:384
__fput_sync+0x47/0x50 fs/file_table.c:465
__do_sys_close fs/open.c:1572 [inline]
__se_sys_close fs/open.c:1557 [inline]
__x64_sys_close+0x87/0xf0 fs/open.c:1557
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+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_irq+0x52/0x90 kernel/sched/core.c:7007
irqentry_exit+0x35/0x80 kernel/entry/common.c:432
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:645
The buggy address belongs to the object at ffff888078f4bb80
which belongs to the cache task_struct of size 7360
The buggy address is located 176 bytes inside of
freed 7360-byte region [ffff888078f4bb80, ffff888078f4d840)
The buggy address belongs to the physical page:
page:ffffea0001e3d200 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x78f48
head:ffffea0001e3d200 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0
memcg:ffff888079117c01
flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000000840 ffff888014e43500 ffffea00009c4e00 dead000000000002
raw: 0000000000000000 0000000000040004 00000001ffffffff ffff888079117c01
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 9917, tgid 9917 (syz-executor.4), ts 1495862955349, free_ts 1495727649763
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
getname_flags.part.0+0x50/0x4e0 fs/namei.c:140
getname_flags+0x9c/0xf0 include/linux/audit.h:321
vfs_fstatat+0x9a/0x140 fs/stat.c:294
__do_sys_newfstatat+0x98/0x110 fs/stat.c:459
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:
ffff888078f4bb00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888078f4bb80: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888078f4bc00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888078f4bc80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888078f4bd00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess):
0: 0f 1f 84 00 00 00 00 nopl 0x0(%rax,%rax,1)
7: 00
8: 66 90 xchg %ax,%ax
a: f3 0f 1e fa endbr64
e: 65 8b 05 5d d7 7b 7e mov %gs:0x7e7bd75d(%rip),%eax # 0x7e7bd772
15: 89 c1 mov %eax,%ecx
17: 48 8b 34 24 mov (%rsp),%rsi
1b: 81 e1 00 01 00 00 and $0x100,%ecx
21: 65 48 8b 14 25 c0 bc mov %gs:0x3bcc0,%rdx
28: 03 00
* 2a: a9 00 01 ff 00 test $0xff0100,%eax <-- trapping instruction
2f: 74 0e je 0x3f
31: 85 c9 test %ecx,%ecx
33: 74 35 je 0x6a
35: 8b 82 04 16 00 00 mov 0x1604(%rdx),%eax
3b: 85 c0 test %eax,%eax
3d: 74 2b je 0x6a
3f: 8b .byte 0x8b