]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
arm64: compat: Ensure upper 32 bits of x0 are zero on syscall return
authorWill Deacon <will@kernel.org>
Fri, 3 Jul 2020 11:08:42 +0000 (12:08 +0100)
committerKhalid Elmously <khalid.elmously@canonical.com>
Sat, 8 Aug 2020 05:53:12 +0000 (01:53 -0400)
commit11768326df68de647a15b4ac5f167622281bb701
tree5e237be442da92de5007f9db22c0ee475bb489ef
parentb7e45ddc2b493463634f24c48adfb3ac0e57a2a2
arm64: compat: Ensure upper 32 bits of x0 are zero on syscall return

BugLink: https://bugs.launchpad.net/bugs/1888560
commit 15956689a0e60aa0c795174f3c310b60d8794235 upstream.

Although we zero the upper bits of x0 on entry to the kernel from an
AArch32 task, we do not clear them on the exception return path and can
therefore expose 64-bit sign extended syscall return values to userspace
via interfaces such as the 'perf_regs' ABI, which deal exclusively with
64-bit registers.

Explicitly clear the upper 32 bits of x0 on return from a compat system
call.

Cc: <stable@vger.kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Keno Fischer <keno@juliacomputing.com>
Cc: Luis Machado <luis.machado@linaro.org>
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
arch/arm64/include/asm/syscall.h
arch/arm64/kernel/syscall.c