]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit9bcb299c4142b86bb58dc68dab25a6d7e21b038d
treedd4cbdfa4caa3660908846cbc154b34514fe006b
parenta1840125a771fb8301eb690a8ee89969f10a7b12
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 3f8a58904e9a ("kvm: LAPIC:
write down valid APIC registers"), such an access was explicitly
disallowed. Restore the guard that was removed in that commit.

Fixes: 3f8a58904e9a ("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