linux/drivers/acpi
Vegard Nossum 8624e2c5af ACPICA: Always create namespace nodes using acpi_ns_create_node()
commit 25928deeb1e4e2cdae1dccff349320c6841eb5f8 upstream.

ACPICA commit 29da9a2a3f5b2c60420893e5c6309a0586d7a329

ACPI is allocating an object using kmalloc(), but then frees it
using kmem_cache_free(<"Acpi-Namespace" kmem_cache>).

This is wrong and can lead to boot failures manifesting like this:

    hpet0: 3 comparators, 64-bit 100.000000 MHz counter
    clocksource: Switched to clocksource tsc-early
    BUG: unable to handle page fault for address: 000000003ffe0018
    #PF: supervisor read access in kernel mode
    #PF: error_code(0x0000) - not-present page
    PGD 0 P4D 0
    Oops: 0000 [#1] SMP PTI
    CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.6.0+ #211
    Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
Ubuntu-1.8.2-1ubuntu1 04/01/2014
    RIP: 0010:kmem_cache_alloc+0x70/0x1d0
    Code: 00 00 4c 8b 45 00 65 49 8b 50 08 65 4c 03 05 6f cc e7 7e 4d 8b
20 4d 85 e4 0f 84 3d 01 00 00 8b 45 20 48 8b 7d 00 48 8d 4a 01 <49> 8b
   1c 04 4c 89 e0 65 48 0f c7 0f 0f 94 c0 84 c0 74 c5 8b 45 20
    RSP: 0000:ffffc90000013df8 EFLAGS: 00010206
    RAX: 0000000000000018 RBX: ffffffff81c49200 RCX: 0000000000000002
    RDX: 0000000000000001 RSI: 0000000000000dc0 RDI: 000000000002b300
    RBP: ffff88803e403d00 R08: ffff88803ec2b300 R09: 0000000000000001
    R10: 0000000000000dc0 R11: 0000000000000006 R12: 000000003ffe0000
    R13: ffffffff8110a583 R14: 0000000000000dc0 R15: ffffffff81c49a80
    FS:  0000000000000000(0000) GS:ffff88803ec00000(0000)
knlGS:0000000000000000
    CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    CR2: 000000003ffe0018 CR3: 0000000001c0a001 CR4: 00000000003606f0
    DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
    Call Trace:
     __trace_define_field+0x33/0xa0
     event_trace_init+0xeb/0x2b4
     tracer_init_tracefs+0x60/0x195
     ? register_tracer+0x1e7/0x1e7
     do_one_initcall+0x74/0x160
     kernel_init_freeable+0x190/0x1f0
     ? rest_init+0x9a/0x9a
     kernel_init+0x5/0xf6
     ret_from_fork+0x35/0x40
    CR2: 000000003ffe0018
    ---[ end trace 707efa023f2ee960 ]---
    RIP: 0010:kmem_cache_alloc+0x70/0x1d0

Bisection leads to unrelated changes in slab; Vlastimil Babka
suggests an unrelated layout or slab merge change merely exposed
the underlying bug.

Link: https://lore.kernel.org/lkml/4dc93ff8-f86e-f4c9-ebeb-6d3153a78d03@oracle.com/
Link: https://lore.kernel.org/r/a1461e21-c744-767d-6dfc-6641fd3e3ce2@siemens.com
Link: https://github.com/acpica/acpica/commit/29da9a2a
Fixes: f79c8e4136 ("ACPICA: Namespace: simplify creation of the initial/default namespace")
Reported-by: Jan Kiszka <jan.kiszka@siemens.com>
Diagnosed-by: Vlastimil Babka <vbabka@suse.cz>
Diagnosed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Erik Kaneda <erik.kaneda@intel.com>
Cc: 5.10+ <stable@vger.kernel.org> # 5.10+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: "Jason A. Donenfeld" <Jason@zx2c4.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-05-12 12:23:41 +02:00
..
acpica ACPICA: Always create namespace nodes using acpi_ns_create_node() 2022-05-12 12:23:41 +02:00
apei ACPI/APEI: Limit printable size of BERT table data 2022-04-15 14:18:23 +02:00
arm64 ACPI/IORT: Check node revision for PMCG resources 2022-02-16 12:52:50 +01:00
dptf treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
hmat ACPI: HMAT: Fix handling of changes from ACPI 6.2 to ACPI 6.3 2020-11-05 11:43:19 +01:00
nfit ACPI: NFIT: Fix support for virtual SPA ranges 2021-08-18 08:56:57 +02:00
pmic ACPI: PMIC: Fix intel_pmic_regs_handler() read accesses 2021-11-17 09:48:47 +01:00
x86 x86/intel: Aggregate big core mobile naming 2019-08-28 11:29:31 +02:00
Kconfig ia64: remove support for machvecs 2019-08-16 14:32:26 -07:00
Makefile ACPI: tables: Add custom DSDT file as makefile prerequisite 2021-07-14 16:53:19 +02:00
ac.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
acpi_adxl.c ACPI/ADXL: Add address translation interface using an ACPI DSM 2018-10-16 10:03:00 +02:00
acpi_amba.c ACPI: AMBA: Fix resource name in /proc/iomem 2021-07-20 16:10:48 +02:00
acpi_apd.c i2c: imx: ACPI support for NXP i2c controller 2019-09-13 15:12:38 +01:00
acpi_cmos_rtc.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
acpi_configfs.c ACPI: configfs: add missing check after configfs_register_default_group() 2021-03-04 10:26:40 +01:00
acpi_dbg.c ACPI: debug: don't allow debugging when ACPI is disabled 2020-11-05 11:43:25 +01:00
acpi_extlog.c ACPI / extlog: Check for RDMSR failure 2020-11-05 11:43:24 +01:00
acpi_ipmi.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
acpi_lpat.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174 2019-05-30 11:26:41 -07:00
acpi_lpit.c Merge branches 'acpi-pm' and 'pm-pci' 2019-07-08 10:49:36 +02:00
acpi_lpss.c ACPI: LPSS: Add dmi quirk for skipping _DEP check for some device-links 2019-12-17 19:56:32 +01:00
acpi_memhotplug.c mm/memory_hotplug: rename walk_memory_range() and pass start+size instead of pfns 2019-07-18 17:08:06 -07:00
acpi_pad.c ACPI: Use DEVICE_ATTR_<RW|RO|WO> macros 2021-07-14 16:53:25 +02:00
acpi_platform.c ACPI: platform: Unregister stale platform devices 2020-01-26 10:01:04 +01:00
acpi_pnp.c ACPI: PNP: compare the string length in the matching_id() 2020-12-30 11:51:32 +01:00
acpi_processor.c ACPI / processor: don't print errors for processorIDs == 0xff 2019-08-09 10:48:34 +02:00
acpi_tad.c ACPI: Use DEVICE_ATTR_<RW|RO|WO> macros 2021-07-14 16:53:25 +02:00
acpi_video.c ACPI: video: Add quirk for the Dell Vostro 3350 2021-07-20 16:10:48 +02:00
acpi_watchdog.c ACPI: watchdog: Allow disabling WDAT at boot 2020-03-21 08:11:47 +01:00
battery.c ACPI: battery: Add device HID and quirk for Microsoft Surface Go 3 2022-03-28 08:46:47 +02:00
bgrt.c ACPI: bgrt: Fix CFI violation 2021-07-14 16:53:25 +02:00
blacklist.c ACPI: blacklist: fix clang warning for unused DMI table 2019-07-11 22:45:00 +02:00
bus.c ACPI: bus: Call kobject_put() in acpi_init() error path 2021-07-14 16:53:17 +02:00
button.c ACPI: button: Add DMI quirk for Medion Akoya E2228T 2020-11-24 13:29:00 +01:00
cm_sbs.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
container.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
cppc_acpi.c ACPI: CPPC: Avoid out of bounds access when parsing _CPC data 2022-04-15 14:18:29 +02:00
custom_method.c ACPI: custom_method: fix a possible memory leak 2021-05-11 14:04:01 +02:00
debugfs.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
device_pm.c PM: ACPI: PCI: Drop acpi_pm_set_bridge_wakeup() 2020-12-30 11:51:32 +01:00
device_sysfs.c ACPI: Use DEVICE_ATTR_<RW|RO|WO> macros 2021-07-14 16:53:25 +02:00
dock.c ACPI: Use DEVICE_ATTR_<RW|RO|WO> macros 2021-07-14 16:53:25 +02:00
ec.c Revert "ACPI: PM: s2idle: Cancel wakeup before dispatching EC GPE" 2022-03-11 11:22:39 +01:00
ec_sys.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 482 2019-06-19 17:09:52 +02:00
event.c ACPI: event: replace strcpy() by strscpy() 2019-04-23 10:54:26 +02:00
evged.c ACPI: GED: fix -Wformat 2020-11-22 10:14:12 +01:00
fan.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
glue.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 428 2019-06-05 17:37:16 +02:00
hed.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174 2019-05-30 11:26:41 -07:00
internal.h ACPI: EC: Rework flushing of EC work while suspended to idle 2022-01-27 09:19:32 +01:00
ioapic.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
irq.c Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2019-07-08 11:01:13 -07:00
numa.c ACPI: Add out of bounds and numa_off protections to pxm_to_node() 2020-11-05 11:43:18 +01:00
nvs.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 428 2019-06-05 17:37:16 +02:00
osi.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
osl.c ACPI: OSL: only free map once in osl.c 2019-12-17 19:56:33 +01:00
pci_irq.c ACPI / PCI: fix acpi_pci_irq_enable() memory leak 2019-09-03 09:41:25 +02:00
pci_link.c ACPI/PCI: Remove surplus parentheses from a return statement 2019-08-21 00:05:20 +02:00
pci_mcfg.c PCI/ACPI: Add Ampere Altra SOC MCFG quirk 2021-09-26 14:07:05 +02:00
pci_root.c PCI: Move ASPM declarations to linux/pci.h 2019-08-28 08:28:39 -05:00
pci_slot.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 491 2019-06-19 17:09:52 +02:00
power.c ACPI: Use DEVICE_ATTR_<RW|RO|WO> macros 2021-07-14 16:53:25 +02:00
pptt.c ACPI/PPTT: Add support for ACPI 6.3 thread flag 2019-08-12 12:59:15 +01:00
proc.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
processor_core.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
processor_driver.c cpufreq: Use per-policy frequency QoS 2019-10-21 02:05:21 +02:00
processor_idle.c ACPI: processor idle: Check for architectural support for LPI 2022-04-15 14:18:41 +02:00
processor_pdc.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
processor_perflib.c ACPI: processor: Add QoS requests for all CPUs 2019-10-25 11:33:48 +02:00
processor_thermal.c ACPI: processor: Add QoS requests for all CPUs 2019-10-25 11:33:48 +02:00
processor_throttling.c x86: ACPI: fix CPU hotplug deadlock 2020-04-23 10:36:38 +02:00
property.c ACPI: properties: Consistently return -ENOENT if there are no more references 2022-04-15 14:18:01 +02:00
reboot.c ACPI: Allow CONFIG_PCI to be unset for reboot 2018-12-20 10:19:49 +01:00
resource.c Revert "ACPI: resources: Add checks for ACPI IRQ override" 2021-08-04 12:27:37 +02:00
sbs.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
sbshc.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 372 2019-06-05 17:37:10 +02:00
sbshc.h ACPI: SBS: remove unused const variable 'SMBUS_PEC' 2019-08-23 12:55:09 +02:00
scan.c ACPI: scan: Create platform device for BCM4752 and LNV4752 ACPI nodes 2022-01-27 09:19:35 +01:00
sleep.c Revert "ACPI: PM: s2idle: Cancel wakeup before dispatching EC GPE" 2022-03-11 11:22:39 +01:00
sleep.h ACPI: PM: Add acpi_[un]register_wakeup_handler() 2020-04-13 10:48:08 +02:00
spcr.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
sysfs.c ACPI: sysfs: Fix pm_profile_attr type 2020-06-30 15:37:06 -04:00
tables.c ACPI: tables: x86: Reserve memory occupied by ACPI tables 2021-05-07 10:51:36 +02:00
thermal.c ACPI: thermal: Do not call acpi_thermal_check() directly 2021-02-07 15:35:47 +01:00
utils.c bus_find_device: Unify the match callback with class_find_device 2019-06-24 05:22:31 +02:00
video_detect.c ACPI: video: Force backlight native for Clevo NL5xRU and NL5xNU 2022-03-28 08:46:47 +02:00
wakeup.c ACPI: PM: Add acpi_[un]register_wakeup_handler() 2020-04-13 10:48:08 +02:00