linux/drivers
Ard Biesheuvel 2a2f9b87c4 x86/efistub: Omit physical KASLR when memory reservations exist
commit 15aa8fb852 upstream.

The legacy decompressor has elaborate logic to ensure that the
randomized physical placement of the decompressed kernel image does not
conflict with any memory reservations, including ones specified on the
command line using mem=, memmap=, efi_fake_mem= or hugepages=, which are
taken into account by the kernel proper at a later stage.

When booting in EFI mode, it is the firmware's job to ensure that the
chosen range does not conflict with any memory reservations that it
knows about, and this is trivially achieved by using the firmware's
memory allocation APIs.

That leaves reservations specified on the command line, though, which
the firmware knows nothing about, as these regions have no other special
significance to the platform. Since commit

  a1b87d54f4 ("x86/efistub: Avoid legacy decompressor when doing EFI boot")

these reservations are not taken into account when randomizing the
physical placement, which may result in conflicts where the memory
cannot be reserved by the kernel proper because its own executable image
resides there.

To avoid having to duplicate or reuse the existing complicated logic,
disable physical KASLR entirely when such overrides are specified. These
are mostly diagnostic tools or niche features, and physical KASLR (as
opposed to virtual KASLR, which is much more important as it affects the
memory addresses observed by code executing in the kernel) is something
we can live without.

