Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
KVM: Harden copying of userspace-array against overflow
kvm_main.c utilizes vmemdup_user() and array_size() to copy a userspace array. Currently, this does not check for an overflow. Use the new wrapper vmemdup_array_user() to copy the array more safely. Note, KVM explicitly checks the number of entries before duplicating the array, i.e. adding the overflow check should be a glorified nop. Suggested-by: Dave Airlie <[email protected]> Signed-off-by: Philipp Stanner <[email protected]> Link: https://lore.kernel.org/r/[email protected] [sean: call out that KVM pre-checks the number of entries] Signed-off-by: Sean Christopherson <[email protected]>
- Loading branch information