No description
Find a file
Marc Zyngier 511ff49371 KVM: arm64: Fix AArch32 register narrowing on userspace write
commit 947051e361 upstream.

When userspace writes to one of the core registers, we make
sure to narrow the corresponding GPRs if PSTATE indicates
an AArch32 context.

The code tries to check whether the context is EL0 or EL1 so
that it narrows the correct registers. But it does so by checking
the full PSTATE instead of PSTATE.M.

As a consequence, and if we are restoring an AArch32 EL0 context
in a 64bit guest, and that PSTATE has *any* bit set outside of
PSTATE.M, we narrow *all* registers instead of only the first 15,
destroying the 64bit state.

Obviously, this is not something the guest is likely to enjoy.

Correctly masking PSTATE to only evaluate PSTATE.M fixes it.

Fixes: 90c1f934ed ("KVM: arm64: Get rid of the AArch32 register mapping code")
Reported-by: Nina Schoetterl-Glausch <nsg@linux.ibm.com>
Cc: stable@vger.kernel.org
Reviewed-by: Nina Schoetterl-Glausch <nsg@linux.ibm.com>
Acked-by: Oliver Upton <oliver.upton@linux.dev>
Link: https://lore.kernel.org/r/20240524141956.1450304-2-maz@kernel.org
Signed-off-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-06-16 13:39:58 +02:00
arch KVM: arm64: Fix AArch32 register narrowing on userspace write 2024-06-16 13:39:58 +02:00
block blk-iocost: avoid out of bounds shift 2024-05-17 11:50:54 +02:00
certs
crypto Revert "crypto: api - Disallow identical driver names" 2024-05-02 16:24:47 +02:00
Documentation net: ena: Add dynamic recycling mechanism for rx buffers 2024-06-16 13:39:52 +02:00
drivers drm/amdgpu/atomfirmware: add intergrated info v2.3 table 2024-06-16 13:39:57 +02:00
fs f2fs: fix to do sanity check on i_xattr_nid in sanity_check_inode() 2024-06-16 13:39:55 +02:00
include mmc: core: Add mmc_gpiod_set_cd_config() function 2024-06-16 13:39:57 +02:00
init init/main.c: Fix potential static_command_line memory overflow 2024-04-27 17:05:28 +02:00
io_uring io_uring: fail NOP if non-zero op flags is passed in 2024-06-16 13:39:53 +02:00
ipc
kernel genirq/cpuhotplug, x86/vector: Prevent vector leak during CPU offline 2024-06-16 13:39:52 +02:00
lib mm/slub, kunit: Use inverted data to corrupt kmem cache 2024-06-16 13:39:16 +02:00
LICENSES
mm x86/mm/pat: fix VM_PAT handling in COW mappings 2024-04-13 13:01:47 +02:00
net sunrpc: exclude from freezer when waiting for requests: 2024-06-16 13:39:55 +02:00
samples samples/hw_breakpoint: fix building without module unloading 2023-09-23 11:10:01 +02:00
scripts scripts/gdb: fix SB_* constants parsing 2024-06-16 13:39:54 +02:00
security KEYS: trusted: Do not use WARN when encode fails 2024-05-25 16:20:18 +02:00
sound ALSA: timer: Set lower bound of start tick time 2024-06-16 13:39:52 +02:00
tools bpf: Fix potential integer overflow in resolve_btfids 2024-06-16 13:39:50 +02:00
usr
virt KVM: Always flush async #PF workqueue when vCPU is being destroyed 2024-04-10 16:18:34 +02:00
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS trace: Relocate event helper files 2024-04-10 16:19:24 +02:00
Makefile Linux 5.15.160 2024-05-25 16:20:19 +02:00
README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.