OSDN Git Service

kvm: LAPIC: Restore guard to prevent illegal APIC register access
authorJim Mattson <jmattson@google.com>
Wed, 2 Jun 2021 20:52:24 +0000 (13:52 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 9 Jun 2021 21:25:37 +0000 (17:25 -0400)
commit218bf772bddd221489c38dde6ef8e917131161f6
treedd4cbdfa4caa3660908846cbc154b34514fe006b
parent4422829e8053068e0225e4d0ef42dc41ea7c9ef5
kvm: LAPIC: Restore guard to prevent illegal APIC register access

Per the SDM, "any access that touches bytes 4 through 15 of an APIC
register may cause undefined behavior and must not be executed."
Worse, such an access in kvm_lapic_reg_read can result in a leak of
kernel stack contents. Prior to commit 01402cf81051 ("kvm: LAPIC:
write down valid APIC registers"), such an access was explicitly
disallowed. Restore the guard that was removed in that commit.

Fixes: 01402cf81051 ("kvm: LAPIC: write down valid APIC registers")
Signed-off-by: Jim Mattson <jmattson@google.com>
Reported-by: syzbot <syzkaller@googlegroups.com>
Message-Id: <20210602205224.3189316-1-jmattson@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/lapic.c