[Android 5.15] general protection fault in restart_apic_timer

7 views
Skip to first unread message

syzbot

unread,
Mar 23, 2023, 2:52:54 AM3/23/23
to syzkaller-a...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 5448b2fda85f Merge 5.15.94 into android13-5.15-lts
git tree: android13-5.15-lts
console+strace: https://syzkaller.appspot.com/x/log.txt?x=1798b54ec80000
kernel config: https://syzkaller.appspot.com/x/.config?x=cb55b12f877ddc70
dashboard link: https://syzkaller.appspot.com/bug?extid=b6a74be92b5063a0f1ff
compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=15eed636c80000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=10365781c80000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/24924398a010/disk-5448b2fd.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/e244d5b44fff/vmlinux-5448b2fd.xz
kernel image: https://storage.googleapis.com/syzbot-assets/bc13eddc3000/bzImage-5448b2fd.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+b6a74b...@syzkaller.appspotmail.com

general protection fault, probably for non-canonical address 0xdffffc000000000d: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000068-0x000000000000006f]
CPU: 1 PID: 328 Comm: syz-executor204 Not tainted 5.15.94-syzkaller-03204-g5448b2fda85f #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023
RIP: 0010:apic_lvtt_period arch/x86/kvm/lapic.c:355 [inline]
RIP: 0010:restart_apic_timer+0x99/0x990 arch/x86/kvm/lapic.c:1917
Code: f2 01 66 43 c7 44 3c 0d f3 f3 43 c6 44 3c 0f f3 e8 6c e4 58 00 bf 01 00 00 00 e8 a2 e1 35 00 49 8d 5e 68 49 89 dd 49 c1 ed 03 <43> 0f b6 44 3d 00 84 c0 0f 85 e8 05 00 00 48 89 5c 24 20 8b 1b bf
RSP: 0018:ffffc90000947a40 EFLAGS: 00010202
RAX: 1ffff11020e35da8 RBX: 0000000000000068 RCX: ffffffff84b88c00
RDX: 0000000000000000 RSI: 0000000000030d40 RDI: ffffffff81168d5e
RBP: ffffc90000947b60 R08: ffffffff8108d82b R09: ffffed1020e35c59
R10: 0000000000000000 R11: dffffc0000000001 R12: 1ffff92000128f50
R13: 000000000000000d R14: 0000000000000000 R15: dffffc0000000000
FS: 00005555574d3300(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f973d5e9130 CR3: 000000011fa0a000 CR4: 00000000003526a0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
kvm_lapic_switch_to_hv_timer+0x3b/0x40 arch/x86/kvm/lapic.c:1949
vmx_post_block+0x4b/0x60 arch/x86/kvm/vmx/vmx.c:7589
vcpu_block arch/x86/kvm/x86.c:10052 [inline]
vcpu_run arch/x86/kvm/x86.c:10106 [inline]
kvm_arch_vcpu_ioctl_run+0xdff/0x2150 arch/x86/kvm/x86.c:10336
kvm_vcpu_ioctl+0x7eb/0xcf0 arch/x86/kvm/../../../virt/kvm/kvm_main.c:3843
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:874 [inline]
__se_sys_ioctl+0x114/0x190 fs/ioctl.c:860
__x64_sys_ioctl+0x7b/0x90 fs/ioctl.c:860
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x61/0xcb
RIP: 0033:0x7f973d577b99
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 b1 14 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 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fff76e02538 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f973d577b99
RDX: 0000000000000000 RSI: 000000000000ae80 RDI: 0000000000000005
RBP: 0000000000000000 R08: 0000000000000000 R09: 00007fff76e026d8
R10: 0000000000009120 R11: 0000000000000246 R12: 00007f973d53ae00
R13: 431bde82d7b634db R14: 0000000000000000 R15: 0000000000000000
</TASK>
Modules linked in:
---[ end trace f6414f99fcc491c7 ]---
RIP: 0010:apic_lvtt_period arch/x86/kvm/lapic.c:355 [inline]
RIP: 0010:restart_apic_timer+0x99/0x990 arch/x86/kvm/lapic.c:1917
Code: f2 01 66 43 c7 44 3c 0d f3 f3 43 c6 44 3c 0f f3 e8 6c e4 58 00 bf 01 00 00 00 e8 a2 e1 35 00 49 8d 5e 68 49 89 dd 49 c1 ed 03 <43> 0f b6 44 3d 00 84 c0 0f 85 e8 05 00 00 48 89 5c 24 20 8b 1b bf
RSP: 0018:ffffc90000947a40 EFLAGS: 00010202
RAX: 1ffff11020e35da8 RBX: 0000000000000068 RCX: ffffffff84b88c00
RDX: 0000000000000000 RSI: 0000000000030d40 RDI: ffffffff81168d5e
RBP: ffffc90000947b60 R08: ffffffff8108d82b R09: ffffed1020e35c59
R10: 0000000000000000 R11: dffffc0000000001 R12: 1ffff92000128f50
R13: 000000000000000d R14: 0000000000000000 R15: dffffc0000000000
FS: 00005555574d3300(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f973d5e9130 CR3: 000000011fa0a000 CR4: 00000000003526a0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
0: f2 01 66 43 repnz add %esp,0x43(%rsi)
4: c7 44 3c 0d f3 f3 43 movl $0xc643f3f3,0xd(%rsp,%rdi,1)
b: c6
c: 44 3c 0f rex.R cmp $0xf,%al
f: f3 e8 6c e4 58 00 repz callq 0x58e481
15: bf 01 00 00 00 mov $0x1,%edi
1a: e8 a2 e1 35 00 callq 0x35e1c1
1f: 49 8d 5e 68 lea 0x68(%r14),%rbx
23: 49 89 dd mov %rbx,%r13
26: 49 c1 ed 03 shr $0x3,%r13
* 2a: 43 0f b6 44 3d 00 movzbl 0x0(%r13,%r15,1),%eax <-- trapping instruction
30: 84 c0 test %al,%al
32: 0f 85 e8 05 00 00 jne 0x620
38: 48 89 5c 24 20 mov %rbx,0x20(%rsp)
3d: 8b 1b mov (%rbx),%ebx
3f: bf .byte 0xbf


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
syzbot can test patches for this issue, for details see:
https://goo.gl/tpsmEJ#testing-patches

Tudor Ambarus

unread,
Mar 24, 2023, 4:02:37 AM3/24/23
to syzbot+b6a74b...@syzkaller.appspotmail.com, Lee Jones, syzkaller-a...@googlegroups.com

syzbot

unread,
Mar 24, 2023, 4:11:24 AM3/24/23
to jone...@google.com, syzkaller-a...@googlegroups.com, tudor....@linaro.org
Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
general protection fault in restart_apic_timer

general protection fault, probably for non-canonical address 0xdffffc000000000c: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000060-0x0000000000000067]
CPU: 1 PID: 474 Comm: syz-executor.0 Not tainted 5.15.104-syzkaller-15317-g115472395b0a #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023
RIP: 0010:apic_lvtt_period arch/x86/kvm/lapic.c:355 [inline]
RIP: 0010:restart_apic_timer+0x99/0x990 arch/x86/kvm/lapic.c:1918
Code: f2 01 66 43 c7 44 3c 0d f3 f3 43 c6 44 3c 0f f3 e8 ac eb 56 00 bf 01 00 00 00 e8 72 6c 35 00 49 8d 5e 60 49 89 dd 49 c1 ed 03 <43> 0f b6 44 3d 00 84 c0 0f 85 e8 05 00 00 48 89 5c 24 20 8b 1b bf
RSP: 0018:ffffc90000d17a40 EFLAGS: 00010206
RAX: 1ffff11020cbd73a RBX: 0000000000000060 RCX: ffffffff849e6500
RDX: 0000000000000000 RSI: 0000000000030d40 RDI: ffffffff81168c3e
RBP: ffffc90000d17b60 R08: ffffffff8108d6bb R09: ffffed1020cbd601
R10: 0000000000000000 R11: dffffc0000000001 R12: 1ffff920001a2f50
R13: 000000000000000c R14: 0000000000000000 R15: dffffc0000000000
FS: 00007f3d66085700(0000) GS:ffff8881f7300000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 00000001207f4000 CR4: 00000000003526a0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
kvm_lapic_switch_to_hv_timer+0x3b/0x40 arch/x86/kvm/lapic.c:1950
vmx_post_block+0x4b/0x60 arch/x86/kvm/vmx/vmx.c:7609
vcpu_block arch/x86/kvm/x86.c:10053 [inline]
vcpu_run arch/x86/kvm/x86.c:10107 [inline]
kvm_arch_vcpu_ioctl_run+0xdff/0x2150 arch/x86/kvm/x86.c:10337
kvm_vcpu_ioctl+0x7eb/0xcf0 arch/x86/kvm/../../../virt/kvm/kvm_main.c:3863
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:874 [inline]
__se_sys_ioctl+0x114/0x190 fs/ioctl.c:860
__x64_sys_ioctl+0x7b/0x90 fs/ioctl.c:860
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x61/0xcb
RIP: 0033:0x7f3d665120f9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f3d66085168 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f3d66631f80 RCX: 00007f3d665120f9
RDX: 0000000000000000 RSI: 000000000000ae80 RDI: 0000000000000005
RBP: 00007f3d6656db39 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffe7e85f7ef R14: 00007f3d66085300 R15: 0000000000022000
</TASK>
Modules linked in:
---[ end trace a27280d354fbcf4b ]---
RIP: 0010:apic_lvtt_period arch/x86/kvm/lapic.c:355 [inline]
RIP: 0010:restart_apic_timer+0x99/0x990 arch/x86/kvm/lapic.c:1918
Code: f2 01 66 43 c7 44 3c 0d f3 f3 43 c6 44 3c 0f f3 e8 ac eb 56 00 bf 01 00 00 00 e8 72 6c 35 00 49 8d 5e 60 49 89 dd 49 c1 ed 03 <43> 0f b6 44 3d 00 84 c0 0f 85 e8 05 00 00 48 89 5c 24 20 8b 1b bf
RSP: 0018:ffffc90000d17a40 EFLAGS: 00010206
RAX: 1ffff11020cbd73a RBX: 0000000000000060 RCX: ffffffff849e6500
RDX: 0000000000000000 RSI: 0000000000030d40 RDI: ffffffff81168c3e
RBP: ffffc90000d17b60 R08: ffffffff8108d6bb R09: ffffed1020cbd601
R10: 0000000000000000 R11: dffffc0000000001 R12: 1ffff920001a2f50
R13: 000000000000000c R14: 0000000000000000 R15: dffffc0000000000
FS: 00007f3d66085700(0000) GS:ffff8881f7300000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 00000001207f4000 CR4: 00000000003526a0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
0: f2 01 66 43 repnz add %esp,0x43(%rsi)
4: c7 44 3c 0d f3 f3 43 movl $0xc643f3f3,0xd(%rsp,%rdi,1)
b: c6
c: 44 3c 0f rex.R cmp $0xf,%al
f: f3 e8 ac eb 56 00 repz callq 0x56ebc1
15: bf 01 00 00 00 mov $0x1,%edi
1a: e8 72 6c 35 00 callq 0x356c91
1f: 49 8d 5e 60 lea 0x60(%r14),%rbx
23: 49 89 dd mov %rbx,%r13
26: 49 c1 ed 03 shr $0x3,%r13
* 2a: 43 0f b6 44 3d 00 movzbl 0x0(%r13,%r15,1),%eax <-- trapping instruction
30: 84 c0 test %al,%al
32: 0f 85 e8 05 00 00 jne 0x620
38: 48 89 5c 24 20 mov %rbx,0x20(%rsp)
3d: 8b 1b mov (%rbx),%ebx
3f: bf .byte 0xbf


Tested on:

commit: 11547239 Linux 5.15.104
git tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=109736eec80000
kernel config: https://syzkaller.appspot.com/x/.config?x=64e20f826821631b
dashboard link: https://syzkaller.appspot.com/bug?extid=b6a74be92b5063a0f1ff
compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2

Note: no patches were applied.

Tudor Ambarus

unread,
Mar 28, 2023, 2:50:35 AM3/28/23
to syzbot, jone...@google.com, syzkaller-a...@googlegroups.com

syzbot

unread,
Mar 28, 2023, 3:18:18 AM3/28/23
to jone...@google.com, syzkaller-a...@googlegroups.com, tudor....@linaro.org
Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-and-tested-by: syzbot+b6a74b...@syzkaller.appspotmail.com

Tested on:

commit: 197b6b60 Linux 6.3-rc4
git tree: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git v6.3-rc4
console output: https://syzkaller.appspot.com/x/log.txt?x=1750e001c80000
kernel config: https://syzkaller.appspot.com/x/.config?x=68da6fd3235c8ec2
dashboard link: https://syzkaller.appspot.com/bug?extid=b6a74be92b5063a0f1ff
compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2

Note: no patches were applied.
Note: testing is done by a robot and is best-effort only.

Tudor Ambarus

unread,
Mar 28, 2023, 3:53:06 AM3/28/23
to syzbot, Lee Jones, syzkaller-a...@googlegroups.com

syzbot

unread,
Mar 28, 2023, 4:19:26 AM3/28/23
to jone...@google.com, syzkaller-a...@googlegroups.com, tudor....@linaro.org
Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-and-tested-by: syzbot+b6a74b...@syzkaller.appspotmail.com

Tested on:

commit: f443e374 Linux 5.17
git tree: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git v5.17
console output: https://syzkaller.appspot.com/x/log.txt?x=149cc539c80000
kernel config: https://syzkaller.appspot.com/x/.config?x=c150534b89b28d10
dashboard link: https://syzkaller.appspot.com/bug?extid=b6a74be92b5063a0f1ff
compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2

Note: no patches were applied.

Tudor Ambarus

unread,
Apr 5, 2023, 9:56:07 AM4/5/23
to syzbot+b6a74b...@syzkaller.appspotmail.com, Lee Jones, syzkaller-a...@googlegroups.com
#syz fix: UPSTREAM: KVM: VMX: Move preemption timer <=> hrtimer dance to
common x86

Tudor Ambarus

unread,
Apr 5, 2023, 9:58:01 AM4/5/23
to syzbot+b6a74b...@syzkaller.appspotmail.com, Lee Jones, syzkaller-a...@googlegroups.com
trying without new line this time:

#syz fix: UPSTREAM: KVM: VMX: Move preemption timer <=> hrtimer dance to
common x86

Reply all
Reply to author
Forward
0 new messages