Re: [PATCH v1] KVM: Use memdup_user instead of kernel stack to allocate kvm_guest_debug

From: Sean Christopherson

Date: Fri Feb 20 2026 - 12:15:38 EST


On Tue, Feb 10, 2026, Leesoo Ahn wrote:
> Switch to using memdup_user to allocate its memory because the size of
> kvm_guest_debug is over 512 bytes on Arm64 and is burdened allocation
> from kernel stack.

520 bytes is a lot, but it's not _that_ much, especially since
kvm_arch_vcpu_ioctl_set_guest_debug() is leaf function (ignoring tracing).

Is there an actual problem on arm64? I.e. does this one particular allocation
lead to stack overflows that otherwise don't happen in KVM?