aboutsummaryrefslogtreecommitdiffstats
path: root/lib/crypto/mpi/mpi-mul.c
diff options
context:
space:
mode:
authorSean Christopherson <[email protected]>2024-08-28 18:14:46 +0000
committerSean Christopherson <[email protected]>2024-08-30 02:38:33 +0000
commite027ba1b83ad017a56c108eea2f42eb9f8ae5204 (patch)
treeb67cdc6797d5cd29bc7d50ebba6e69769c4b5156 /lib/crypto/mpi/mpi-mul.c
parentKVM: selftests: Add a test for coalesced MMIO (and PIO on x86) (diff)
downloadkernel-e027ba1b83ad017a56c108eea2f42eb9f8ae5204.tar.gz
kernel-e027ba1b83ad017a56c108eea2f42eb9f8ae5204.zip
KVM: Clean up coalesced MMIO ring full check
Fold coalesced_mmio_has_room() into its sole caller, coalesced_mmio_write(), as it's really just a single line of code, has a goofy return value, and is unnecessarily brittle. E.g. if coalesced_mmio_has_room() were to check ring->last directly, or the caller failed to use READ_ONCE(), KVM would be susceptible to TOCTOU attacks from userspace. Opportunistically add a comment explaining why on earth KVM leaves one entry free, which may not be obvious to readers that aren't familiar with ring buffers. No functional change intended. Reviewed-by: Ilias Stamatis <[email protected]> Cc: Paul Durrant <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sean Christopherson <[email protected]>
Diffstat (limited to 'lib/crypto/mpi/mpi-mul.c')
0 files changed, 0 insertions, 0 deletions