Subject: CVE-2024-43868: riscv/purgatory: align riscv_kernel_entry

From: Greg Kroah-Hartman <[email-masked]>

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

riscv/purgatory: align riscv_kernel_entry

When alignment handling is delegated to the kernel, everything must be
word-aligned in purgatory, since the trap handler is then set to the
kexec one. Without the alignment, hitting the exception would
ultimately crash. On other occasions, the kernel's handler would take
care of exceptions.
This has been tested on a JH7110 SoC with oreboot and its SBI delegating
unaligned access exceptions and the kernel configured to handle them.

The Linux kernel CVE team has assigned CVE-2024-43868 to this issue.

Affected and fixed versions
===========================

	Issue introduced in 5.19 with commit 736e30af583f and fixed in 6.10.4 with commit 5d4aaf16a825
	Issue introduced in 5.19 with commit 736e30af583f and fixed in 6.11 with commit fb197c5d2fd2

Please see https://www.kernel.org for a full list of currently supported
kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to
older supported kernel versions.  The official CVE entry at
	https://cve.org/CVERecord/?id=CVE-2024-43868
will be updated if fixes are backported, please check that for the most
up to date information about this issue.

Affected files
==============

The file(s) affected by this issue are:
	arch/riscv/purgatory/entry.S

Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest
stable kernel version for this, and many other bugfixes.  Individual
changes are never tested alone, but rather are part of a larger kernel
release.  Cherry-picking individual commits is not recommended or
supported by the Linux kernel community at all.  If however, updating to
the latest release is impossible, the individual changes to resolve this
issue can be found at these commits:
	https://git.kernel.org/stable/c/5d4aaf16a8255f7c71790e211724ba029609c5ff
	https://git.kernel.org/stable/c/fb197c5d2fd24b9af3d4697d0cf778645846d6d5