acrn-kernel/drivers
Amadeusz Sławiński a4de028446 ACPICA: Fix operand resolution
commit 7dfb216eda upstream.

In our tests we get UBSAN warning coming from ACPI parser. This is
caused by trying to resolve operands when there is none.

[    0.000000] Linux version 5.15.0-rc3chromeavsrel1.0.184+ (root@...) (gcc (Ubuntu 10.3.0-1ubuntu1~20.04) 10.3.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #1 SMP PREEMPT Sat Oct 16 00:08:27 UTC 2021
...
[ 14.719508] ================================================================================
[ 14.719551] UBSAN: array-index-out-of-bounds in /.../linux/drivers/acpi/acpica/dswexec.c:401:12
[ 14.719594] index -1 is out of range for type 'acpi_operand_object *[9]'
[ 14.719621] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.15.0-rc3chromeavsrel1.0.184+ #1
[ 14.719657] Hardware name: Intel Corp. Geminilake/GLK RVP2 LP4SD (07), BIOS GELKRVPA.X64.0214.B50.2009111159 09/11/2020
[ 14.719694] Call Trace:
[ 14.719712] dump_stack_lvl+0x38/0x49
[ 14.719749] dump_stack+0x10/0x12
[ 14.719775] ubsan_epilogue+0x9/0x45
[ 14.719801] __ubsan_handle_out_of_bounds.cold+0x44/0x49
[ 14.719835] acpi_ds_exec_end_op+0x1d7/0x6b5
[ 14.719870] acpi_ps_parse_loop+0x942/0xb34
...

Problem happens because WalkState->NumOperands is 0 and it is used when
trying to access into operands table. Actual code is:
WalkState->Operands [WalkState->NumOperands -1]
which causes out of bound access. Improve the check before above access
to check if ACPI opcode should have any arguments (operands) at all.

Link: https://github.com/acpica/acpica/pull/745
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2024-04-24 22:17:18 +02:00
..
accel
accessibility
acpi ACPICA: Fix operand resolution 2024-04-24 22:17:18 +02:00
amba
android binder: signal epoll threads of self-work 2024-02-23 09:12:39 +01:00
ata ahci: Extend ASM1061 43-bit DMA address quirk to other ASM106x parts 2024-03-01 13:26:39 +01:00
atm
auxdisplay
base This is the 6.1.80 stable release 2024-03-22 01:33:06 +08:00
bcma
block This is the 6.1.80 stable release 2024-03-22 01:33:06 +08:00
bluetooth
bus This is the 6.1.80 stable release 2024-03-22 01:33:06 +08:00
cdrom
char Merge branch 'my/v6.1.77' into lts2022/linux 2024-02-28 13:19:46 +08:00
clk Merge branch 'my/v6.1.77' into lts2022/linux 2024-02-28 13:19:46 +08:00
clocksource
comedi
connector
counter
cpufreq Merge branch 'my/v6.1.77' into lts2022/linux 2024-02-28 13:19:46 +08:00
cpuidle
crypto This is the 6.1.80 stable release 2024-03-22 01:33:06 +08:00
cxl This is the 6.1.80 stable release 2024-03-22 01:33:06 +08:00
dax
dca
devfreq
dio
dma dmaengine: ti: edma: Add some null pointer checks to the edma_probe 2024-03-01 13:26:26 +01:00
dma-buf
edac Merge branch 'my/v6.1.77' into lts2022/linux 2024-02-28 13:19:46 +08:00
eisa
extcon
firewire This is the 6.1.80 stable release 2024-03-22 01:33:06 +08:00
firmware This is the 6.1.80 stable release 2024-03-22 01:33:06 +08:00
fpga
fsi
gnss
gpio Merge branch 'my/v6.1.77' into lts2022/linux 2024-02-28 13:19:46 +08:00
gpu This is the 6.1.80 stable release 2024-03-22 01:33:06 +08:00
greybus
hid This is the 6.1.80 stable release 2024-03-22 01:33:06 +08:00
hsi
hte
hv
hwmon hwmon: (coretemp) Enlarge per package core count limit 2024-03-01 13:26:29 +01:00
hwspinlock
hwtracing
i2c This is the 6.1.80 stable release 2024-03-22 01:33:06 +08:00
i3c Merge branch 'my/v6.1.77' into lts2022/linux 2024-02-28 13:19:46 +08:00
idle
iio iio: imu: bno055: serdev requires REGMAP 2024-02-23 09:12:41 +01:00
infiniband This is the 6.1.80 stable release 2024-03-22 01:33:06 +08:00
input This is the 6.1.80 stable release 2024-03-22 01:33:06 +08:00
interconnect interconnect: qcom: sc8180x: Mark CO0 BCM keepalive 2024-02-23 09:12:34 +01:00
iommu Merge branch 'my/v6.1.77' into lts2022/linux 2024-02-28 13:19:46 +08:00
ipack
irqchip This is the 6.1.80 stable release 2024-03-22 01:33:06 +08:00
isdn
leds
macintosh
mailbox
mcb
md This is the 6.1.80 stable release 2024-03-22 01:33:06 +08:00
media This is the 6.1.80 stable release 2024-03-22 01:33:06 +08:00
memory
memstick
message
mfd Merge branch 'my/v6.1.77' into lts2022/linux 2024-02-28 13:19:46 +08:00
misc This is the 6.1.80 stable release 2024-03-22 01:33:06 +08:00
mmc This is the 6.1.80 stable release 2024-03-22 01:33:06 +08:00
most
mtd This is the 6.1.80 stable release 2024-03-22 01:33:06 +08:00
mux
net This is the 6.1.80 stable release 2024-03-22 01:33:06 +08:00
nfc
ntb
nubus
nvdimm
nvme nvmet-fc: take ref count on tgtport before delete assoc 2024-03-01 13:26:28 +01:00
nvmem
of This is the 6.1.80 stable release 2024-03-22 01:33:06 +08:00
opp
parisc
parport
pci This is the 6.1.80 stable release 2024-03-22 01:33:06 +08:00
pcmcia
peci
perf
phy
pinctrl Merge branch 'my/v6.1.77' into lts2022/linux 2024-02-28 13:19:46 +08:00
platform This is the 6.1.80 stable release 2024-03-22 01:33:06 +08:00
pnp
power
powercap
pps
ps3
ptp
pwm
rapidio
ras
regulator regulator: pwm-regulator: Add validity checks in continuous .get_voltage 2024-03-01 13:26:26 +01:00
remoteproc
reset
rpmsg Merge branch 'my/v6.1.77' into lts2022/linux 2024-02-28 13:19:46 +08:00
rtc
s390 This is the 6.1.80 stable release 2024-03-22 01:33:06 +08:00
sbus
scsi This is the 6.1.80 stable release 2024-03-22 01:33:06 +08:00
sh
siox
slimbus
soc This is the 6.1.80 stable release 2024-03-22 01:33:06 +08:00
soundwire
spi This is the 6.1.80 stable release 2024-03-22 01:33:06 +08:00
spmi Merge branch 'my/v6.1.77' into lts2022/linux 2024-02-28 13:19:46 +08:00
ssb
staging This is the 6.1.80 stable release 2024-03-22 01:33:06 +08:00
target scsi: target: pscsi: Fix bio_put() for error case 2024-03-01 13:26:31 +01:00
tc
tcc
tee
thermal
thunderbolt Merge branch 'my/v6.1.77' into lts2022/linux 2024-02-28 13:19:46 +08:00
tty This is the 6.1.80 stable release 2024-03-22 01:33:06 +08:00
ufs scsi: ufs: core: Remove the ufshcd_release() in ufshcd_err_handling_prepare() 2024-03-01 13:26:30 +01:00
uio Merge branch 'my/v6.1.77' into lts2022/linux 2024-02-28 13:19:46 +08:00
usb This is the 6.1.80 stable release 2024-03-22 01:33:06 +08:00
vdpa
vfio This is the 6.1.80 stable release 2024-03-22 01:33:06 +08:00
vhost vhost: use kzalloc() instead of kmalloc() followed by memset() 2024-02-16 19:06:31 +01:00
video This is the 6.1.80 stable release 2024-03-22 01:33:06 +08:00
virt
virtio
vlynq
w1
watchdog
xen Merge branch 'my/v6.1.77' into lts2022/linux 2024-02-28 13:19:46 +08:00
zorro
Kconfig
Makefile