mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-07-22 03:27:30 -04:00
Merge tag 'acpi-7.2-rc1' of gitolite.kernel.org:pub/scm/linux/kernel/git/rafael/linux-pm
Pull ACPI support updates from Rafael Wysocki:
"These update the ACPICA code in the kernel to upstream version
20260408, introduce support for devres-based management of ACPI notify
handlers and update some core ACPI device drivers on top of that
(which includes some fixes and cleanups), add _DEP support for PCI/CXL
roots and Intel CVS devices, fix a couple of assorted issues and clean
up code:
- Fix multiple issues related to probe, removal and missing NVDIMM
device notifications in the ACPI NFIT driver (Rafael Wysocki)
- Add support for devres-based management of ACPI notify handlers to
the ACPI core (Rafael Wysocki)
- Switch multiple core ACPI device drivers (including the ACPI PAD,
ACPI video bus, ACPI HED, ACPI thermal zone, ACPI AC, ACPI battery,
and ACPI NFIT drivers) over to using devres-based resource
management during probe (Rafael Wysocki)
- Replace mutex_lock/unlock() with guard()/scoped_guard() in the ACPI
PMIC driver (Maxwell Doose)
- Fix message kref handling in the dead device path of the ACPI IPMI
address space handler (Yuho Choi)
- Use sysfs_emit() in idlecpus_show() in the ACPI processor
aggregator device (PAD) driver (Yury Norov)
- Clean up device_id_scheme initialization in the ACPI video bus
driver (Jean-Ralph Aviles)
- Clean up lid handling in the ACPI button driver and
acpi_button_probe(), reorganize installing and removing event
handlers in that driver and switch it over to using devres-based
resource management during probe (Rafael Wysocki)
- Add support for the Legacy Virtual Register (LVR) field in I2C
serial bus resource descriptors to ACPICA (Akhil R)
- Fix multiple issues related to bounds checks, input validation,
use-after-free, and integer overflow checks in the AML interpreter
in ACPICA (ikaros)
- Update the copyright year to 2026 in ACPICA files and make minor
changes related to ACPI 6.6 support (Pawel Chmielewski)
- Remove spurious precision from format used to dump parse trees in
ACPICA (David Laight)
- Add modern standby DSM GUIDs to ACPICA header files (Daniel
Schaefer)
- Fix FADT 32/64X length mismatch warning in ACPICA (Abdelkader
Boudih)
- Update D3hot/cold device power states definitions in ACPICA header
files (Aymeric Wibo)
- Fix NULL pointer dereference in acpi_ns_custom_package() (Weiming
Shi)
- Update ACPICA version to 20260408 (Saket Dumbre)
- Add cpuidle driver check in acpi_processor_register_idle_driver()
to avoid evaluating _CST unnecessarily (Tony W Wang-oc)
- Suppress UBSAN warning caused by field misuse during PCC-based
register access in the ACPI CPPC library (Jeremy Linton)
- Add support for CPPC v4 to the ACPI CPPC library (Sumit Gupta)
- Update the ACPI device enumeration code to honor _DEP for ACPI0016
PCI/CXL host bridges and make the ACPI PCI root driver clear _DEP
dependencies for PCI roots that have become operational (Chen Pei)"
* tag 'acpi-7.2-rc1' of gitolite.kernel.org:pub/scm/linux/kernel/git/rafael/linux-pm: (74 commits)
ACPI: processor: Add cpuidle driver check in acpi_processor_register_idle_driver()
ACPI: IPMI: Fix message kref handling on dead device
ACPI: CPPC: Suppress UBSAN warning caused by field misuse
ACPI: scan: Honor _DEP for Intel CVS devices
ACPI: NFIT: core: Fix possible deadlock and missing notifications
ACPI: NFIT: core: Eliminate redundant local variable
ACPI: NFIT: core: Fix acpi_nfit_init() error cleanup
ACPI: NFIT: core: Fix possible NULL pointer dereference
ACPI: bus: Clean up devm_acpi_install_notify_handler()
ACPI: button: Switch over to devres-based resource management
ACPI: button: Reorganize installing and removing event handlers
ACPI: button: Use string literals for generating netlink messages
ACPI: button: Clean up adding and removing lid procfs interface
ACPI: button: Merge two switch () statements in acpi_button_probe()
ACPI: button: Drop redundant variable from acpi_button_probe()
ACPI: button: Rework device verification during probe
ACPI: CPPC: Add support for CPPC v4
ACPI: PAD: Use sysfs_emit() in idlecpus_show()
ACPI: scan: Honor _DEP for ACPI0016 PCI/CXL host bridge
ACPI: PCI: Clear _DEP dependencies after PCI root bridge attach
...
This commit is contained in:
@@ -193,6 +193,7 @@ static const struct dmi_system_id ac_dmi_table[] __initconst = {
|
||||
static int acpi_ac_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct power_supply_config psy_cfg = {};
|
||||
struct device *dev = &pdev->dev;
|
||||
struct acpi_device *adev;
|
||||
struct acpi_ac *ac;
|
||||
int result;
|
||||
@@ -201,7 +202,7 @@ static int acpi_ac_probe(struct platform_device *pdev)
|
||||
if (!adev)
|
||||
return -ENODEV;
|
||||
|
||||
ac = kzalloc_obj(struct acpi_ac);
|
||||
ac = devm_kzalloc(dev, sizeof(*ac), GFP_KERNEL);
|
||||
if (!ac)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -211,7 +212,7 @@ static int acpi_ac_probe(struct platform_device *pdev)
|
||||
|
||||
result = acpi_ac_get_state(ac);
|
||||
if (result)
|
||||
goto err_release_ac;
|
||||
return result;
|
||||
|
||||
psy_cfg.drv_data = ac;
|
||||
|
||||
@@ -220,33 +221,22 @@ static int acpi_ac_probe(struct platform_device *pdev)
|
||||
ac->charger_desc.properties = ac_props;
|
||||
ac->charger_desc.num_properties = ARRAY_SIZE(ac_props);
|
||||
ac->charger_desc.get_property = get_ac_property;
|
||||
ac->charger = power_supply_register(&pdev->dev,
|
||||
&ac->charger_desc, &psy_cfg);
|
||||
if (IS_ERR(ac->charger)) {
|
||||
result = PTR_ERR(ac->charger);
|
||||
goto err_release_ac;
|
||||
}
|
||||
ac->charger = devm_power_supply_register(dev, &ac->charger_desc, &psy_cfg);
|
||||
if (IS_ERR(ac->charger))
|
||||
return PTR_ERR(ac->charger);
|
||||
|
||||
pr_info("AC Adapter [%s] (%s-line)\n", acpi_device_bid(adev),
|
||||
str_on_off(ac->state));
|
||||
|
||||
result = devm_acpi_install_notify_handler(dev, ACPI_ALL_NOTIFY,
|
||||
acpi_ac_notify, ac);
|
||||
if (result)
|
||||
return result;
|
||||
|
||||
ac->battery_nb.notifier_call = acpi_ac_battery_notify;
|
||||
register_acpi_notifier(&ac->battery_nb);
|
||||
|
||||
result = acpi_dev_install_notify_handler(adev, ACPI_ALL_NOTIFY,
|
||||
acpi_ac_notify, ac);
|
||||
if (result)
|
||||
goto err_unregister;
|
||||
|
||||
return 0;
|
||||
|
||||
err_unregister:
|
||||
power_supply_unregister(ac->charger);
|
||||
unregister_acpi_notifier(&ac->battery_nb);
|
||||
err_release_ac:
|
||||
kfree(ac);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
@@ -271,12 +261,7 @@ static void acpi_ac_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct acpi_ac *ac = platform_get_drvdata(pdev);
|
||||
|
||||
acpi_dev_remove_notify_handler(ac->device, ACPI_ALL_NOTIFY,
|
||||
acpi_ac_notify);
|
||||
power_supply_unregister(ac->charger);
|
||||
unregister_acpi_notifier(&ac->battery_nb);
|
||||
|
||||
kfree(ac);
|
||||
}
|
||||
|
||||
static struct platform_driver acpi_ac_driver = {
|
||||
|
||||
@@ -550,7 +550,6 @@ acpi_ipmi_space_handler(u32 function, acpi_physical_address address,
|
||||
return AE_TYPE;
|
||||
}
|
||||
|
||||
acpi_ipmi_msg_get(tx_msg);
|
||||
mutex_lock(&driver_data.ipmi_lock);
|
||||
/* Do not add a tx_msg that can not be flushed. */
|
||||
if (ipmi_device->dead) {
|
||||
@@ -558,6 +557,7 @@ acpi_ipmi_space_handler(u32 function, acpi_physical_address address,
|
||||
ipmi_msg_release(tx_msg);
|
||||
return AE_NOT_EXIST;
|
||||
}
|
||||
acpi_ipmi_msg_get(tx_msg);
|
||||
spin_lock_irqsave(&ipmi_device->tx_msg_lock, flags);
|
||||
list_add_tail(&tx_msg->head, &ipmi_device->tx_msg_list);
|
||||
spin_unlock_irqrestore(&ipmi_device->tx_msg_lock, flags);
|
||||
|
||||
@@ -31,6 +31,8 @@
|
||||
static DEFINE_MUTEX(isolated_cpus_lock);
|
||||
static DEFINE_MUTEX(round_robin_lock);
|
||||
|
||||
static bool acpi_pad_teardown;
|
||||
|
||||
static unsigned int power_saving_mwait_eax;
|
||||
|
||||
static unsigned char tsc_detected_unstable;
|
||||
@@ -334,8 +336,8 @@ static ssize_t idlecpus_store(struct device *dev,
|
||||
static ssize_t idlecpus_show(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
return cpumap_print_to_pagebuf(false, buf,
|
||||
to_cpumask(pad_busy_cpus_bits));
|
||||
return sysfs_emit(buf, "%*pb\n",
|
||||
cpumask_pr_args(to_cpumask(pad_busy_cpus_bits)));
|
||||
}
|
||||
|
||||
static DEVICE_ATTR_RW(idlecpus);
|
||||
@@ -359,6 +361,9 @@ static int acpi_pad_pur(acpi_handle handle)
|
||||
union acpi_object *package;
|
||||
int num = -1;
|
||||
|
||||
if (unlikely(acpi_pad_teardown))
|
||||
return -1;
|
||||
|
||||
if (ACPI_FAILURE(acpi_evaluate_object(handle, "_PUR", NULL, &buffer)))
|
||||
return num;
|
||||
|
||||
@@ -407,40 +412,29 @@ static void acpi_pad_handle_notify(acpi_handle handle)
|
||||
|
||||
static void acpi_pad_notify(acpi_handle handle, u32 event, void *data)
|
||||
{
|
||||
struct acpi_device *adev = data;
|
||||
|
||||
switch (event) {
|
||||
case ACPI_PROCESSOR_AGGREGATOR_NOTIFY:
|
||||
acpi_pad_handle_notify(handle);
|
||||
acpi_bus_generate_netlink_event("acpi_pad",
|
||||
dev_name(&adev->dev), event, 0);
|
||||
break;
|
||||
default:
|
||||
if (event != ACPI_PROCESSOR_AGGREGATOR_NOTIFY) {
|
||||
pr_warn("Unsupported event [0x%x]\n", event);
|
||||
break;
|
||||
return;
|
||||
}
|
||||
|
||||
acpi_pad_handle_notify(handle);
|
||||
acpi_bus_generate_netlink_event("acpi_pad", dev_name(data), event, 0);
|
||||
}
|
||||
|
||||
static int acpi_pad_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct acpi_device *adev;
|
||||
acpi_pad_teardown = false;
|
||||
|
||||
adev = ACPI_COMPANION(&pdev->dev);
|
||||
if (!adev)
|
||||
return -ENODEV;
|
||||
|
||||
return acpi_dev_install_notify_handler(adev, ACPI_DEVICE_NOTIFY,
|
||||
acpi_pad_notify, adev);
|
||||
return devm_acpi_install_notify_handler(&pdev->dev, ACPI_DEVICE_NOTIFY,
|
||||
acpi_pad_notify, &pdev->dev);
|
||||
}
|
||||
|
||||
static void acpi_pad_remove(struct platform_device *pdev)
|
||||
{
|
||||
mutex_lock(&isolated_cpus_lock);
|
||||
acpi_pad_teardown = true;
|
||||
acpi_pad_idle_cpus(0);
|
||||
mutex_unlock(&isolated_cpus_lock);
|
||||
|
||||
acpi_dev_remove_notify_handler(ACPI_COMPANION(&pdev->dev),
|
||||
ACPI_DEVICE_NOTIFY, acpi_pad_notify);
|
||||
}
|
||||
|
||||
static const struct acpi_device_id pad_device_ids[] = {
|
||||
|
||||
@@ -63,7 +63,7 @@ MODULE_PARM_DESC(hw_changes_brightness,
|
||||
* Whether the struct acpi_video_device_attrib::device_id_scheme bit should be
|
||||
* assumed even if not actually set.
|
||||
*/
|
||||
static bool device_id_scheme = false;
|
||||
static bool device_id_scheme;
|
||||
module_param(device_id_scheme, bool, 0444);
|
||||
|
||||
static int only_lcd;
|
||||
@@ -76,7 +76,6 @@ static DEFINE_MUTEX(video_list_lock);
|
||||
static LIST_HEAD(video_bus_head);
|
||||
static int acpi_video_bus_probe(struct auxiliary_device *aux_dev,
|
||||
const struct auxiliary_device_id *id);
|
||||
static void acpi_video_bus_remove(struct auxiliary_device *aux);
|
||||
static void acpi_video_bus_notify(acpi_handle handle, u32 event, void *data);
|
||||
|
||||
/*
|
||||
@@ -99,7 +98,6 @@ MODULE_DEVICE_TABLE(auxiliary, video_bus_auxiliary_id_table);
|
||||
|
||||
static struct auxiliary_driver acpi_video_bus = {
|
||||
.probe = acpi_video_bus_probe,
|
||||
.remove = acpi_video_bus_remove,
|
||||
.id_table = video_bus_auxiliary_id_table,
|
||||
};
|
||||
|
||||
@@ -1494,10 +1492,31 @@ int acpi_video_get_edid(struct acpi_device *device, int type, int device_id,
|
||||
}
|
||||
EXPORT_SYMBOL(acpi_video_get_edid);
|
||||
|
||||
static int
|
||||
acpi_video_bus_get_devices(struct acpi_video_bus *video,
|
||||
struct acpi_device *device)
|
||||
static void acpi_video_bus_put_devices(void *data)
|
||||
{
|
||||
struct acpi_video_bus *video = data;
|
||||
struct acpi_video_device *dev, *next;
|
||||
|
||||
mutex_lock(&video->device_list_lock);
|
||||
list_for_each_entry_safe(dev, next, &video->video_device_list, entry) {
|
||||
list_del(&dev->entry);
|
||||
kfree(dev);
|
||||
}
|
||||
mutex_unlock(&video->device_list_lock);
|
||||
|
||||
kfree(video->attached_array);
|
||||
video->attached_array = NULL;
|
||||
}
|
||||
|
||||
static int devm_acpi_video_bus_get_devices(struct device *dev,
|
||||
struct acpi_video_bus *video)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = devm_add_action(dev, acpi_video_bus_put_devices, video);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
/*
|
||||
* There are systems where video module known to work fine regardless
|
||||
* of broken _DOD and ignoring returned value here doesn't cause
|
||||
@@ -1505,7 +1524,8 @@ acpi_video_bus_get_devices(struct acpi_video_bus *video,
|
||||
*/
|
||||
acpi_video_device_enumerate(video);
|
||||
|
||||
return acpi_dev_for_each_child(device, acpi_video_bus_get_one_device, video);
|
||||
return acpi_dev_for_each_child(video->device,
|
||||
acpi_video_bus_get_one_device, video);
|
||||
}
|
||||
|
||||
/* acpi_video interface */
|
||||
@@ -1923,8 +1943,9 @@ static void acpi_video_dev_remove_notify_handler(struct acpi_video_device *dev)
|
||||
}
|
||||
}
|
||||
|
||||
static void acpi_video_bus_remove_notify_handler(struct acpi_video_bus *video)
|
||||
static void acpi_video_bus_remove_notify_handler(void *data)
|
||||
{
|
||||
struct acpi_video_bus *video = data;
|
||||
struct acpi_video_device *dev;
|
||||
|
||||
mutex_lock(&video->device_list_lock);
|
||||
@@ -1939,18 +1960,23 @@ static void acpi_video_bus_remove_notify_handler(struct acpi_video_bus *video)
|
||||
video->input = NULL;
|
||||
}
|
||||
|
||||
static int acpi_video_bus_put_devices(struct acpi_video_bus *video)
|
||||
static void acpi_video_bus_free(void *data)
|
||||
{
|
||||
struct acpi_video_device *dev, *next;
|
||||
struct acpi_video_bus *video = data;
|
||||
|
||||
mutex_lock(&video->device_list_lock);
|
||||
list_for_each_entry_safe(dev, next, &video->video_device_list, entry) {
|
||||
list_del(&dev->entry);
|
||||
kfree(dev);
|
||||
}
|
||||
mutex_unlock(&video->device_list_lock);
|
||||
video->device->driver_data = NULL;
|
||||
kfree(video);
|
||||
}
|
||||
|
||||
return 0;
|
||||
static void acpi_video_bus_del(void *data)
|
||||
{
|
||||
struct acpi_video_bus *video = data;
|
||||
|
||||
mutex_lock(&video_list_lock);
|
||||
list_del(&video->entry);
|
||||
mutex_unlock(&video_list_lock);
|
||||
|
||||
acpi_video_bus_unregister_backlight(video);
|
||||
}
|
||||
|
||||
static int duplicate_dev_check(struct device *sibling, void *data)
|
||||
@@ -1978,7 +2004,8 @@ static bool acpi_video_bus_dev_is_duplicate(struct device *dev)
|
||||
static int acpi_video_bus_probe(struct auxiliary_device *aux_dev,
|
||||
const struct auxiliary_device_id *id_unused)
|
||||
{
|
||||
struct acpi_device *device = ACPI_COMPANION(&aux_dev->dev);
|
||||
struct device *dev = &aux_dev->dev;
|
||||
struct acpi_device *device = ACPI_COMPANION(dev);
|
||||
static DEFINE_MUTEX(probe_lock);
|
||||
struct acpi_video_bus *video;
|
||||
static int instance;
|
||||
@@ -1988,7 +2015,7 @@ static int acpi_video_bus_probe(struct auxiliary_device *aux_dev,
|
||||
/* Probe one video bus device at a time in case there are duplicates. */
|
||||
guard(mutex)(&probe_lock);
|
||||
|
||||
if (!allow_duplicates && acpi_video_bus_dev_is_duplicate(&aux_dev->dev)) {
|
||||
if (!allow_duplicates && acpi_video_bus_dev_is_duplicate(dev)) {
|
||||
pr_info(FW_BUG
|
||||
"Duplicate ACPI video bus devices for the"
|
||||
" same VGA controller, please try module "
|
||||
@@ -2001,6 +2028,13 @@ static int acpi_video_bus_probe(struct auxiliary_device *aux_dev,
|
||||
if (!video)
|
||||
return -ENOMEM;
|
||||
|
||||
video->device = device;
|
||||
device->driver_data = video;
|
||||
|
||||
error = devm_add_action_or_reset(dev, acpi_video_bus_free, video);
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
/*
|
||||
* A hack to fix the duplicate name "VID" problem on T61 and the
|
||||
* duplicate name "VGA" problem on Pa 3553.
|
||||
@@ -2015,20 +2049,17 @@ static int acpi_video_bus_probe(struct auxiliary_device *aux_dev,
|
||||
|
||||
auxiliary_set_drvdata(aux_dev, video);
|
||||
|
||||
video->device = device;
|
||||
device->driver_data = video;
|
||||
|
||||
acpi_video_bus_find_cap(video);
|
||||
error = acpi_video_bus_check(video);
|
||||
if (error)
|
||||
goto err_free_video;
|
||||
return error;
|
||||
|
||||
mutex_init(&video->device_list_lock);
|
||||
INIT_LIST_HEAD(&video->video_device_list);
|
||||
|
||||
error = acpi_video_bus_get_devices(video, device);
|
||||
error = devm_acpi_video_bus_get_devices(dev, video);
|
||||
if (error)
|
||||
goto err_put_video;
|
||||
return error;
|
||||
|
||||
/*
|
||||
* HP ZBook Fury 16 G10 requires ACPI video's child devices have _PS0
|
||||
@@ -2040,10 +2071,6 @@ static int acpi_video_bus_probe(struct auxiliary_device *aux_dev,
|
||||
acpi_device_bid(device), str_yes_no(video->flags.multihead),
|
||||
str_yes_no(video->flags.rom), str_yes_no(video->flags.post));
|
||||
|
||||
mutex_lock(&video_list_lock);
|
||||
list_add_tail(&video->entry, &video_bus_head);
|
||||
mutex_unlock(&video_list_lock);
|
||||
|
||||
/*
|
||||
* If backlight-type auto-detection is used then a native backlight may
|
||||
* show up later and this may change the result from video to native.
|
||||
@@ -2059,53 +2086,25 @@ static int acpi_video_bus_probe(struct auxiliary_device *aux_dev,
|
||||
!auto_detect)
|
||||
acpi_video_bus_register_backlight(video);
|
||||
|
||||
error = acpi_video_bus_add_notify_handler(video, &aux_dev->dev);
|
||||
if (error)
|
||||
goto err_del;
|
||||
mutex_lock(&video_list_lock);
|
||||
list_add_tail(&video->entry, &video_bus_head);
|
||||
mutex_unlock(&video_list_lock);
|
||||
|
||||
error = acpi_dev_install_notify_handler(device, ACPI_DEVICE_NOTIFY,
|
||||
error = devm_add_action_or_reset(dev, acpi_video_bus_del, video);
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
error = acpi_video_bus_add_notify_handler(video, dev);
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
error = devm_add_action_or_reset(dev, acpi_video_bus_remove_notify_handler,
|
||||
video);
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
return devm_acpi_install_notify_handler(dev, ACPI_DEVICE_NOTIFY,
|
||||
acpi_video_bus_notify, video);
|
||||
if (error)
|
||||
goto err_remove;
|
||||
|
||||
return 0;
|
||||
|
||||
err_remove:
|
||||
acpi_video_bus_remove_notify_handler(video);
|
||||
err_del:
|
||||
mutex_lock(&video_list_lock);
|
||||
list_del(&video->entry);
|
||||
mutex_unlock(&video_list_lock);
|
||||
acpi_video_bus_unregister_backlight(video);
|
||||
err_put_video:
|
||||
acpi_video_bus_put_devices(video);
|
||||
kfree(video->attached_array);
|
||||
err_free_video:
|
||||
kfree(video);
|
||||
device->driver_data = NULL;
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
static void acpi_video_bus_remove(struct auxiliary_device *aux_dev)
|
||||
{
|
||||
struct acpi_video_bus *video = auxiliary_get_drvdata(aux_dev);
|
||||
struct acpi_device *device = ACPI_COMPANION(&aux_dev->dev);
|
||||
|
||||
acpi_dev_remove_notify_handler(device, ACPI_DEVICE_NOTIFY,
|
||||
acpi_video_bus_notify);
|
||||
|
||||
mutex_lock(&video_list_lock);
|
||||
list_del(&video->entry);
|
||||
mutex_unlock(&video_list_lock);
|
||||
|
||||
acpi_video_bus_remove_notify_handler(video);
|
||||
acpi_video_bus_unregister_backlight(video);
|
||||
acpi_video_bus_put_devices(video);
|
||||
|
||||
kfree(video->attached_array);
|
||||
kfree(video);
|
||||
device->driver_data = NULL;
|
||||
}
|
||||
|
||||
static int __init is_i740(struct pci_dev *dev)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: acapps - common include for ACPI applications/tools
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
/* Common info for tool signons */
|
||||
|
||||
#define ACPICA_NAME "Intel ACPI Component Architecture"
|
||||
#define ACPICA_COPYRIGHT "Copyright (c) 2000 - 2025 Intel Corporation"
|
||||
#define ACPICA_COPYRIGHT "Copyright (c) 2000 - 2026 Intel Corporation"
|
||||
|
||||
#if ACPI_MACHINE_WIDTH == 64
|
||||
#define ACPI_WIDTH " (64-bit version)"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Name: accommon.h - Common include files for generation of ACPICA source
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: acapps - common include for ACPI applications/tools
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Name: acdebug.h - ACPI/AML debugger
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Name: acdispat.h - dispatcher (parser to interpreter interface)
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Name: acevents.h - Event subcomponent prototypes and defines
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Name: acglobal.h - Declarations for global variables
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Name: achware.h -- hardware specific interfaces
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Name: acinterp.h - Interpreter subcomponent prototypes and defines
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Name: aclocal.h - Internal data types used across the ACPI subsystem
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
@@ -169,6 +169,7 @@ struct acpi_namespace_node {
|
||||
#define ANOBJ_IS_EXTERNAL 0x08 /* iASL only: This object created via External() */
|
||||
#define ANOBJ_METHOD_NO_RETVAL 0x10 /* iASL only: Method has no return value */
|
||||
#define ANOBJ_METHOD_SOME_NO_RETVAL 0x20 /* iASL only: Method has at least one return value */
|
||||
#define ANOBJ_IS_ALIAS 0x40 /* iASL only: Node is an alias to another node */
|
||||
#define ANOBJ_IS_REFERENCED 0x80 /* iASL only: Object was referenced */
|
||||
|
||||
/* Internal ACPI table management - master table list */
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Name: acmacros.h - C macros for the entire subsystem.
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Name: acnamesp.h - Namespace subcomponent prototypes and defines
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Name: acobject.h - Definition of union acpi_operand_object (Internal object only)
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Name: acopcode.h - AML opcode information for the AML parser and interpreter
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: acparser.h - AML Parser subcomponent prototypes and defines
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Name: acpredef - Information table for ACPI predefined methods and objects
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Name: acresrc.h - Resource Manager function prototypes
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Name: acstruct.h - Internal structs
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Name: actables.h - ACPI table management
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Name: acutils.h -- prototypes for the common (subsystem-wide) procedures
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* Declarations and definitions contained herein are derived
|
||||
* directly from the ACPI specification.
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: amlresrc.h - AML resource descriptors
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: dbhistry - debugger HISTORY command
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Module Name: dsargs - Support for execution of dynamic arguments for static
|
||||
* objects (regions, fields, buffer fields, etc.)
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Module Name: dscontrol - Support for execution control opcodes -
|
||||
* if/else/while/return
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: dsdebug - Parser/Interpreter interface - debugging
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: dsfield - Dispatcher field routines
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: dsinit - Object initialization namespace walk
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: dsmethod - Parser/Interpreter interface - control method parsing
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
@@ -705,6 +705,8 @@ void
|
||||
acpi_ds_terminate_control_method(union acpi_operand_object *method_desc,
|
||||
struct acpi_walk_state *walk_state)
|
||||
{
|
||||
u32 i;
|
||||
struct acpi_namespace_node *ref_node;
|
||||
|
||||
ACPI_FUNCTION_TRACE_PTR(ds_terminate_control_method, walk_state);
|
||||
|
||||
@@ -715,6 +717,47 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc,
|
||||
}
|
||||
|
||||
if (walk_state) {
|
||||
/*
|
||||
* Check if the return value is a ref_of reference to a method local
|
||||
* or argument. If so, clear the reference to avoid use-after-free
|
||||
* when the walk state is deleted.
|
||||
*/
|
||||
if (walk_state->return_desc &&
|
||||
(walk_state->return_desc->common.type ==
|
||||
ACPI_TYPE_LOCAL_REFERENCE)
|
||||
&& (walk_state->return_desc->reference.class ==
|
||||
ACPI_REFCLASS_REFOF)) {
|
||||
ref_node = walk_state->return_desc->reference.object;
|
||||
if (ref_node) {
|
||||
|
||||
/* Check against method locals */
|
||||
for (i = 0; i < ACPI_METHOD_NUM_LOCALS; i++) {
|
||||
if (ref_node ==
|
||||
&walk_state->local_variables[i]) {
|
||||
acpi_ut_remove_reference
|
||||
(walk_state->return_desc);
|
||||
walk_state->return_desc = NULL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Check against method arguments if not already cleared */
|
||||
if (walk_state->return_desc) {
|
||||
for (i = 0; i < ACPI_METHOD_NUM_ARGS;
|
||||
i++) {
|
||||
if (ref_node ==
|
||||
&walk_state->arguments[i]) {
|
||||
acpi_ut_remove_reference
|
||||
(walk_state->
|
||||
return_desc);
|
||||
walk_state->
|
||||
return_desc = NULL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Delete all arguments and locals */
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: dsobject - Dispatcher object management routines
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: dsopcode - Dispatcher support for regions and fields
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: dspkginit - Completion of deferred package initialization
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Module Name: dswexec - Dispatcher method execution callbacks;
|
||||
* dispatch to interpreter.
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: dswload - Dispatcher first pass namespace load callbacks
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: dswload2 - Dispatcher second pass namespace load callbacks
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: dswscope - Scope stack manipulation
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: dswstate - Dispatcher parse tree walk management routines
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: evevent - Fixed Event handling and dispatch
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: evglock - Global Lock support
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: evgpe - General Purpose Event handling and dispatch
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: evgpeblk - GPE block creation and initialization.
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: evgpeinit - System GPE initialization and update
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: evgpeutil - GPE utilities
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: evhandler - Support for Address Space handlers
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
@@ -130,6 +130,14 @@ acpi_ev_has_default_handler(struct acpi_namespace_node *node,
|
||||
/* Walk the linked list of handlers for this object */
|
||||
|
||||
while (handler_obj) {
|
||||
|
||||
/* Validate handler object type before accessing fields */
|
||||
|
||||
if (handler_obj->common.type !=
|
||||
ACPI_TYPE_LOCAL_ADDRESS_HANDLER) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (handler_obj->address_space.space_id == space_id) {
|
||||
if (handler_obj->address_space.handler_flags &
|
||||
ACPI_ADDR_HANDLER_DEFAULT_INSTALLED) {
|
||||
@@ -292,6 +300,9 @@ union acpi_operand_object *acpi_ev_find_region_handler(acpi_adr_space_type
|
||||
/* Walk the handler list for this device */
|
||||
|
||||
while (handler_obj) {
|
||||
if (handler_obj->common.type != ACPI_TYPE_LOCAL_ADDRESS_HANDLER) {
|
||||
break;
|
||||
}
|
||||
|
||||
/* Same space_id indicates a handler is installed */
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: evmisc - Miscellaneous event manager support functions
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: evregion - Operation Region support
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: evrgnini- ACPI address_space (op_region) init
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: evxface - External interfaces for ACPI events
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: evxfevnt - External Interfaces, ACPI event disable/enable
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: evxfgpe - External Interfaces for General Purpose Events (GPEs)
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Module Name: evxfregn - External Interfaces, ACPI Operation Regions and
|
||||
* Address Spaces.
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: exconcat - Concatenate-type AML operators
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: exconfig - Namespace reconfiguration (Load/Unload opcodes)
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
@@ -90,6 +90,8 @@ acpi_ex_load_table_op(struct acpi_walk_state *walk_state,
|
||||
union acpi_operand_object *return_obj;
|
||||
union acpi_operand_object *ddb_handle;
|
||||
u32 table_index;
|
||||
char oem_id[ACPI_OEM_ID_SIZE + 1];
|
||||
char oem_table_id[ACPI_OEM_TABLE_ID_SIZE + 1];
|
||||
|
||||
ACPI_FUNCTION_TRACE(ex_load_table_op);
|
||||
|
||||
@@ -102,12 +104,32 @@ acpi_ex_load_table_op(struct acpi_walk_state *walk_state,
|
||||
|
||||
*return_desc = return_obj;
|
||||
|
||||
/*
|
||||
* Validate OEM ID and OEM Table ID string lengths.
|
||||
* acpi_tb_find_table expects strings that can safely read
|
||||
* ACPI_OEM_ID_SIZE and ACPI_OEM_TABLE_ID_SIZE bytes.
|
||||
*/
|
||||
if ((operand[1]->string.length > ACPI_OEM_ID_SIZE) ||
|
||||
(operand[2]->string.length > ACPI_OEM_TABLE_ID_SIZE)) {
|
||||
return_ACPI_STATUS(AE_AML_STRING_LIMIT);
|
||||
}
|
||||
|
||||
/*
|
||||
* Copy OEM strings to local buffers with guaranteed null-termination.
|
||||
* This prevents heap-buffer-overflow when acpi_tb_find_table reads
|
||||
* ACPI_OEM_ID_SIZE/ACPI_OEM_TABLE_ID_SIZE bytes.
|
||||
*/
|
||||
memcpy(oem_id, operand[1]->string.pointer, operand[1]->string.length);
|
||||
oem_id[operand[1]->string.length] = 0;
|
||||
memcpy(oem_table_id, operand[2]->string.pointer,
|
||||
operand[2]->string.length);
|
||||
oem_table_id[operand[2]->string.length] = 0;
|
||||
|
||||
/* Find the ACPI table in the RSDT/XSDT */
|
||||
|
||||
acpi_ex_exit_interpreter();
|
||||
status = acpi_tb_find_table(operand[0]->string.pointer,
|
||||
operand[1]->string.pointer,
|
||||
operand[2]->string.pointer, &table_index);
|
||||
oem_id, oem_table_id, &table_index);
|
||||
acpi_ex_enter_interpreter();
|
||||
if (ACPI_FAILURE(status)) {
|
||||
if (status != AE_NOT_FOUND) {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: exconvrt - Object conversion routines
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: excreate - Named object creation
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: exdebug - Support for stores to the AML Debug Object
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: exdump - Interpreter debug output routines
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: exfield - AML execution - field_unit read/write
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: exfldio - Aml Field I/O
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: exmisc - ACPI AML (p-code) execution - specific opcodes
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: exmutex - ASL Mutex Acquire/Release functions
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: exnames - interpreter/scanner name load/execute
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: exoparg1 - AML execution - opcodes with 1 argument
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: exoparg2 - AML execution - opcodes with 2 arguments
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: exoparg3 - AML execution - opcodes with 3 arguments
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
@@ -159,7 +159,7 @@ acpi_status acpi_ex_opcode_3A_1T_1R(struct acpi_walk_state *walk_state)
|
||||
|
||||
/* Truncate request if larger than the actual String/Buffer */
|
||||
|
||||
else if ((index + length) > operand[0]->string.length) {
|
||||
else if ((index + length) > operand[0]->string.length || (index + length) < index) { /* Check for overflow */
|
||||
length =
|
||||
(acpi_size)operand[0]->string.length -
|
||||
(acpi_size)index;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: exoparg6 - AML execution - opcodes with 6 arguments
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: exprep - ACPI AML field prep utilities
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: exregion - ACPI default op_region (address space) handlers
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: exresnte - AML Interpreter object resolution
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: exresolv - AML Interpreter object resolution
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: exresop - AML Interpreter operand/object resolution
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: exserial - field_unit support for serial address spaces
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: exstore - AML Interpreter object store support
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Module Name: exstoren - AML Interpreter object store support,
|
||||
* Store to Node (namespace object)
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: exstorob - AML object store support, store to object
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: exsystem - Interface to OS services
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: extrace - Support for interpreter execution tracing
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: exutils - interpreter/scanner utilities
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: hwacpi - ACPI Hardware Initialization/Mode Interface
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Name: hwesleep.c - ACPI Hardware Sleep/Wake Support functions for the
|
||||
* extended FADT-V5 sleep registers.
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: hwgpe - Low level GPE enable/disable/clear functions
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Name: hwsleep.c - ACPI Hardware Sleep/Wake Support functions for the
|
||||
* original/legacy sleep/PM registers.
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Name: hwtimer.c - ACPI Power Management Timer Interface
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: hwvalid - I/O request validation
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: hwxface - Public ACPICA hardware interfaces
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Name: hwxfsleep.c - ACPI Hardware Sleep/Wake External Interfaces
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: nsarguments - Validation of args for ACPI predefined methods
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Module Name: nsconvert - Object conversions for objects returned by
|
||||
* predefined methods
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: nsdump - table dumping routines for debug
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: nsdump - table dumping routines for debug
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: nsinit - namespace initialization
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: nsload - namespace loading/expanding/contracting procedures
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -222,6 +222,12 @@ acpi_ns_build_normalized_path(struct acpi_namespace_node *node,
|
||||
goto build_trailing_null;
|
||||
}
|
||||
|
||||
/* Validate the Node to avoid use-after-free vulnerabilities */
|
||||
|
||||
if (ACPI_GET_DESCRIPTOR_TYPE(node) != ACPI_DESC_TYPE_NAMED) {
|
||||
goto build_trailing_null;
|
||||
}
|
||||
|
||||
next_node = node;
|
||||
while (next_node && next_node != acpi_gbl_root_node) {
|
||||
if (next_node != node) {
|
||||
|
||||
@@ -173,6 +173,12 @@ void acpi_ns_detach_object(struct acpi_namespace_node *node)
|
||||
|
||||
obj_desc = node->object;
|
||||
|
||||
/* Alias nodes point directly to other namespace nodes; skip teardown */
|
||||
if (node->flags & ANOBJ_IS_ALIAS) {
|
||||
node->object = NULL;
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
if (!obj_desc || (obj_desc->common.type == ACPI_TYPE_LOCAL_DATA)) {
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: nsparse - namespace interface to AML parser
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: nspredef - Validation of ACPI predefined methods and objects
|
||||
*
|
||||
* Copyright (C) 2000 - 2025, Intel Corp.
|
||||
* Copyright (C) 2000 - 2026, Intel Corp.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user