]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: fix shift out of bounds reported by UBSAN
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 22 Dec 2020 10:20:43 +0000 (05:20 -0500)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 7 Jan 2021 23:07:32 +0000 (18:07 -0500)
commitf2f41fdf501cc37bcd61e61de08d0dbc520ad482
tree6ae8dfc54febca3a30949453e538d4f9ec1915a7
parent4cd679a1aa8cc17dbb291da4d0c074746720efb8
KVM: x86: fix shift out of bounds reported by UBSAN

Since we know that e >= s, we can reassociate the left shift,
changing the shifted number from 1 to 2 in exchange for
decreasing the right hand side by 1.

Reported-by: syzbot+e87846c48bf72bc85311@syzkaller.appspotmail.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu.h