The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH v2 0/1] platform/x86: asus-armoury: fix Use-After-Free and memory leak in driver init
@ 2026-07-01 16:42 Marco Scardovi
  2026-07-01 16:42 ` [PATCH v2 1/1] " Marco Scardovi
  0 siblings, 1 reply; 3+ messages in thread
From: Marco Scardovi @ 2026-07-01 16:42 UTC (permalink / raw)
  To: ilpo.jarvinen
  Cc: corentin.chary, denis.benato, hansg, linux-kernel, luke,
	platform-driver-x86, Marco Scardovi

This patch series addresses a Use-After-Free (UAF) vulnerability
and a memory leak during driver initialization in the asus-armoury
driver.

Changes in v2:
- Restructured init_rog_tunables() to use local pointers
  (ac_rog_tunables, dc_rog_tunables) and only update the global
  static asus_armoury.rog_tunables structure once all allocations
  have successfully succeeded. This removes the risk of exposing
  freed or partially allocated pointers to the global struct.
- Removed redundant assignments to NULL in the error paths. Since
  initialization fails and the driver is not loaded, cleaning the
  global static pointers to NULL is not necessary.
- In init_rog_tunables(), replaced 'goto err_nomem' with direct
  'return -ENOMEM'. The 'err_nomem' label in the original code
  printed a generic OOM error message, which is discouraged in the
  kernel as the allocator already issues OOM details. Because that
  label did not perform rollback cleanup, a direct return is cleaner
  and simpler.
- Replaced inline cleanup in asus_fw_init() with a standard goto
  rollback block at the end of the function for cleaner error path
  styling.

Marco Scardovi (1):
  platform/x86: asus-armoury: fix Use-After-Free and memory leak in
    driver init

 drivers/platform/x86/asus-armoury.c | 38 ++++++++++++++++++-----------
 1 file changed, 24 insertions(+), 14 deletions(-)

-- 
2.55.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-07-03  9:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-01 16:42 [PATCH v2 0/1] platform/x86: asus-armoury: fix Use-After-Free and memory leak in driver init Marco Scardovi
2026-07-01 16:42 ` [PATCH v2 1/1] " Marco Scardovi
2026-07-03  9:59   ` Ilpo Järvinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox