==================================================================
BUG: KASAN: slab-use-after-free in rose_send_frame+0x29a/0x2c0 net/rose/rose_link.c:101
Read of size 8 at addr ffff888035f17020 by task syz.2.7456/26055
CPU: 1 UID: 0 PID: 26055 Comm: syz.2.7456 Tainted: G L syzkaller #0 PREEMPT(full)
Tainted: [L]=SOFTLOCKUP
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
Call Trace:
__dump_stack lib/dump_stack.c:94 [inline]
dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120
print_address_description mm/kasan/report.c:378 [inline]
print_report+0xcd/0x630 mm/kasan/report.c:482
kasan_report+0xe0/0x110 mm/kasan/report.c:595
rose_send_frame+0x29a/0x2c0 net/rose/rose_link.c:101
rose_transmit_restart_request+0x1b8/0x240 net/rose/rose_link.c:198
rose_t0timer_expiry+0x1d/0x150 net/rose/rose_link.c:83
call_timer_fn+0x19a/0x5a0 kernel/time/timer.c:1748
expire_timers kernel/time/timer.c:1799 [inline]
__run_timers+0x74a/0xae0 kernel/time/timer.c:2373
__run_timer_base kernel/time/timer.c:2385 [inline]
__run_timer_base kernel/time/timer.c:2377 [inline]
run_timer_base+0x114/0x190 kernel/time/timer.c:2394
run_timer_softirq+0x1a/0x40 kernel/time/timer.c:2404
handle_softirqs+0x219/0x950 kernel/softirq.c:622
__do_softirq kernel/softirq.c:656 [inline]
invoke_softirq kernel/softirq.c:496 [inline]
__irq_exit_rcu+0x109/0x170 kernel/softirq.c:723
irq_exit_rcu+0x9/0x30 kernel/softirq.c:739
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1056 [inline]
sysvec_apic_timer_interrupt+0xa4/0xc0 arch/x86/kernel/apic/apic.c:1056
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:697
RIP: 0010:lock_acquire+0x62/0x330 kernel/locking/lockdep.c:5872
Code: d3 18 12 83 f8 07 0f 87 a2 02 00 00 89 c0 48 0f a3 05 52 c1 ee 0e 0f 82 74 02 00 00 8b 35 ea f1 ee 0e 85 f6 0f 85 8d 00 00 00 <48> 8b 44 24 30 65 48 2b 05 69 d3 18 12 0f 85 ad 02 00 00 48 83 c4
RSP: 0018:ffffc9000469f7c0 EFLAGS: 00000206
RAX: 0000000000000046 RBX: ffffffff8e3c96a0 RCX: 0000000068c1bacb
RDX: 0000000000000000 RSI: ffffffff8daa966f RDI: ffffffff8bf2b580
RBP: 0000000000000002 R08: 00000000ffffffff R09: 00000000ffffffff
R10: 0000000000000002 R11: ffff888022b454b0 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
rcu_lock_acquire include/linux/rcupdate.h:331 [inline]
rcu_read_lock include/linux/rcupdate.h:867 [inline]
class_rcu_constructor include/linux/rcupdate.h:1195 [inline]
unwind_next_frame+0xd1/0x20b0 arch/x86/kernel/unwind_orc.c:495
arch_stack_walk+0x94/0x100 arch/x86/kernel/stacktrace.c:25
stack_trace_save+0x8e/0xc0 kernel/stacktrace.c:122
kasan_save_stack+0x33/0x60 mm/kasan/common.c:57
kasan_record_aux_stack+0xa7/0xc0 mm/kasan/generic.c:556
__call_rcu_common.constprop.0+0xa5/0xa10 kernel/rcu/tree.c:3119
slab_free_hook mm/slub.c:2504 [inline]
slab_free mm/slub.c:6670 [inline]
kmem_cache_free+0x171/0x770 mm/slub.c:6781
file_free fs/file_table.c:79 [inline]
__fput+0x68d/0xb70 fs/file_table.c:481
task_work_run+0x150/0x240 kernel/task_work.c:233
exit_task_work include/linux/task_work.h:40 [inline]
do_exit+0x87f/0x2bd0 kernel/exit.c:971
do_group_exit+0xd3/0x2a0 kernel/exit.c:1112
__do_sys_exit_group kernel/exit.c:1123 [inline]
__se_sys_exit_group kernel/exit.c:1121 [inline]
__x64_sys_exit_group+0x3e/0x50 kernel/exit.c:1121
x64_sys_call+0x151c/0x1740 arch/x86/include/generated/asm/syscalls_64.h:232
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xcd/0xf80 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f0f7958f7c9
Code: Unable to access opcode bytes at 0x7f0f7958f79f.
RSP: 002b:00007fffa64b21c8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f0f7958f7c9
RDX: 0000000000000064 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 00007fffa64b222c R08: 00000016a64b22bf R09: 00000000000927c0
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000000000e5
R13: 00000000000927c0 R14: 0000000000072d52 R15: 00007fffa64b2280
Allocated by task 14313:
kasan_save_stack+0x33/0x60 mm/kasan/common.c:57
kasan_save_track+0x14/0x30 mm/kasan/common.c:78
poison_kmalloc_redzone mm/kasan/common.c:398 [inline]
__kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:415
kmalloc_noprof include/linux/slab.h:957 [inline]
rose_add_node net/rose/rose_route.c:85 [inline]
rose_rt_ioctl+0x880/0x2580 net/rose/rose_route.c:748
rose_ioctl+0x64d/0x7c0 net/rose/af_rose.c:1382
sock_do_ioctl+0x118/0x280 net/socket.c:1254
sock_ioctl+0x227/0x6b0 net/socket.c:1375
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:597 [inline]
__se_sys_ioctl fs/ioctl.c:583 [inline]
__x64_sys_ioctl+0x18e/0x210 fs/ioctl.c:583
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xcd/0xf80 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Freed by task 0:
kasan_save_stack+0x33/0x60 mm/kasan/common.c:57
kasan_save_track+0x14/0x30 mm/kasan/common.c:78
kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:584
poison_slab_object mm/kasan/common.c:253 [inline]
__kasan_slab_free+0x5f/0x80 mm/kasan/common.c:285
kasan_slab_free include/linux/kasan.h:235 [inline]
slab_free_hook mm/slub.c:2540 [inline]
slab_free mm/slub.c:6670 [inline]
kfree+0x2f8/0x6e0 mm/slub.c:6878
rose_neigh_put include/net/rose.h:166 [inline]
rose_timer_expiry+0x53f/0x630 net/rose/rose_timer.c:183
call_timer_fn+0x19a/0x5a0 kernel/time/timer.c:1748
expire_timers kernel/time/timer.c:1799 [inline]
__run_timers+0x74a/0xae0 kernel/time/timer.c:2373
__run_timer_base kernel/time/timer.c:2385 [inline]
__run_timer_base kernel/time/timer.c:2377 [inline]
run_timer_base+0x114/0x190 kernel/time/timer.c:2394
run_timer_softirq+0x1a/0x40 kernel/time/timer.c:2404
handle_softirqs+0x219/0x950 kernel/softirq.c:622
__do_softirq kernel/softirq.c:656 [inline]
invoke_softirq kernel/softirq.c:496 [inline]
__irq_exit_rcu+0x109/0x170 kernel/softirq.c:723
irq_exit_rcu+0x9/0x30 kernel/softirq.c:739
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1056 [inline]
sysvec_apic_timer_interrupt+0xa4/0xc0 arch/x86/kernel/apic/apic.c:1056
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:697
The buggy address belongs to the object at ffff888035f17000
which belongs to the cache kmalloc-512 of size 512
The buggy address is located 32 bytes inside of
freed 512-byte region [ffff888035f17000, ffff888035f17200)
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff888035f15800 pfn:0x35f14
head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
flags: 0xfff00000000240(workingset|head|node=0|zone=1|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 00fff00000000240 ffff88801b442c80 ffffea00004a5010 ffffea00015f2910
raw: ffff888035f15800 000000000010000a 00000000f5000000 0000000000000000
head: 00fff00000000240 ffff88801b442c80 ffffea00004a5010 ffffea00015f2910
head: ffff888035f15800 000000000010000a 00000000f5000000 0000000000000000
head: 00fff00000000002 ffffea0000d7c501 00000000ffffffff 00000000ffffffff
head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 2, migratetype Unmovable, gfp_mask 0x252800(GFP_NOWAIT|__GFP_NORETRY|__GFP_COMP|__GFP_THISNODE), pid 11940, tgid 11932 (iou-wrk-11936), ts 168988639357, free_ts 168579250855
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x1af/0x220 mm/page_alloc.c:1884
prep_new_page mm/page_alloc.c:1892 [inline]
get_page_from_freelist+0xd0b/0x31a0 mm/page_alloc.c:3945
__alloc_frozen_pages_noprof+0x25f/0x2430 mm/page_alloc.c:5240
alloc_slab_page mm/slub.c:3077 [inline]
allocate_slab mm/slub.c:3248 [inline]
new_slab+0xaf/0x430 mm/slub.c:3302
___slab_alloc+0xe18/0x1c90 mm/slub.c:4656
__slab_alloc.constprop.0+0x63/0x110 mm/slub.c:4779
__slab_alloc_node mm/slub.c:4855 [inline]
slab_alloc_node mm/slub.c:5251 [inline]
__do_kmalloc_node mm/slub.c:5656 [inline]
__kmalloc_node_noprof+0x4d8/0x930 mm/slub.c:5663
kmalloc_array_node_noprof include/linux/slab.h:1075 [inline]
alloc_slab_obj_exts+0x43/0xf0 mm/slub.c:2123
account_slab mm/slub.c:3202 [inline]
allocate_slab mm/slub.c:3267 [inline]
new_slab+0x353/0x430 mm/slub.c:3302
___slab_alloc+0xe18/0x1c90 mm/slub.c:4656
__slab_alloc.constprop.0+0x63/0x110 mm/slub.c:4779
__slab_alloc_node mm/slub.c:4855 [inline]
slab_alloc_node mm/slub.c:5251 [inline]
__kmalloc_cache_noprof+0x485/0x800 mm/slub.c:5771
kmalloc_noprof include/linux/slab.h:957 [inline]
io_add_buffers io_uring/kbuf.c:535 [inline]
__io_manage_buffers_legacy io_uring/kbuf.c:577 [inline]
io_manage_buffers_legacy+0x3ce/0xe70 io_uring/kbuf.c:590
__io_issue_sqe+0xe8/0x7c0 io_uring/io_uring.c:1793
io_issue_sqe+0x85/0x1410 io_uring/io_uring.c:1816
io_wq_submit_work+0x3b9/0xed0 io_uring/io_uring.c:1928
page last free pid 44 tgid 44 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
free_pages_prepare mm/page_alloc.c:1433 [inline]
__free_frozen_pages+0x7df/0x1170 mm/page_alloc.c:2973
__folio_put+0x329/0x450 mm/swap.c:112
folio_put include/linux/mm.h:1612 [inline]
migrate_folio_done+0x236/0x2c0 mm/migrate.c:1198
migrate_folio_move mm/migrate.c:1412 [inline]
migrate_folios_move mm/migrate.c:1721 [inline]
migrate_pages_batch+0x1ca0/0x3bb0 mm/migrate.c:1977
migrate_pages_sync+0x12d/0x8a0 mm/migrate.c:2007
migrate_pages+0x1b0b/0x2350 mm/migrate.c:2116
compact_zone+0x1e78/0x4540 mm/compaction.c:2647
compact_node+0x1a3/0x2c0 mm/compaction.c:2916
kcompactd+0x73b/0xe80 mm/compaction.c:3214
kthread+0x3c5/0x780 kernel/kthread.c:463
ret_from_fork+0x983/0xb10 arch/x86/kernel/process.c:158
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:246
Memory state around the buggy address:
ffff888035f16f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888035f16f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888035f17000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888035f17080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888035f17100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess):
0: d3 18 rcrl %cl,(%rax)
2: 12 83 f8 07 0f 87 adc -0x78f0f808(%rbx),%al
8: a2 02 00 00 89 c0 48 movabs %al,0xa30f48c089000002
f: 0f a3
11: 05 52 c1 ee 0e add $0xeeec152,%eax
16: 0f 82 74 02 00 00 jb 0x290
1c: 8b 35 ea f1 ee 0e mov 0xeeef1ea(%rip),%esi # 0xeeef20c
22: 85 f6 test %esi,%esi
24: 0f 85 8d 00 00 00 jne 0xb7
* 2a: 48 8b 44 24 30 mov 0x30(%rsp),%rax <-- trapping instruction
2f: 65 48 2b 05 69 d3 18 sub %gs:0x1218d369(%rip),%rax # 0x1218d3a0
36: 12
37: 0f 85 ad 02 00 00 jne 0x2ea
3d: 48 rex.W
3e: 83 .byte 0x83
3f: c4 .byte 0xc4