]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: KVM: Tighten guest core register access from userspace
authorDave Martin <Dave.Martin@arm.com>
Thu, 27 Sep 2018 15:53:21 +0000 (16:53 +0100)
committerWill Deacon <will.deacon@arm.com>
Mon, 1 Oct 2018 13:38:05 +0000 (14:38 +0100)
commita633a832acc80883a131c819f5732caa7a2e4938
treea7d45ee45745dda7244f599d6374486672535417
parent33083d03e01ee324c542084769ff7a61e0c94c13
arm64: KVM: Tighten guest core register access from userspace

We currently allow userspace to access the core register file
in about any possible way, including straddling multiple
registers and doing unaligned accesses.

This is not the expected use of the ABI, and nobody is actually
using it that way. Let's tighten it by explicitly checking
the size and alignment for each field of the register file.

Cc: <stable@vger.kernel.org>
Fixes: 9a0c8875e3d2 ("arm64: KVM: guest one-reg interface")
Reviewed-by: Christoffer Dall <christoffer.dall@arm.com>
Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Dave Martin <Dave.Martin@arm.com>
[maz: rewrote Dave's initial patch to be more easily backported]
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm64/kvm/guest.c