==================================================================
BUG: KASAN: use-after-free in user_mode arch/x86/include/asm/ptrace.h:214 [inline]
BUG: KASAN: use-after-free in tick_sched_handle kernel/time/tick-sched.c:296 [inline]
BUG: KASAN: use-after-free in tick_nohz_handler+0x5a6/0x690 kernel/time/tick-sched.c:317
Read of size 2 at addr ffffc900037bfc00 by task syz.0.17/5996
CPU: 0 UID: 0 PID: 5996 Comm: syz
CPU: 0 UID: 0 PID: 5996 Comm: syz.0.17 Not tainted syzkaller #0 PREEMPT(full)
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
Call Trace:
__dump_stack lib/dump_stack.c:94 [inline]
dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120
print_address_description mm/kasan/report.c:378 [inline]
print_report+0x13d/0x4b0 mm/kasan/report.c:482
kasan_report+0xdf/0x1c0 mm/kasan/report.c:595
user_mode arch/x86/include/asm/ptrace.h:214 [inline]
tick_sched_handle kernel/time/tick-sched.c:296 [inline]
tick_nohz_handler+0x5a6/0x690 kernel/time/tick-sched.c:317
__run_hrtimer kernel/time/hrtimer.c:2079 [inline]
__hrtimer_run_queues+0x135/0x9a0 kernel/time/hrtimer.c:2136
hrtimer_interrupt+0x441/0xaa0 kernel/time/hrtimer.c:2255
local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1051 [inline]
__sysvec_apic_timer_interrupt+0x109/0x470 arch/x86/kernel/apic/apic.c:1068
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1062 [inline]
sysvec_apic_timer_interrupt+0x9e/0xc0 arch/x86/kernel/apic/apic.c:1062
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:674
RIP: 0010:__raw_spin_unlock_irq include/linux/spinlock_api_smp.h:220 [inline]
RIP: 0010:_raw_spin_unlock_irq+0x29/0x50 kernel/locking/spinlock.c:229
Code: 90 f3 0f 1e fa 53 48 8b 74 24 08 48 89 fb 48 83 c7 18 e8 ca 17 f8 f5 48 89 df e8 52 6e f8 f5 e8 2d 7f 25 f6 fb bf 01 00 00 00 f2 36 e7 f5 65 48 83 3d 51 04 c9 09 00 74 06 5b e9 01 4d 00 00
RSP: 0018:ffffc900037bfc20 EFLAGS: 00000206
RAX: 0000000000000965 RBX: ffffffff90cc2240 RCX: 0000000000000080
RDX: 0000000000000001 RSI: ffffffff8e628221 RDI: 0000000000000001
RBP: 0000000000000052 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000000 R12: ffff888024d67000
R13: 0000000000000063 R14: ffffffff8be291d0 R15: 00007ffffffff000
pci_user_write_config_byte+0x137/0x220 drivers/pci/access.c:276
proc_bus_pci_write+0x367/0x5e0 drivers/pci/proc.c:155
pde_write fs/proc/inode.c:330 [inline]
proc_reg_write+0x240/0x330 fs/proc/inode.c:342
vfs_write+0x2aa/0x1050 fs/read_write.c:685
ksys_write+0x12a/0x250 fs/read_write.c:739
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x123/0x790 arch/x86/entry/syscall_64.c:84
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7ff84739fb19
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 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 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ff848344028 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007ff847625fa0 RCX: 00007ff84739fb19
RDX: 0000000000000002 RSI: 00002000000001c0 RDI: 0000000000000031
RBP: 00007ff847437b70 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ff847626038 R14: 00007ff847625fa0 R15: 00007fff46790858
The buggy address belongs to stack of task syz.0.17/5996
----------------
Code disassembly (best guess):
0: 90 nop
1: f3 0f 1e fa endbr64
5: 53 push %rbx
6: 48 8b 74 24 08 mov 0x8(%rsp),%rsi
b: 48 89 fb mov %rdi,%rbx
e: 48 83 c7 18 add $0x18,%rdi
12: e8 ca 17 f8 f5 call 0xf5f817e1
17: 48 89 df mov %rbx,%rdi
1a: e8 52 6e f8 f5 call 0xf5f86e71
1f: e8 2d 7f 25 f6 call 0xf6257f51
24: fb sti
25: bf 01 00 00 00 mov $0x1,%edi
* 2a: e8 f2 36 e7 f5 call 0xf5e73721 <-- trapping instruction
2f: 65 48 83 3d 51 04 c9 cmpq $0x0,%gs:0x9c90451(%rip) # 0x9c90489
36: 09 00
38: 74 06 je 0x40
3a: 5b pop %rbx
3b: e9 01 4d 00 00 jmp 0x4d41