Skip to content

Use new wrappers to copy userspace arrays

Philipp Stanner kvm linux-s390 lkml 1 version Applied

Status from this message: Applied to kvm-x86 generic. Claudio (or anyone else from s390), holler if

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 4 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/3arch/x86/kvm: copy user-array with overflow-checkarch/x86/kvm/cpuid.c+2 -20 replies
2/3arch/s390/kvm: copy userspace-array safelyarch/s390/kvm/guestdbg.c+2 -21 reply
3/3virt/kvm: copy userspace-array safelyvirt/kvm/kvm_main.c+2 -30 replies

Reviews trailers per patch

1 of 3 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchClaudio ImbrendaChristian Borntraeger
SeriesA-b
1/3
2/3A-b
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/3] Use new wrappers to copy userspace arrays

Hi,

Linus recently merged [1] the wrapper functions memdup_array_user() and vmemdup_array_user() in include/linux/string.h for Kernel v6.7

I am currently adding them to all places where (v)memdup_user() had been used to copy arrays.

The wrapper is different to the wrapped functions only in that it might return -EOVERFLOW. So this new error code might get pushed up to userspace. I hope this is fine.

I felt that it might be a good idea to land those three patches here with a single series, since they all touch something KVM-related.

Kind regards,
P.

[1] https://lore.kernel.org/all/[email protected]/

Philipp Stanner (3):
arch/x86/kvm: copy user-array with overflow-check arch/s390/kvm: copy userspace-array safely virt/kvm: copy userspace-array safely

 arch/s390/kvm/guestdbg.c | 4 ++--
 arch/x86/kvm/cpuid.c     | 4 ++--
 virt/kvm/kvm_main.c      | 5 ++---
 3 files changed, 6 insertions(+), 7 deletions(-)
Signature · 1 line
2.41.0