linux/drivers/acpi
Mark Langsdorf 1cfd895643 ACPI: custom_method: fix a possible memory leak
In cm_write(), if the 'buf' is allocated memory but not fully consumed,
it is possible to reallocate the buffer without freeing it by passing
'*ppos' as 0 on a subsequent call.

Add an explicit kfree() before kzalloc() to prevent the possible memory
leak.

Fixes: 526b4af47f ("ACPI: Split out custom_method functionality into an own driver")
Signed-off-by: Mark Langsdorf <mlangsdo@redhat.com>
Cc: 5.4+ <stable@vger.kernel.org> # 5.4+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2021-04-28 19:17:54 +02:00
..
acpica ACPICA: ACPI 6.4: add CSI2Bus resource template 2021-04-07 19:09:01 +02:00
apei Merge branch 'acpi-misc' 2021-04-26 17:04:41 +02:00
arm64 ACPI/IORT: Do not blindly trust DMA masks from firmware 2021-01-27 12:26:24 +00:00
dptf ACPI: DPTF: Support Alder Lake 2020-11-10 18:52:51 +01:00
nfit ACPICA: ACPI 6.4: NFIT: add Location Cookie field 2021-04-07 19:09:00 +02:00
numa ACPI: fix various typos in comments 2021-03-19 17:45:49 +01:00
pmic ACPI: fix various typos in comments 2021-03-19 17:45:49 +01:00
x86 ACPI: PM: s2idle: Drop unused local variables and related code 2021-01-07 17:41:28 +01:00
ac.c ACPI: AC: fix some coding style issues 2021-04-08 16:17:32 +02:00
acpi_adxl.c
acpi_amba.c
acpi_apd.c ACPI: APD: fix a block comment align issue 2021-04-08 16:27:02 +02:00
acpi_cmos_rtc.c ACPI: cmos_rtc: Remove leftover ACPI_MODULE_NAME() 2020-09-25 18:25:51 +02:00
acpi_configfs.c ACPI: configfs: add missing check after configfs_register_default_group() 2021-01-22 16:35:34 +01:00
acpi_dbg.c ACPI: debug: Remove the not used function 2020-11-17 18:12:34 +01:00
acpi_extlog.c ACPI / extlog: Check for RDMSR failure 2020-10-02 19:01:55 +02:00
acpi_fpdt.c ACPI: tables: introduce support for FPDT table 2021-01-29 19:24:13 +01:00
acpi_ipmi.c ACPI: ipmi: remove useless return statement for void function 2021-04-08 16:27:02 +02:00
acpi_lpat.c
acpi_lpit.c
acpi_lpss.c ACPI: LPSS: add a missed blank line after declarations 2021-04-08 16:27:02 +02:00
acpi_memhotplug.c mm/memory_hotplug: prepare passing flags to add_memory() and friends 2020-10-16 11:11:18 -07:00
acpi_pad.c ACPI: acpi_pad: add a missed blank line after declarations 2021-04-08 16:27:02 +02:00
acpi_platform.c ACPI: platform: Remove ACPI_MODULE_NAME() 2020-09-25 18:25:51 +02:00
acpi_pnp.c ACPI: PNP: compare the string length in the matching_id() 2020-12-15 19:30:49 +01:00
acpi_processor.c Merge branch 'acpi-misc' 2021-04-26 17:04:41 +02:00
acpi_tad.c ACPI: Use DEVICE_ATTR_<RW|RO|WO> macros 2021-01-22 16:17:19 +01:00
acpi_video.c Merge branch 'acpi-misc' 2021-04-26 17:04:41 +02:00
acpi_watchdog.c ACPI: watchdog: Replace open coded variant of resource_union() 2020-11-17 18:06:29 +01:00
battery.c ACPI: battery: fix some coding style issues 2021-04-08 16:27:02 +02:00
bgrt.c ACPI: Use DEVICE_ATTR_<RW|RO|WO> macros 2021-01-22 16:17:19 +01:00
blacklist.c
bus.c ACPI updates for 5.12-rc1 2021-02-20 21:50:59 -08:00
button.c ACPI: button: fix some coding style issues 2021-04-08 16:27:02 +02:00
container.c ACPI: container: Remove leftover ACPICA debug functionality 2020-09-25 18:25:51 +02:00
cppc_acpi.c Merge branch 'acpi-misc' 2021-04-26 17:04:41 +02:00
custom_method.c ACPI: custom_method: fix a possible memory leak 2021-04-28 19:17:54 +02:00
debugfs.c ACPI: debugfs: Remove dead ACPICA debug code 2020-09-25 18:25:51 +02:00
device_pm.c ACPI: PM: add a missed blank line after declarations 2021-04-08 16:27:02 +02:00
device_sysfs.c Merge branch 'acpi-misc' 2021-04-26 17:04:41 +02:00
dock.c ACPI: dock: fix some coding style issues 2021-04-08 16:27:03 +02:00
ec_sys.c
ec.c ACPI: EC: Clean up status flags checks in advance_transaction() 2020-11-23 20:01:01 +01:00
event.c ACPI: Fix whitespace inconsistencies 2020-11-09 19:08:06 +01:00
evged.c ACPI: GED: fix -Wformat 2020-11-09 19:25:20 +01:00
fan.c ACPI: fan: Initialize performance state sysfs attribute 2020-11-16 15:18:38 +01:00
glue.c ACPI: bus: Introduce acpi_dev_get() and reuse it in ACPI code 2021-04-13 15:41:11 +02:00
hed.c ACPI: HED: Drop unused ACPI_MODULE_NAME() definition 2021-03-08 16:51:48 +01:00
internal.h Merge branches 'acpi-scan', 'acpi-drivers', 'acpi-pm' and 'acpi-resources' 2021-04-26 17:03:46 +02:00
ioapic.c
irq.c
Kconfig Merge branch 'acpi-tables' 2021-02-25 18:57:40 +01:00
Makefile Merge branch 'acpi-tables' 2021-02-25 18:57:40 +01:00
nvs.c
osi.c
osl.c ACPI: OSL: Clean up printing messages 2021-02-10 19:09:43 +01:00
pci_irq.c ACPI: PCI: IRQ: Consolidate printing diagnostic messages 2021-03-08 16:51:08 +01:00
pci_link.c ACPI: utils: Introduce acpi_evaluation_failure_warn() 2021-03-08 19:10:30 +01:00
pci_mcfg.c ACPI: Fix whitespace inconsistencies 2020-11-09 19:08:06 +01:00
pci_root.c PCI/ACPI: Clarify message about _OSC failure 2021-01-27 09:38:36 -06:00
pci_slot.c ACPI: PCI: Remove unused ACPICA debug code 2020-09-25 18:25:51 +02:00
platform_profile.c ACPI: platform: Add balanced-performance platform profile 2021-02-24 14:52:41 +01:00
power.c Merge branch 'acpi-misc' 2021-04-26 17:04:41 +02:00
pptt.c
proc.c ACPI: proc: Remove dead ACPICA debug code 2020-09-25 18:25:51 +02:00
processor_core.c ACPI: processor: Remove dead ACPICA debug code 2020-09-25 18:25:51 +02:00
processor_driver.c ACPI: processor: Get rid of ACPICA message printing 2021-03-08 16:51:19 +01:00
processor_idle.c Merge branches 'acpi-pci' and 'acpi-processor' 2021-04-26 17:03:05 +02:00
processor_pdc.c ACPI: processor: Get rid of ACPICA message printing 2021-03-08 16:51:19 +01:00
processor_perflib.c Merge branch 'acpi-misc' 2021-04-26 17:04:41 +02:00
processor_thermal.c ACPI: processor: Remove the duplicated ACPI_PROCESSOR_CLASS macro 2020-11-17 18:12:34 +01:00
processor_throttling.c ACPI: utils: Introduce acpi_evaluation_failure_warn() 2021-03-08 19:10:30 +01:00
property.c ACPI: property: Satisfy kernel doc validator (part 2) 2021-02-12 15:34:14 +01:00
reboot.c ACPI: reboot: Avoid racing after writing to ACPI RESET_REG 2020-10-16 18:04:52 +02:00
resource.c ACPI: fix various typos in comments 2021-03-19 17:45:49 +01:00
sbs.c ACPI: SBS: Simplify the code using module_acpi_driver() 2020-11-17 18:12:34 +01:00
sbshc.c ACPI: Fix whitespace inconsistencies 2020-11-09 19:08:06 +01:00
sbshc.h ACPI: Fix whitespace inconsistencies 2020-11-09 19:08:06 +01:00
scan.c Merge branch 'acpi-misc' 2021-04-26 17:04:41 +02:00
sleep.c ACPI: PM: s2idle: Move x86-specific code to the x86 directory 2020-12-17 20:30:02 +01:00
sleep.h ACPI: scan: Turn off unused power resources during initialization 2021-03-23 18:59:32 +01:00
spcr.c ACPI: Use fallthrough pseudo-keyword 2020-07-09 14:09:28 +02:00
sysfs.c Merge branches 'acpi-pci' and 'acpi-processor' 2021-04-26 17:03:05 +02:00
tables.c ACPI: tables: x86: Reserve memory occupied by ACPI tables 2021-03-29 19:26:04 +02:00
thermal.c - Use the newly introduced 'hot' and 'critical' ops for the acpi 2021-02-22 09:39:11 -08:00
tiny-power-button.c ACPI: tiny-power-button: Simplify the code using module_acpi_driver() 2020-11-17 18:12:34 +01:00
utils.c Merge branches 'acpi-cppc', 'acpi-video' and 'acpi-utils' 2021-04-26 17:04:27 +02:00
video_detect.c ACPI: video: use native backlight for GA401/GA502/GA503 2021-04-21 18:54:41 +02:00
wakeup.c ACPI: Fix whitespace inconsistencies 2020-11-09 19:08:06 +01:00