diff options
author | Jim Mattson <jmattson@google.com> | 2018-12-14 14:34:43 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-02-12 19:46:07 +0100 |
commit | f70123c6d3accc024445eca6b9ee01c1fe2b80d8 (patch) | |
tree | 77a74ee86afbfa264c234b7f4c9466170561afcd /lib/bcd.c | |
parent | e7226c67a17dd86c57b5f15bb4daf4358948fb7d (diff) | |
download | linux-stable-f70123c6d3accc024445eca6b9ee01c1fe2b80d8.tar.gz |
kvm: Change offset in kvm_write_guest_offset_cached to unsigned
[ Upstream commit 7a86dab8cf2f0fdf508f3555dddfc236623bff60 ]
Since the offset is added directly to the hva from the
gfn_to_hva_cache, a negative offset could result in an out of bounds
write. The existing BUG_ON only checks for addresses beyond the end of
the gfn_to_hva_cache, not for addresses before the start of the
gfn_to_hva_cache.
Note that all current call sites have non-negative offsets.
Fixes: 4ec6e8636256 ("kvm: Introduce kvm_write_guest_offset_cached()")
Reported-by: Cfir Cohen <cfir@google.com>
Signed-off-by: Jim Mattson <jmattson@google.com>
Reviewed-by: Cfir Cohen <cfir@google.com>
Reviewed-by: Peter Shier <pshier@google.com>
Reviewed-by: Krish Sadhukhan <krish.sadhukhan@oracle.com>
Reviewed-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'lib/bcd.c')
0 files changed, 0 insertions, 0 deletions