OrangePi_CM5/drivers/acpi
Ashish Kalra 9edf20e5a1 ACPI: APEI: Fix integer overflow in ghes_estatus_pool_init()
[ Upstream commit 43d2748394c3feb86c0c771466f5847e274fc043 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-11-10 18:14:22 +01:00
..
acpica ACPICA: Avoid walking the ACPI Namespace if it is not there 2022-04-08 14:40:31 +02:00
apei ACPI: APEI: Fix integer overflow in ghes_estatus_pool_init() 2022-11-10 18:14:22 +01:00
arm64 ACPI/IORT: Check node revision for PMCG resources 2022-02-16 12:54:22 +01:00
dptf
…
nfit ACPI: NFIT: Use fallback node id when numa info in NFIT table is incorrect 2021-10-06 15:55:46 +02:00
numa treewide: Change list_sort to use const pointers 2021-09-30 10:11:04 +02:00
pmic ACPI: PMIC: Fix intel_pmic_regs_handler() read accesses 2021-11-18 14:04:26 +01:00
x86 ACPI / x86: Add not-present quirk for the PCI0.SDHB.BRC1 device on the GPD win 2022-01-27 10:54:13 +01:00
Kconfig
…
Makefile
…
ac.c ACPI: AC: Quirk GK45 to skip reading _PSR 2021-11-18 14:04:00 +01:00
acpi_adxl.c
…
acpi_amba.c
…
acpi_apd.c
…
acpi_cmos_rtc.c
…
acpi_configfs.c
…
acpi_dbg.c
…
acpi_extlog.c ACPI: extlog: Handle multiple records 2022-10-30 09:41:16 +01:00
acpi_ipmi.c
…
acpi_lpat.c
…
acpi_lpit.c
…
acpi_lpss.c ACPI: LPSS: Fix missing check in register_device_clock() 2022-08-21 15:15:30 +02:00
acpi_memhotplug.c
…
acpi_pad.c
…
acpi_platform.c
…
acpi_pnp.c
…
acpi_processor.c
…
acpi_tad.c
…
acpi_video.c ACPI: video: Add Toshiba Satellite/Portege Z830 quirk 2022-10-26 13:25:44 +02:00
acpi_watchdog.c
…
battery.c ACPI: battery: Add device HID and quirk for Microsoft Surface Go 3 2022-03-28 09:57:10 +02:00
bgrt.c
…
blacklist.c
…
bus.c ACPI: Change acpi_device_always_present() into acpi_device_override_status() 2022-01-27 10:54:13 +01:00
button.c
…
container.c
…
cppc_acpi.c ACPI: CPPC: Do not prevent CPPC from working in the future 2022-08-21 15:16:20 +02:00
custom_method.c
…
debugfs.c
…
device_pm.c
…
device_sysfs.c
…
dock.c
…
ec.c ACPI: EC: Drop the EC_FLAGS_IGNORE_DSDT_GPE quirk 2022-08-21 15:15:30 +02:00
ec_sys.c
…
event.c
…
evged.c
…
fan.c
…
fan.h
…
glue.c
…
hed.c
…
internal.h ACPI: EC: Rework flushing of EC work while suspended to idle 2022-01-27 10:53:52 +01:00
ioapic.c
…
irq.c
…
nvs.c
…
osi.c
…
osl.c
…
pci_irq.c
…
pci_link.c
…
pci_mcfg.c PCI/ACPI: Guard ARM64-specific mcfg_quirks 2022-08-25 11:38:16 +02:00
pci_root.c
…
pci_slot.c
…
power.c
…
pptt.c
…
proc.c
…
processor_core.c
…
processor_driver.c
…
processor_idle.c ACPI: processor/idle: Annotate more functions to live in cpuidle section 2022-08-21 15:15:32 +02:00
processor_pdc.c
…
processor_perflib.c
…
processor_thermal.c ACPI: processor: Remove freq Qos request for all CPUs 2022-08-31 17:15:23 +02:00
processor_throttling.c
…
property.c ACPI: property: Return type of acpi_add_nondev_subnodes() should be bool 2022-08-25 11:37:58 +02:00
reboot.c
…
resource.c
…
sbs.c
…
sbshc.c
…
sbshc.h
…
scan.c ACPI: scan: Create platform device for BCM4752 and LNV4752 ACPI nodes 2022-01-27 10:54:00 +01:00
sleep.c ACPI: PM: save NVS memory for Lenovo G40-45 2022-08-21 15:15:30 +02:00
sleep.h
…
spcr.c
…
sysfs.c ACPI: sysfs: Fix BERT error region memory mapping 2022-05-30 09:33:23 +02:00
tables.c
…
thermal.c
…
tiny-power-button.c
…
utils.c
…
video_detect.c ACPI: video: Force backlight native for more TongFang devices 2022-10-30 09:41:19 +01:00
wakeup.c
…