Skip to content
Snippets Groups Projects
Commit 1f829359 authored by Philipp Stanner's avatar Philipp Stanner Committed by Sean Christopherson
Browse files

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: default avatarDave Airlie <airlied@redhat.com>
Signed-off-by: default avatarPhilipp Stanner <pstanner@redhat.com>
Link: https://lore.kernel.org/r/20231102181526.43279-4-pstanner@redhat.com


[sean: call out that KVM pre-checks the number of entries]
Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
parent 8c497677
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment