diff options
author | Philipp Stanner <[email protected]> | 2023-11-02 19:15:24 +0100 |
---|---|---|
committer | Sean Christopherson <[email protected]> | 2023-11-30 13:16:21 -0800 |
commit | 573cc0e5cf142d9992d2de3502800890fc717bc0 (patch) | |
tree | 01147a1ba8e9cc0de2a5aeb0fdaac18e4fb17b92 /scripts/gcc-plugins/latent_entropy_plugin.c | |
parent | 63912245c19d3a4179da44beefd017eb9270f207 (diff) |
KVM: x86: Harden copying of userspace-array against overflow
cpuid.c utilizes vmemdup_user() and array_size() to copy two userspace
arrays. This, currently, does not check for an overflow.
Use the new wrapper vmemdup_array_user() to copy the arrays more safely,
as vmemdup_user() doesn't check for overflow.
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]>
Diffstat (limited to 'scripts/gcc-plugins/latent_entropy_plugin.c')
0 files changed, 0 insertions, 0 deletions