linux-stable/drivers
Ashish Kalra 43d2748394 ACPI: APEI: Fix integer overflow in ghes_estatus_pool_init()
Change num_ghes from int to unsigned int, preventing an overflow
and causing subsequent vmalloc() to fail.

The overflow happens in ghes_estatus_pool_init() when calculating
len during execution of the statement below as both multiplication
operands here are signed int:

len += (num_ghes * GHES_ESOURCE_PREALLOC_MAX_SIZE);

The following call trace is observed because of this bug:

[    9.317108] swapper/0: vmalloc error: size 18446744071562596352, exceeds total pages, mode:0xcc0(GFP_KERNEL), nodemask=(null),cpuset=/,mems_allowed=0-1
[    9.317131] Call Trace:
[    9.317134]  <TASK>
[    9.317137]  dump_stack_lvl+0x49/0x5f
[    9.317145]  dump_stack+0x10/0x12
[    9.317146]  warn_alloc.cold+0x7b/0xdf
[    9.317150]  ? __device_attach+0x16a/0x1b0
[    9.317155]  __vmalloc_node_range+0x702/0x740
[    9.317160]  ? device_add+0x17f/0x920
[    9.317164]  ? dev_set_name+0x53/0x70
[    9.317166]  ? platform_device_add+0xf9/0x240
[    9.317168]  __vmalloc_node+0x49/0x50
[    9.317170]  ? ghes_estatus_pool_init+0x43/0xa0
[    9.317176]  vmalloc+0x21/0x30
[    9.317177]  ghes_estatus_pool_init+0x43/0xa0
[    9.317179]  acpi_hest_init+0x129/0x19c
[    9.317185]  acpi_init+0x434/0x4a4
[    9.317188]  ? acpi_sleep_proc_init+0x2a/0x2a
[    9.317190]  do_one_initcall+0x48/0x200
[    9.317195]  kernel_init_freeable+0x221/0x284
[    9.317200]  ? rest_init+0xe0/0xe0
[    9.317204]  kernel_init+0x1a/0x130
[    9.317205]  ret_from_fork+0x22/0x30
[    9.317208]  </TASK>

