==================================================================
BUG: KASAN: slab-use-after-free in timer_is_static_object+0x80/0x90 kernel/time/timer.c:691
Read of size 8 at addr ffff888102f35098 by task syz.9.7255/26227
CPU: 1 UID: 0 PID: 26227 Comm: syz.9.7255 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
timer_is_static_object+0x80/0x90 kernel/time/timer.c:691
lookup_object_or_alloc.part.0+0x420/0x590 lib/debugobjects.c:679
lookup_object_or_alloc lib/debugobjects.c:665 [inline]
debug_object_activate+0x326/0x4c0 lib/debugobjects.c:820
debug_timer_activate kernel/time/timer.c:793 [inline]
__mod_timer+0x814/0xd30 kernel/time/timer.c:1124
add_timer+0x62/0x90 kernel/time/timer.c:1249
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:write_comp_data+0x8b/0x90 kernel/kcov.c:272
Code: 00 00 4a 8d 34 dd 28 00 00 00 48 39 f2 72 1b 48 83 c7 01 48 89 38 4c 89 44 30 e0 4c 89 4c 30 e8 4c 89 54 30 f0 4a 89 4c d8 20 50 08 bd 09 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 f3
RSP: 0018:ffffc90003d67548 EFLAGS: 00000293
RAX: 0000000000000000 RBX: 1ffff920007aceaa RCX: ffffffff8235208e
RDX: ffff8880485424c0 RSI: 0000000000000005 RDI: 0000000000000007
RBP: 800000011af9c007 R08: 0000000000000007 R09: 0000000000000005
R10: 0000000000000005 R11: ffff888048542ff0 R12: 0000000000000005
R13: ffff88805a6bfcc8 R14: dffffc0000000000 R15: 0000000000000000
pte_user_accessible_page arch/x86/include/asm/pgtable.h:1684 [inline]
__page_table_check_pte_clear+0x9e/0x100 mm/page_table_check.c:153
page_table_check_pte_clear include/linux/page_table_check.h:51 [inline]
ptep_get_and_clear_full arch/x86/include/asm/pgtable.h:1270 [inline]
get_and_clear_full_ptes include/linux/pgtable.h:725 [inline]
zap_present_folio_ptes mm/memory.c:1630 [inline]
zap_present_ptes mm/memory.c:1712 [inline]
do_zap_pte_range mm/memory.c:1814 [inline]
zap_pte_range mm/memory.c:1858 [inline]
zap_pmd_range mm/memory.c:1950 [inline]
zap_pud_range mm/memory.c:1978 [inline]
zap_p4d_range mm/memory.c:1999 [inline]
unmap_page_range+0x253c/0x42a0 mm/memory.c:2020
unmap_single_vma+0x153/0x240 mm/memory.c:2062
unmap_vmas+0x218/0x470 mm/memory.c:2104
exit_mmap+0x1b0/0xb60 mm/mmap.c:1277
__mmput+0x12a/0x410 kernel/fork.c:1173
mmput+0x62/0x70 kernel/fork.c:1196
exit_mm kernel/exit.c:581 [inline]
do_exit+0x7d7/0x2bd0 kernel/exit.c:959
do_group_exit+0xd3/0x2a0 kernel/exit.c:1112
get_signal+0x2671/0x26d0 kernel/signal.c:3034
arch_do_signal_or_restart+0x8f/0x7e0 arch/x86/kernel/signal.c:337
__exit_to_user_mode_loop kernel/entry/common.c:41 [inline]
exit_to_user_mode_loop+0x8c/0x540 kernel/entry/common.c:75
__exit_to_user_mode_prepare include/linux/irq-entry-common.h:226 [inline]
syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:256 [inline]
syscall_exit_to_user_mode_work include/linux/entry-common.h:159 [inline]
syscall_exit_to_user_mode include/linux/entry-common.h:194 [inline]
do_syscall_64+0x4ee/0xf80 arch/x86/entry/syscall_64.c:100
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f417f58f7c9
Code: Unable to access opcode bytes at 0x7f417f58f79f.
RSP: 002b:00007f418049a0e8 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca
RAX: fffffffffffffe00 RBX: 00007f417f7e5fa8 RCX: 00007f417f58f7c9
RDX: 0000000000000000 RSI: 0000000000000080 RDI: 00007f417f7e5fa8
RBP: 00007f417f7e5fa0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f417f7e6038 R14: 00007ffee9403c50 R15: 00007ffee9403d38
Allocated by task 20282:
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:6674 [inline]
kfree+0x2f8/0x6e0 mm/slub.c:6882
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 ffff888102f35000
which belongs to the cache kmalloc-512 of size 512
The buggy address is located 152 bytes inside of
freed 512-byte region [ffff888102f35000, ffff888102f35200)
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102f34
head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
flags: 0x57ff00000000040(head|node=1|zone=2|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 057ff00000000040 ffff88801b442c80 ffffea000416d000 dead000000000002
raw: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000
head: 057ff00000000040 ffff88801b442c80 ffffea000416d000 dead000000000002
head: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000
head: 057ff00000000002 ffffea00040bcd01 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 1, tgid 1 (swapper/0), ts 8665332056, free_ts 0
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_pages_mpol+0x1fb/0x550 mm/mempolicy.c:2486
alloc_slab_page mm/slub.c:3075 [inline]
allocate_slab mm/slub.c:3248 [inline]
new_slab+0x2c3/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:5775
kmalloc_noprof include/linux/slab.h:957 [inline]
kzalloc_noprof include/linux/slab.h:1094 [inline]
device_private_init drivers/base/core.c:3534 [inline]
device_add+0xcf2/0x1980 drivers/base/core.c:3585
tty_register_device_attr+0x38e/0x7c0 drivers/tty/tty_io.c:3261
tty_register_device drivers/tty/tty_io.c:3196 [inline]
tty_register_driver+0x50c/0x860 drivers/tty/tty_io.c:3460
legacy_pty_init drivers/tty/pty.c:577 [inline]
pty_init+0x688/0x10f0 drivers/tty/pty.c:915
do_one_initcall+0x123/0x680 init/main.c:1378
do_initcall_level init/main.c:1440 [inline]
do_initcalls init/main.c:1456 [inline]
do_basic_setup init/main.c:1475 [inline]
kernel_init_freeable+0x5c8/0x920 init/main.c:1688
kernel_init+0x1c/0x2b0 init/main.c:1578
ret_from_fork+0x983/0xb10 arch/x86/kernel/process.c:158
page_owner free stack trace missing
Memory state around the buggy address:
ffff888102f34f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888102f35000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888102f35080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888102f35100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888102f35180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess):
0: 00 00 add %al,(%rax)
2: 4a 8d 34 dd 28 00 00 lea 0x28(,%r11,8),%rsi
9: 00
a: 48 39 f2 cmp %rsi,%rdx
d: 72 1b jb 0x2a
f: 48 83 c7 01 add $0x1,%rdi
13: 48 89 38 mov %rdi,(%rax)
16: 4c 89 44 30 e0 mov %r8,-0x20(%rax,%rsi,1)
1b: 4c 89 4c 30 e8 mov %r9,-0x18(%rax,%rsi,1)
20: 4c 89 54 30 f0 mov %r10,-0x10(%rax,%rsi,1)
25: 4a 89 4c d8 20 mov %rcx,0x20(%rax,%r11,8)
* 2a: e9 50 08 bd 09 jmp 0x9bd087f <-- trapping instruction
2f: 90 nop
30: 90 nop
31: 90 nop
32: 90 nop
33: 90 nop
34: 90 nop
35: 90 nop
36: 90 nop
37: 90 nop
38: 90 nop
39: 90 nop
3a: 90 nop
3b: 90 nop
3c: 90 nop
3d: 90 nop
3e: 90 nop
3f: f3 repz