]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
x86/platform/geode: Fix on-stack property data use-after-return bug
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Mon, 30 Mar 2026 02:27:48 +0000 (19:27 -0700)
committerIngo Molnar <mingo@kernel.org>
Tue, 31 Mar 2026 07:55:26 +0000 (09:55 +0200)
commitb981e9e94c687b7b19ae8820963f005b842cb2f2
tree638f43b38068a504a840dc1a9a5ae236f23171d1
parent917e3ad3321e75ca0223d5ccf26ceda116aa51e1
x86/platform/geode: Fix on-stack property data use-after-return bug

The PROPERTY_ENTRY_GPIO macro (and by extension PROPERTY_ENTRY_REF)
creates a temporary software_node_ref_args structure on the stack
when used in a runtime assignment. This results in the property
pointing to data that is invalid once the function returns.

Fix this by ensuring the GPIO reference data is not stored on stack and
using PROPERTY_ENTRY_REF_ARRAY_LEN() to point directly to the persistent
reference data.

Fixes: 298c9babadb8 ("x86/platform/geode: switch GPIO buttons and LEDs to software properties")
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Rafael J. Wysocki <rafael@kernel.org>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Daniel Scally <djrscally@gmail.com>
Cc: Danilo Krummrich <dakr@kernel.org>
Cc: Hans de Goede <hansg@kernel.org>
Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20260329-property-gpio-fix-v2-1-3cca5ba136d8@gmail.com
arch/x86/platform/geode/geode-common.c