Exploit databaseDownload repository ZIP
GH-9a497cc26994d431b276e9e3b7a8f75c
satheesh575555/linux-4.19.72_cve-2023-0386
Sources for CVE-2023-0386
20 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files86
satheesh575555/linux-4.19.72_cve-2023-0386Revision ef9a4a9fbf2b
- ↑..Parent directory
- acpica/
- apei/
- arm64/
- dptf/
- nfit/
- pmic/
- x86/
- Kconfig
- Makefile
- ac.c
- acpi_amba.c
- acpi_apd.c
- acpi_cmos_rtc.c
- acpi_configfs.c
- acpi_dbg.c
- acpi_extlog.c
- acpi_ipmi.c
- acpi_lpat.c
- acpi_lpit.c
- acpi_lpss.c
- acpi_memhotplug.c
- acpi_pad.c
- acpi_platform.c
- acpi_pnp.c
- acpi_processor.c
- acpi_tad.c
- acpi_video.c
- acpi_watchdog.c
- battery.c
- bgrt.c
- blacklist.c
- bus.c
- button.c
- cm_sbs.c
- container.c
- cppc_acpi.c
- custom_method.c
- debugfs.c
- device_pm.c
- device_sysfs.c
- dock.c
- ec.c
- ec_sys.c
- event.c
- evged.c
- fan.c
- glue.c
- hed.c
- internal.h
- ioapic.c
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
drivers/acpi/wakeup.c
C · 2,750 bytes// SPDX-License-Identifier: GPL-2.0
/*
* wakeup.c - support wakeup devices
* Copyright (C) 2004 Li Shaohua <[email protected]>
*/
#include <linux/init.h>
#include <linux/acpi.h>
#include <linux/kernel.h>
#include <linux/types.h>
#include "internal.h"
#include "sleep.h"
/*
* We didn't lock acpi_device_lock in the file, because it invokes oops in
* suspend/resume and isn't really required as this is called in S-state. At
* that time, there is no device hotplug
**/
#define _COMPONENT ACPI_SYSTEM_COMPONENT
ACPI_MODULE_NAME("wakeup_devices")
/**
* acpi_enable_wakeup_devices - Enable wake-up device GPEs.
* @sleep_state: ACPI system sleep state.
*
* Enable wakeup device power of devices with the state.enable flag set and set
* the wakeup enable mask bits in the GPE registers that correspond to wakeup
* devices.
*/
void acpi_enable_wakeup_devices(u8 sleep_state)
{
struct list_head *node, *next;
list_for_each_safe(node, next, &acpi_wakeup_device_list) {
struct acpi_device *dev =
container_of(node, struct acpi_device, wakeup_list);
if (!dev->wakeup.flags.valid
|| sleep_state > (u32) dev->wakeup.sleep_state
|| !(device_may_wakeup(&dev->dev)
|| dev->wakeup.prepare_count))
continue;
if (device_may_wakeup(&dev->dev))
acpi_enable_wakeup_device_power(dev, sleep_state);
/* The wake-up power should have been enabled already. */
acpi_set_gpe_wake_mask(dev->wakeup.gpe_device, dev->wakeup.gpe_number,
ACPI_GPE_ENABLE);
}
}
/**
* acpi_disable_wakeup_devices - Disable devices' wakeup capability.
* @sleep_state: ACPI system sleep state.
*/
void acpi_disable_wakeup_devices(u8 sleep_state)
{
struct list_head *node, *next;
list_for_each_safe(node, next, &acpi_wakeup_device_list) {
struct acpi_device *dev =
container_of(node, struct acpi_device, wakeup_list);
if (!dev->wakeup.flags.valid
|| sleep_state > (u32) dev->wakeup.sleep_state
|| !(device_may_wakeup(&dev->dev)
|| dev->wakeup.prepare_count))
continue;
acpi_set_gpe_wake_mask(dev->wakeup.gpe_device, dev->wakeup.gpe_number,
ACPI_GPE_DISABLE);
if (device_may_wakeup(&dev->dev))
acpi_disable_wakeup_device_power(dev);
}
}
int __init acpi_wakeup_device_init(void)
{
struct list_head *node, *next;
mutex_lock(&acpi_device_lock);
list_for_each_safe(node, next, &acpi_wakeup_device_list) {
struct acpi_device *dev = container_of(node,
struct acpi_device,
wakeup_list);
if (device_can_wakeup(&dev->dev)) {
/* Button GPEs are supposed to be always enabled. */
acpi_enable_gpe(dev->wakeup.gpe_device,
dev->wakeup.gpe_number);
device_set_wakeup_enable(&dev->dev, true);
}
}
mutex_unlock(&acpi_device_lock);
return 0;
}