linux-yocto/include/linux/platform_data/x86
Yongxin Liu 76033cf8c2 platform/x86: intel_pmc_ipc: fix ACPI buffer memory leak
commit 611cf41ef6ac8301d23daadd8e78b013db0c5071 upstream.

The intel_pmc_ipc() function uses ACPI_ALLOCATE_BUFFER to allocate memory
for the ACPI evaluation result but never frees it, causing a 192-byte
memory leak on each call.

This leak is triggered during network interface initialization when the
stmmac driver calls intel_mac_finish() -> intel_pmc_ipc().

  unreferenced object 0xffff96a848d6ea80 (size 192):
    comm "dhcpcd", pid 541, jiffies 4294684345
    hex dump (first 32 bytes):
      04 00 00 00 05 00 00 00 98 ea d6 48 a8 96 ff ff  ...........H....
      00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00  ................
    backtrace (crc b1564374):
      kmemleak_alloc+0x2d/0x40
      __kmalloc_noprof+0x2fa/0x730
      acpi_ut_initialize_buffer+0x83/0xc0
      acpi_evaluate_object+0x29a/0x2f0
      intel_pmc_ipc+0xfd/0x170
      intel_mac_finish+0x168/0x230
      stmmac_mac_finish+0x3d/0x50
      phylink_major_config+0x22b/0x5b0
      phylink_mac_initial_config.constprop.0+0xf1/0x1b0
      phylink_start+0x8e/0x210
      __stmmac_open+0x12c/0x2b0
      stmmac_open+0x23c/0x380
      __dev_open+0x11d/0x2c0
      __dev_change_flags+0x1d2/0x250
      netif_change_flags+0x2b/0x70
      dev_change_flags+0x40/0xb0

Add __free(kfree) for ACPI object to properly release the allocated buffer.

Cc: stable@vger.kernel.org
Fixes: 7e2f7e25f6 ("arch: x86: add IPC mailbox accessor function and add SoC register access")
Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com>
Link: https://patch.msgid.link/20251128102437.3412891-2-yongxin.liu@windriver.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-01-02 12:56:56 +01:00
..
amd-fch.h Move FCH header to a location accessible by all archs 2025-06-30 13:42:11 +03:00
apple.h
asus-wmi.h platform/x86: asus-wmi: Refactor Ally suspend/resume 2025-05-08 16:03:56 +03:00
clk-lpss.h clk: x86: lpss-atom: Drop unneeded 'extern' in the header 2023-12-11 11:04:28 +01:00
clk-pmc-atom.h
int3472.h platform/x86: int3472: Fix double free of GPIO device during unregister 2025-10-28 17:06:14 +02:00
intel_pmc_ipc.h platform/x86: intel_pmc_ipc: fix ACPI buffer memory leak 2026-01-02 12:56:56 +01:00
intel_scu_ipc.h platform/x86: intel_scu_ipc: Don't use "proxy" headers 2024-10-07 12:27:15 +03:00
intel-mid_wdt.h platform/x86: intel_scu_wdt: Move intel_scu_wdt.h to x86 subfolder 2024-09-11 14:26:08 +02:00
nvidia-wmi-ec-backlight.h
p2sb.h
pmc_atom.h platform/x86: pmc_atom: Annotate d3_sts register bit defines 2024-03-12 12:48:17 +02:00
pwm-lpss.h pwm: lpss: Clarify the bypass member semantics in struct pwm_lpss_boardinfo 2025-02-11 16:25:41 +02:00
simatic-ipc-base.h platform/x86/siemens: simatic-ipc: add new models BX-56A/BX-59A 2023-07-31 14:23:58 +02:00
simatic-ipc.h platform/x86/siemens: simatic-ipc: add new models BX-56A/BX-59A 2023-07-31 14:23:58 +02:00
soc.h thermal: intel: intel_soc_dts_thermal: Switch to new Intel CPU model defines 2024-06-07 20:47:05 +02:00
spi-intel.h