Signed-off-by: Ashish Kalra <ashish.kalra@amd.com>
[ rjw: Subject and changelog edits ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2022-10-13 20:40:09 +02:00
..
accessibility
acpi ACPI: APEI: Fix integer overflow in ghes_estatus_pool_init() 2022-10-13 20:40:09 +02:00
amba
android Scheduler changes for v6.1: 2022-10-10 09:10:28 -07:00
ata ata changes for 6.1-rc1 2022-10-07 10:48:49 -07:00
atm
auxdisplay
base RISC-V Patches for the 6.1 Merge Window, Part 1 2022-10-09 13:24:01 -07:00
bcma
block Driver core changes for 6.1-rc1 2022-10-07 17:04:10 -07:00
bluetooth
bus Char/Misc and other driver changes for 6.1-rc1 2022-10-08 08:56:37 -07:00
cdrom
char tpmdd updates for Linux v6.1-rc1 2022-10-10 13:09:33 -07:00
clk Here's the main clk pull request for this merge window. We have some 2022-10-08 10:06:48 -07:00
clocksource A boring time, timekeeping, timers update: 2022-10-10 10:16:00 -07:00
comedi
connector
counter gpio updates for v6.1-rc1 2022-10-08 09:46:29 -07:00
cpufreq Char/Misc and other driver changes for 6.1-rc1 2022-10-08 08:56:37 -07:00
cpuidle RISC-V Patches for the 6.1 Merge Window, Part 1 2022-10-09 13:24:01 -07:00
crypto This update includes the following changes: 2022-10-10 13:04:25 -07:00
cxl
dax
dca
devfreq
dio
dma dmaengine updates for v6.1-rc1 2022-10-07 15:56:34 -07:00
dma-buf whack-a-mole: cropped up open-coded file_inode() uses... 2022-10-06 17:22:11 -07:00
edac Merge branches 'edac-drivers' and 'edac-misc' into edac-updates-for-v6.1 2022-10-04 10:00:25 +02:00
eisa
extcon Char/Misc and other driver changes for 6.1-rc1 2022-10-08 08:56:37 -07:00
firewire
firmware EFI updates for v6.1 2022-10-09 08:56:54 -07:00
fpga Char/Misc and other driver changes for 6.1-rc1 2022-10-08 08:56:37 -07:00
fsi
gnss
gpio More ACPI updates for 6.1-rc1 2022-10-10 13:28:06 -07:00
gpu IOMMU Updates for Linux v6.1: 2022-10-10 13:20:53 -07:00
greybus
hid Assorted HID drivers updates and fixes for 6.1 2022-10-07 11:13:42 -07:00
hsi
hte
hv Merge branch 'acpi-dev' 2022-09-30 20:05:16 +02:00
hwmon Char/Misc and other driver changes for 6.1-rc1 2022-10-08 08:56:37 -07:00
hwspinlock
hwtracing Char/Misc and other driver changes for 6.1-rc1 2022-10-08 08:56:37 -07:00
i2c More ACPI updates for 6.1-rc1 2022-10-10 13:28:06 -07:00
i3c
idle
iio Char/Misc and other driver changes for 6.1-rc1 2022-10-08 08:56:37 -07:00
infiniband v6.1 merge window pull request 2022-10-07 12:05:29 -07:00
input * 'remove' callback converted to return void. Big change with trivial 2022-10-04 18:54:33 -07:00
interconnect
iommu IOMMU Updates for Linux v6.1: 2022-10-10 13:20:53 -07:00
ipack Char/Misc and other driver changes for 6.1-rc1 2022-10-08 08:56:37 -07:00
irqchip IOMMU Updates for Linux v6.1: 2022-10-10 13:20:53 -07:00
isdn Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-10-03 17:44:18 -07:00
leds platform-drivers-x86 for v6.1-1 2022-10-05 10:38:24 -07:00
macintosh powerpc updates for 6.1 2022-10-09 14:05:15 -07:00
mailbox mailbox: qcom-ipcc: flag IRQ NO_THREAD 2022-10-05 21:51:58 -05:00
mcb
md for-6.1/passthrough-2022-10-04 2022-10-07 09:35:50 -07:00
media Scheduler changes for v6.1: 2022-10-10 09:10:28 -07:00
memory
memstick
message
mfd - Core Frameworks 2022-10-07 11:24:20 -07:00
misc Char/Misc and other driver changes for 6.1-rc1 2022-10-08 08:56:37 -07:00
mmc TTY/Serial driver update for 6.1-rc1 2022-10-07 16:36:24 -07:00
most
mtd Char/Misc and other driver changes for 6.1-rc1 2022-10-08 08:56:37 -07:00
mux
net This update includes the following changes: 2022-10-10 13:04:25 -07:00
nfc
ntb
nubus
nvdimm
nvme for-6.1/passthrough-2022-10-04 2022-10-07 09:35:50 -07:00
nvmem
of Devicetree updates for v6.1: 2022-10-10 13:13:51 -07:00
opp
parisc asm-generic updates for v6.1 2022-10-06 12:10:37 -07:00
parport
pci
pcmcia
peci
perf Perf events updates for v6.1: 2022-10-10 09:27:46 -07:00
phy USB/Thunderbolt changes for 6.1-rc1 2022-10-07 16:48:26 -07:00
pinctrl ARM: driver updates for 6.1 2022-10-06 11:04:57 -07:00
platform More ACPI updates for 6.1-rc1 2022-10-10 13:28:06 -07:00
pnp Merge branches 'acpi-apei', 'acpi-wakeup', 'acpi-reboot' and 'acpi-thermal' 2022-10-10 18:11:11 +02:00
power power supply and reset changes for the v6.1 series 2022-10-07 11:48:30 -07:00
powercap Scheduler changes for v6.1: 2022-10-10 09:10:28 -07:00
pps
ps3
ptp
pwm pwm: Changes for v6.1-rc1 2022-10-07 11:32:10 -07:00
rapidio
ras
regulator - Core Frameworks 2022-10-07 11:24:20 -07:00
remoteproc remoteproc: virtio: Fix warning on bindings by removing the of_match_table 2022-10-05 09:20:44 -06:00
reset Here's the main clk pull request for this merge window. We have some 2022-10-08 10:06:48 -07:00
rpmsg
rtc
s390 s390 updates for the 6.1 merge window 2022-10-09 13:51:40 -07:00
sbus
scsi Scheduler changes for v6.1: 2022-10-10 09:10:28 -07:00
sh
siox
slimbus
soc Char/Misc and other driver changes for 6.1-rc1 2022-10-08 08:56:37 -07:00
soundwire soundwire updates for 6.1-rc1 2022-10-07 16:13:55 -07:00
spi spi: Updates for v6.1 2022-10-04 19:36:53 -07:00
spmi spmi: pmic-arb: increase SPMI transaction timeout delay 2022-09-30 14:33:23 +02:00
ssb
staging Here's the main clk pull request for this merge window. We have some 2022-10-08 10:06:48 -07:00
target SCSI misc on 20221007 2022-10-07 12:33:18 -07:00
tc
tee ARM: driver updates for 6.1 2022-10-06 11:04:57 -07:00
thermal Char/Misc and other driver changes for 6.1-rc1 2022-10-08 08:56:37 -07:00
thunderbolt USB/Thunderbolt changes for 6.1-rc1 2022-10-07 16:48:26 -07:00
tty TTY/Serial driver update for 6.1-rc1 2022-10-07 16:36:24 -07:00
ufs SCSI misc on 20221007 2022-10-07 12:33:18 -07:00
uio
usb USB/Thunderbolt changes for 6.1-rc1 2022-10-07 16:48:26 -07:00
vdpa Networking changes for 6.1. 2022-10-04 13:38:03 -07:00
vfio
vhost Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-10-03 17:44:18 -07:00
video drm pull for 6.1-rc1 2022-10-05 11:24:12 -07:00
virt Char/Misc and other driver changes for 6.1-rc1 2022-10-08 08:56:37 -07:00
virtio
vlynq
w1 Char/Misc and other driver changes for 6.1-rc1 2022-10-08 08:56:37 -07:00
watchdog powerpc updates for 6.1 2022-10-09 14:05:15 -07:00
xen SCSI misc on 20221007 2022-10-07 12:33:18 -07:00
zorro
Kconfig
Makefile