Closes: https://lkml.kernel.org/r/FA5F6719-8824-4B04-803E-82990E65E627%40akamai.com
Reported-by: Ben Chaney <bchaney@akamai.com>
Fixes: a1b87d54f4 ("x86/efistub: Avoid legacy decompressor when doing EFI boot")
Cc:  <stable@vger.kernel.org> # v6.1+
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-06-12 11:13:01 +02:00
..
accel kthread: add kthread_stop_put 2024-06-12 11:12:52 +02:00
accessibility speakup: Fix sizeof() vs ARRAY_SIZE() bug 2024-06-12 11:11:18 +02:00
acpi x86/numa: Fix SRAT lookup of CFMWS ranges with numa_fill_memblks() 2024-06-12 11:11:50 +02:00
amba
android binder: fix max_thread type inconsistency 2024-05-25 16:22:54 +02:00
ata ata: sata_gemini: Check clk_enable() result 2024-05-17 12:02:13 +02:00
atm
auxdisplay
base module: don't ignore sysfs_create_link() failures 2024-06-12 11:12:17 +02:00
bcma
block null_blk: Fix the WARNING: modpost: missing MODULE_DESCRIPTION() 2024-06-12 11:12:44 +02:00
bluetooth Bluetooth: HCI: Remove HCI_AMP support 2024-06-12 11:11:55 +02:00
bus bus: mhi: host: Add MHI_PM_SYS_ERR_FAIL state 2024-04-13 13:07:38 +02:00
cache
cdrom
cdx
char tpm_tis_spi: Account for SPI header when allocating TPM SPI xfer buffer 2024-06-12 11:12:51 +02:00
clk clk: qcom: mmcc-msm8998: fix venus clock issue 2024-06-12 11:12:08 +02:00
clocksource clocksource/drivers/arm_global_timer: Fix maximum prescaler value 2024-04-03 15:28:50 +02:00
comedi comedi: vmk80xx: fix incomplete endpoint checking 2024-04-27 17:11:39 +02:00
connector
counter
cpufreq cpufreq: brcmstb-avs-cpufreq: ISO C90 forbids mixed declarations 2024-06-12 11:11:45 +02:00
cpuidle cpuidle: Avoid potential overflow in integer multiplication 2024-04-13 13:07:29 +02:00
crypto crypto: qat - specify firmware files for 402xx 2024-06-12 11:11:34 +02:00
cxl cxl/region: Fix cxlr_pmem leaks 2024-06-12 11:12:42 +02:00
dax
dca
devfreq
dio
dma dmaengine: idxd: Avoid unnecessary destruction of file_ida 2024-06-12 11:12:25 +02:00
dma-buf dma-buf/sw-sync: don't enable IRQ from sync_print_obj() 2024-06-12 11:12:54 +02:00
edac
eisa
extcon extcon: max8997: select IRQ_DOMAIN instead of depending on it 2024-06-12 11:12:27 +02:00
firewire firewire: ohci: fulfill timestamp for some local asynchronous transaction 2024-05-17 12:02:30 +02:00
firmware x86/efistub: Omit physical KASLR when memory reservations exist 2024-06-12 11:13:01 +02:00
fpga fpga: region: add owner module and take its refcount 2024-06-12 11:12:23 +02:00
fsi
gnss
gpio gpiolib: acpi: Fix failed in acpi_gpiochip_find() by adding parent node match 2024-06-12 11:12:34 +02:00
gpu drm/panel: sitronix-st7789v: fix display size for jt240mhqs_hwt_ek_e3 panel 2024-06-12 11:13:00 +02:00
greybus
hid HID: amd_sfh: Handle "no sensors" in PM operations 2024-06-12 11:11:50 +02:00
hsi
hte
hv Drivers: hv: vmbus: Don't free ring buffers that couldn't be re-encrypted 2024-05-17 12:02:17 +02:00
hwmon hwmon: (shtc1) Fix property misspelling 2024-06-12 11:13:00 +02:00
hwspinlock
hwtracing stm class: Fix a double free in stm_register_device() 2024-06-12 11:12:26 +02:00
i2c i2c: synquacer: Fix an error handling path in synquacer_i2c_probe() 2024-06-12 11:12:26 +02:00
i3c i3c: master: svc: change ENXIO to EAGAIN when IBI occurs during start frame 2024-06-12 11:12:50 +02:00
idle
iio iio: accel: mxc4005: Reset chip on probe() and resume() 2024-06-12 11:12:34 +02:00
infiniband RDMA/cma: Fix kmemleak in rdma_core observed during blktests nvme/rdma use siw 2024-06-12 11:12:11 +02:00
input Input: cyapa - add missing input core locking to suspend/resume functions 2024-06-12 11:12:40 +02:00
interconnect interconnect: qcom: qcm2290: Fix mas_snoc_bimc QoS port assignment 2024-06-12 11:12:18 +02:00
iommu iommu: Undo pasid attachment only for the devices that have succeeded 2024-06-12 11:12:06 +02:00
ipack
irqchip irqchip/loongson-pch-msi: Fix off-by-one on allocation error path 2024-06-12 11:11:40 +02:00
isdn
leds leds: pwm: Disable PWM when going to suspend 2024-06-12 11:12:24 +02:00
macintosh macintosh/via-macii: Fix "BUG: sleeping function called from invalid context" 2024-06-12 11:11:47 +02:00
mailbox
mcb
md md: fix resync softlockup when bitmap size is less than array size 2024-06-12 11:11:34 +02:00
media media: cec: core: avoid confusing "transmit timed out" message 2024-06-12 11:12:43 +02:00
memory
memstick
message
mfd
misc misc/pvpanic-pci: register attributes via pci_driver 2024-06-12 11:12:35 +02:00
mmc mmc: sdhci_am654: Fix ITAPDLY for HS400 timing 2024-06-12 11:12:37 +02:00
most
mtd mtd: rawnand: hynix: fixed typo 2024-06-12 11:11:58 +02:00
mux
net ipvlan: Dont Use skb->sk in ipvlan_process_v{4,6}_outbound 2024-06-12 11:12:59 +02:00
nfc NFC: trf7970a: disable all regulators on removal 2024-05-02 16:32:36 +02:00
ntb
nubus
nvdimm
nvme nvmet: fix ns enable/disable possible hang 2024-06-12 11:12:53 +02:00
nvmem nvmem: add explicit config option to read old syntax fixed OF cells 2024-05-17 12:01:55 +02:00
of of: module: add buffer overflow check in of_modalias() 2024-06-12 11:12:10 +02:00
opp
parisc
parport
pci PCI/EDR: Align EDR_PORT_LOCATE_DSM with PCI Firmware r3.3 2024-06-12 11:12:27 +02:00
pcmcia
peci
perf perf/arm-dmc620: Fix lockdep assert in ->event_init() 2024-06-12 11:12:46 +02:00
phy phy: qcom: qmp-combo: fix duplicate return in qmp_v4_configure_dp_phy 2024-06-12 11:12:14 +02:00
pinctrl pinctrl: qcom: pinctrl-sm7150: Fix sdc1 and ufs special pins regs 2024-06-12 11:12:24 +02:00
platform platform/x86: thinkpad_acpi: Take hotkey_mutex during hotkey_exit() 2024-06-12 11:12:41 +02:00
pmdomain pmdomain: imx8mp-blk-ctrl: imx8mp_blk: Add fdcc clock to hdmimix domain 2024-04-13 13:07:30 +02:00
pnp
power power: supply: mt6360_charger: Fix of_match for usb-otg-vbus regulator 2024-05-17 12:01:58 +02:00
powercap powercap: intel_rapl_tpmi: Fix System Domain probing 2024-04-03 15:28:19 +02:00
pps
ps3
ptp
pwm pwm: Rename pwm_apply_state() to pwm_apply_might_sleep() 2024-06-12 11:12:24 +02:00
rapidio
ras
regulator regulator: tps6594-regulator: Correct multi-phase configuration 2024-06-12 11:12:48 +02:00
remoteproc remoteproc: mediatek: Make sure IPI buffer fits in L2TCM 2024-05-25 16:22:55 +02:00
reset
rpmsg
rtc nvmem: add explicit config option to read old syntax fixed OF cells 2024-05-17 12:01:55 +02:00
s390 s390/cio: fix tracepoint subchannel type field 2024-06-12 11:11:32 +02:00
sbus
scsi scsi: qla2xxx: Fix debugfs output for fw_resource_count 2024-06-12 11:11:50 +02:00
sh
siox
slimbus slimbus: qcom-ngd-ctrl: Add timeout for wait operation 2024-05-17 12:02:33 +02:00
soc soc: qcom: pmic_glink: Make client-lock non-sleeping 2024-06-12 11:11:34 +02:00
soundwire soundwire: cadence: fix invalid PDI offset 2024-06-12 11:12:15 +02:00
spi spi: stm32: Don't warn about spurious interrupts 2024-06-12 11:12:59 +02:00
spmi
ssb
staging greybus: arche-ctrl: move device table to its right location 2024-06-12 11:12:17 +02:00
target scsi: target: Fix SELinux error when systemd-modules loads the target module 2024-05-17 12:02:15 +02:00
tc
tee tee: optee: Fix kernel panic caused by incorrect error handling 2024-04-03 15:28:44 +02:00
thermal thermal/drivers/tsens: Fix null pointer dereference 2024-06-12 11:11:43 +02:00
thunderbolt thunderbolt: Reset only non-USB4 host routers in resume 2024-04-27 17:11:44 +02:00
tty serial: sc16is7xx: fix bug in sc16is7xx_set_baud() when using prescaler 2024-06-12 11:12:35 +02:00
ufs scsi: ufs: core: mcq: Fix ufshcd_mcq_sqe_search() 2024-06-12 11:11:45 +02:00
uio uio_hv_generic: Don't free decrypted memory 2024-05-17 12:02:17 +02:00
usb kthread: add kthread_stop_put 2024-06-12 11:12:52 +02:00
vdpa vdpa/mlx5: Allow CVQ size changes 2024-03-26 18:20:10 -04:00
vfio vfio/pci: fix potential memory leak in vfio_intx_enable() 2024-06-12 11:12:22 +02:00
vhost vhost: Add smp_rmb() in vhost_enable_notify() 2024-04-17 11:19:35 +02:00
video pwm: Rename pwm_apply_state() to pwm_apply_might_sleep() 2024-06-12 11:12:24 +02:00
virt drivers/virt/acrn: fix PFNMAP PTE checks in acrn_vm_ram_map() 2024-06-12 11:12:09 +02:00
virtio virtio: delete vq in vp_find_vqs_msix() when request_irq() fails 2024-06-12 11:12:49 +02:00
vlynq
w1 nvmem: add explicit config option to read old syntax fixed OF cells 2024-05-17 12:01:55 +02:00
watchdog watchdog: sa1100: Fix PTR_ERR_OR_ZERO() vs NULL check in sa1100dog_probe() 2024-06-12 11:12:25 +02:00
xen drivers/xen: Improve the late XenStore init protocol 2024-06-12 11:12:51 +02:00
zorro
Kconfig
Makefile