diff options
| author | Sean Christopherson <seanjc@google.com> | 2026-08-06 10:06:02 -0700 |
|---|---|---|
| committer | Sean Christopherson <seanjc@google.com> | 2026-09-22 06:40:39 -0700 |
| commit | ea93efec4dda2ca8c33dc88cf4d389a980a358df (patch) | |
| tree | 272c60dee458ca18c32cd0bac95a89f344768533 /tools/perf/scripts/python | |
| parent | aec196ba2affa5b396ed1bc16340067d66972f24 (diff) | |
| download | linux-next-ea93efec4dda2ca8c33dc88cf4d389a980a358df.tar.gz linux-next-ea93efec4dda2ca8c33dc88cf4d389a980a358df.zip | |
KVM: TDX: Fix a benign off-by-one bug on the end GPA for INIT_MEM_REGION
When verifying that the incoming GPA rage for INIT_MEM_REGION doesn't wrap,
check the inclusive last GPA, not the exclusive last GPA. Super duper
technically, it's ok if the very last GPA is -1ull. In practice, the flaw
is benign as KVM x86 disallows memslots with GPAs that exceed MAXPHYADDR,
i.e. INIT_MEM_REGION would fail with -EINVAL anyways due to the memslot
check in kvm_gmem_populate().
Opportunistically use check_add_overflow() instead of manually checking for
wrap, mostly so that the inclusive math doesn't need to be copy+pasted in
the "is private" check.
Fixes: c846b451d3c5 ("KVM: TDX: Add an ioctl to create initial guest memory")
Reviewed-by: Yan Zhao <yan.y.zhao@intel.com>
Tested-by: Yan Zhao <yan.y.zhao@intel.com>
Reviewed-by: Binbin Wu <binbin.wu@linux.intel.com>
Link: https://patch.msgid.link/20260806170602.4112602-3-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
