From nobody Sun Apr 5 16:28:25 2026 Received: from mail-dy1-f173.google.com (mail-dy1-f173.google.com [74.125.82.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8E72A34DB52 for ; Tue, 24 Mar 2026 00:40:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774312801; cv=none; b=PaHXyJIed8nnJ8uR7ss03ARHForgoCUVub3UbYuAejRlxf3jVPhAMvaxyuRAA020jzoFvbRrpbmu9Lrlxf3EkOSp6KaZ97BthIuhqSF6QhVsl9QvhaDEwnKZo4b2JvpzaYE1+GGecBKBQEcqK+8u+61rp8uTDffF536REYUIMNw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774312801; c=relaxed/simple; bh=QDf16Y7vyxJr6CaPRWRkq0hvjTb2t+Mwk/4kS11e5G8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=TxX1h1opAHR2xcGAwNNJg21G/rYz6O5DzZk8y+HukUlaTxBAktsVEx7F/jzHwSnZko7jVoBlHelT9Y/WsC+d2YeHW2E+1mG7PMKvu3MVndOvC728aHEegk2t6e7I2PY0qXVSIwWm9d7HDqu9FFkmdTkxrfSUvBpVlmPkrClgiW8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=JJKdgaCm; arc=none smtp.client-ip=74.125.82.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="JJKdgaCm" Received: by mail-dy1-f173.google.com with SMTP id 5a478bee46e88-2c0d36f3888so3358168eec.0 for ; Mon, 23 Mar 2026 17:40:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774312800; x=1774917600; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Gq4MIC18tzOF8Y9yYjqLKcBworY2R0LEwLR/J/vdJqc=; b=JJKdgaCmh2s260EVCN00MexkNid7OCeyZXQxq7BUR77qFHvKBlnHtmvKuEk87TWoB1 J9sEoOeUeaa2EOh87mP4J+ku40nB8oZ3EN3MIbk4org8u9BjfWw4bDoTj8OpKAiIXKi2 o1Tcby68VQNSm7DTJTJ6AbGQMPh3j1MXnppHY996biQXlVzlLnhTD+NMQHBBBIKv7lfS k6j+FlwwS2pHAQePYdGOG551ykEEFLfZ6g0Y0gagRjDaBwgsQVzQR8zo6KGP5XA+Yvho v/Oq5dc9KRxdKEjnuuwGBCtuc7ImDSn90l6bz7VVufzWpvfpUQNOCTD8zJlV+ij1bivQ yUxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774312800; x=1774917600; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=Gq4MIC18tzOF8Y9yYjqLKcBworY2R0LEwLR/J/vdJqc=; b=XBrV19xgyT+A0oLvQXvK9bvaVMASqimJeoRyLDkW8TeqEBwlC/7tDGzd9oWJxI/jiS O6UVS2aXAlgoK051jLPkCJtRLzxTY79qK4tfFajrHXUqDol0mVxfmgyw2wGS5eM1TJ2z NRKUxomqp0EhAq+vQ+SO964yrfGXRsEX8bfPTBbO/qAUvWRz1IU+aZ4x0Ewl4bjNYGv0 iRpfUVdf8O5ke3y5FQlpF+x7jhroR3xfs/5GyZQyx066LCLoiJtI+AQ8FwbkhdDQVBnF zTFeR1W9MBfULYa+cugMXHb4DO8mkuTn6MVXiJS5rNMGKY6wGa9xi958Sn9fz76REJoc Znww== X-Gm-Message-State: AOJu0YyniWhuAcxXai+cDqS1pBx/oQUFVDodIVzj1Rjc9sM4K1EdKLGq RG+mUxm0lBpJMFPiJ4QgrYCVbaRtQ5jKykVq723KcWjZo2+RBtrt9Q0T X-Gm-Gg: ATEYQzwVmke++ZLN3hN6fmB3qAOr9ALhnjoi+4m73cREjD9MA2eqst4DsHLK385r+f3 JN7QPbREY/IdIkHK5TK7XoYak+pOBLyrA+Bl9SO2LzijQaR8ICowTd7xJMGGPtm/t7GOFzAXqo5 5tEk5L3q1AL/tVOwE+uCEuPsadzbcmEB6qiERECoWqNrydoxwdHMDKMvh59LParSbAkRigTNoZx uX6Lnir2O8vttURvl32JOMp9/8MEPdQXmETUvTDFDb4wmy6Cjg8E+dqASUHp0O3yDF6b6uWYU/2 yn3ydSkY9BMUscjBPXE90WnvG8ORcGl+AubzPDMI+xmEZYsfSE5Z5xyrJsjbdvjC3OVJ4sAQsw+ 5gXxah+cURf5PdvHZUMNoKiC3mpVPChwifmnx+QkFiNwW40sHuJNf72hgzZTf39qi9etU03tc3l cV2FoISWPzuRWjxXfpkzAMgpKPLxlfFIJ2xiX/yT1ZAAJhHFMTdfKQae6JUpZtYwGV6rcaktrOW gaPxNIHNzMsc9M= X-Received: by 2002:a05:7300:dc94:b0:2c0:dc7e:ed0f with SMTP id 5a478bee46e88-2c1095a4f1cmr6259533eec.3.1774312799561; Mon, 23 Mar 2026 17:39:59 -0700 (PDT) Received: from dtor-ws.sjc.corp.google.com ([2a00:79e0:2ebe:8:a296:1211:5ab0:bc95]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2c10b17b90dsm17543148eec.10.2026.03.23.17.39.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Mar 2026 17:39:58 -0700 (PDT) From: Dmitry Torokhov Date: Mon, 23 Mar 2026 17:39:37 -0700 Subject: [PATCH 1/4] x86/geode: fix on-stack property data usage Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260323-property-gpio-fix-v1-1-9cb46e5fe7df@gmail.com> References: <20260323-property-gpio-fix-v1-0-9cb46e5fe7df@gmail.com> In-Reply-To: <20260323-property-gpio-fix-v1-0-9cb46e5fe7df@gmail.com> To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, Hans de Goede , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich , Andy Shevchenko , Daniel Scally , Heikki Krogerus , Sakari Ailus Cc: linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, driver-core@lists.linux.dev, stable@vger.kernel.org X-Mailer: b4 0.15-dev-a6826 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 s= oftware properties") Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov --- arch/x86/platform/geode/geode-common.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/arch/x86/platform/geode/geode-common.c b/arch/x86/platform/geo= de/geode-common.c index 05189c5f7d2a..1843ae385e2d 100644 --- a/arch/x86/platform/geode/geode-common.c +++ b/arch/x86/platform/geode/geode-common.c @@ -28,8 +28,10 @@ static const struct software_node geode_gpio_keys_node = =3D { .properties =3D geode_gpio_keys_props, }; =20 -static struct property_entry geode_restart_key_props[] =3D { - { /* Placeholder for GPIO property */ }, +static struct software_node_ref_args geode_restart_gpio_ref; + +static const struct property_entry geode_restart_key_props[] =3D { + PROPERTY_ENTRY_REF_ARRAY_LEN("gpios", &geode_restart_gpio_ref, 1), PROPERTY_ENTRY_U32("linux,code", KEY_RESTART), PROPERTY_ENTRY_STRING("label", "Reset button"), PROPERTY_ENTRY_U32("debounce-interval", 100), @@ -64,8 +66,7 @@ int __init geode_create_restart_key(unsigned int pin) struct platform_device *pd; int err; =20 - geode_restart_key_props[0] =3D PROPERTY_ENTRY_GPIO("gpios", - &geode_gpiochip_node, + geode_restart_gpio_ref =3D SOFTWARE_NODE_REFERENCE(&geode_gpiochip_node, pin, GPIO_ACTIVE_LOW); =20 err =3D software_node_register_node_group(geode_gpio_keys_swnodes); @@ -99,6 +100,7 @@ int __init geode_create_leds(const char *label, const st= ruct geode_led *leds, const struct software_node *group[MAX_LEDS + 2] =3D { 0 }; struct software_node *swnodes; struct property_entry *props; + struct software_node_ref_args *gpio_refs; struct platform_device_info led_info =3D { .name =3D "leds-gpio", .id =3D PLATFORM_DEVID_NONE, @@ -127,6 +129,12 @@ int __init geode_create_leds(const char *label, const = struct geode_led *leds, goto err_free_swnodes; } =20 + gpio_refs =3D kzalloc_objs(*gpio_refs, n_leds); + if (!gpio_refs) { + err =3D -ENOMEM; + goto err_free_props; + } + group[0] =3D &geode_gpio_leds_node; for (i =3D 0; i < n_leds; i++) { node_name =3D kasprintf(GFP_KERNEL, "%s:%d", label, i); @@ -135,9 +143,11 @@ int __init geode_create_leds(const char *label, const = struct geode_led *leds, goto err_free_names; } =20 + gpio_refs[i] =3D SOFTWARE_NODE_REFERENCE(&geode_gpiochip_node, + leds[i].pin, + GPIO_ACTIVE_LOW); props[i * 3 + 0] =3D - PROPERTY_ENTRY_GPIO("gpios", &geode_gpiochip_node, - leds[i].pin, GPIO_ACTIVE_LOW); + PROPERTY_ENTRY_REF_ARRAY_LEN("gpios", &gpio_refs[i], 1); props[i * 3 + 1] =3D PROPERTY_ENTRY_STRING("linux,default-trigger", leds[i].default_on ? @@ -171,6 +181,8 @@ int __init geode_create_leds(const char *label, const s= truct geode_led *leds, err_free_names: while (--i >=3D 0) kfree(swnodes[i].name); + kfree(gpio_refs); +err_free_props: kfree(props); err_free_swnodes: kfree(swnodes); --=20 2.53.0.1018.g2bb0e51243-goog From nobody Sun Apr 5 16:28:25 2026 Received: from mail-dl1-f51.google.com (mail-dl1-f51.google.com [74.125.82.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5D75835F19B for ; Tue, 24 Mar 2026 00:40:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774312804; cv=none; b=gDkpZEYRNp5ZvxHhKlxsa4X5abawOeu13Y0+V4ZstiO+Q6gZ9fqjZwrP8Heqrn00RBHyRJPKuig7TTZizQq2E9bNmiadumIro7px5Ai+BApA5N9xAoPHpXJ0shtJy0ySWWT7zQxdrUU505FmhZodSmcy59MpAQIX8suapp60F80= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774312804; c=relaxed/simple; bh=WAA48TAgXPKh6OTsM9jfu2LAkNr3B0EfohpnQi0pV2k=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=gSnfFzcxFpNCAqe6RRtoK1bXRJ8qd0Vt0P3OC82dNwITqALzUGAdX1CY4YJkvNqerTB/aAOZ5lOC11GSt/1l/myxTOte3sXzE77Zn3W7DRH0A3hGkYBaneGyVWcObM//78d1FLejB6LdqcywIrlcdwasu8CmbofPMKDK4ef9iyo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Yi4NVPgf; arc=none smtp.client-ip=74.125.82.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Yi4NVPgf" Received: by mail-dl1-f51.google.com with SMTP id a92af1059eb24-12a74039dc6so627349c88.0 for ; Mon, 23 Mar 2026 17:40:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774312801; x=1774917601; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=VMnha1VqvY6bmQXtBiFyEl6o1L0XqC/h5XlUXxbZCb0=; b=Yi4NVPgf81cfAe9ZHhZ0tGlyXftHJfw5ujoOfJwhDUEl3VenPFTq2nLQMneYek/Ayk 1UVKtvsIq/+o9U9smEMxSaO9agj1zcNNlXCXBKl4t4WR9DRvZg2JWIYcds2B+OFggHcU D1KOi+3k4HdQbRxKamV3uWoKgqSQa/oavm9ptnPXj2WAubnS9wGOu27KKFQKK/sjNFMb zb0FKJm+7rYcg98MNpW6MHhB9jAfUPCJJxAPmZLoTNRLlQ2a4ZKDlB8aILCkITQ2fmc+ 6a+a5//nhgNYc/Kx3zfjtIrRBfPVH2Dzu1Q0+OXZhNI+VcVkhaG1i5hySlb39egO//Vn oDoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774312801; x=1774917601; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=VMnha1VqvY6bmQXtBiFyEl6o1L0XqC/h5XlUXxbZCb0=; b=XkrHRIoIpdNbo8qPLgRwu5JcmrMsd6dPCvwoOP9opzcOtQvg72FZjCSvCnjUakbhLX Xr9zQJaMCKlrO1996D8kzzA7T2IAIYgbW3mk3ZrId95Cc2LAg8d4mILIwCM0l4B0dMzs mK7PaGqJ0fYW2OuVhEJU+zMztoxNlmf2J4NeCgtWvbPpKj9se2rPqvjKRFhvLpNgxrlO ryj3KLoMZvtXwrEmj3lhYWFlgBKuLyJjjx23LQpYZIDRldxtop8HpkxggFXleV2Ydtgg DWencsoBaYgOwRm67O05cW3nv+tL56Fwjrh5dY0tYGY97I9k1didSfwVu53uZzc1sgUF 5w5Q== X-Gm-Message-State: AOJu0YyKUoShmLUhp+YNACO74xT8Giz/5F4OmUPalNeJaukqByFbtnY6 DBwgpyHQ2Vf3HQ+8GT0gPNOpY9aAJwkjOfme799Cxwh6NfYQHfmwLDUD X-Gm-Gg: ATEYQzzI38rynoksZ5XVL8BLuIS2+ox2sCjkWR6+Sn7PCbIG7mHMpHRVlztzOrCEceL DJ9sc/GS+mUTJasm8l+HHJWzznNysX/WI8k1zrOO2xin85RnU1bv0xdOu0kS7xDVF47mahup3CH 8H9dtj88yMKW7K8ApL7VYfkvKB7Lmq6ExZ4C/ka8TrpmT5IRt53uxMjsKBvP14U6RaRefltDpv+ 4nNHS2zUE7ocSIxEuYujegneV7itXS7OEgqtR5IsGg5CMnNQCxZiV+ubeo/y8Ei5W49/tf3hzwD aaxl5+/yaSFMIXOHS1Wfi+a+21X8Yq5AlCRn2JoZ0YIU5W8kojsrKTwO77M4XonAH3BB2J0EmL+ 5KMr7f/ygynJaRYqqFU0HoAxeB6K4rSFWKtK2VDMSMvKlzjW0igCedLgofei6jiiZP16EHziMaY liciq2TbKwnMN1QSj81lKkBFpWEiP5KttptYFzs00AO8XaBwnqWozK8r6I/vQ05SbdMDbPQyxrn Q5btI5ZAwrtJxI= X-Received: by 2002:a05:7300:572a:b0:2c1:564:7127 with SMTP id 5a478bee46e88-2c1095a5b97mr5955288eec.4.1774312801221; Mon, 23 Mar 2026 17:40:01 -0700 (PDT) Received: from dtor-ws.sjc.corp.google.com ([2a00:79e0:2ebe:8:a296:1211:5ab0:bc95]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2c10b17b90dsm17543148eec.10.2026.03.23.17.39.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Mar 2026 17:40:00 -0700 (PDT) From: Dmitry Torokhov Date: Mon, 23 Mar 2026 17:39:38 -0700 Subject: [PATCH 2/4] software node: allow passing reference args to PROPERTY_ENTRY_REF Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260323-property-gpio-fix-v1-2-9cb46e5fe7df@gmail.com> References: <20260323-property-gpio-fix-v1-0-9cb46e5fe7df@gmail.com> In-Reply-To: <20260323-property-gpio-fix-v1-0-9cb46e5fe7df@gmail.com> To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, Hans de Goede , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich , Andy Shevchenko , Daniel Scally , Heikki Krogerus , Sakari Ailus Cc: linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, driver-core@lists.linux.dev X-Mailer: b4 0.15-dev-a6826 When dynamically creating software nodes and properties for subsequent use with software_node_register() current implementation of PROPERTY_ENTRY_REF is not suitable because it creates a temporary instance of struct software_node_ref_args on stack which will later disappear, and software_node_register() only does shallow copy of properties. Fix this by allowing to pass address of reference arguments structure directly into PROPERTY_ENTRY_REF(), so that caller can manage lifetime of the object properly. Signed-off-by: Dmitry Torokhov --- include/linux/property.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/include/linux/property.h b/include/linux/property.h index e30ef23a9af3..942657e76993 100644 --- a/include/linux/property.h +++ b/include/linux/property.h @@ -471,12 +471,19 @@ struct property_entry { #define PROPERTY_ENTRY_STRING(_name_, _val_) \ __PROPERTY_ENTRY_ELEMENT(_name_, str, STRING, _val_) =20 +#define __PROPERTY_ENTRY_REF_ARGS(_ref_, ...) \ + _Generic(_ref_, \ + const struct software_node_ref_args *: _ref_, \ + struct software_node_ref_args *: _ref_, \ + default: &SOFTWARE_NODE_REFERENCE(_ref_, \ + ##__VA_ARGS__)) + #define PROPERTY_ENTRY_REF(_name_, _ref_, ...) \ (struct property_entry) { \ .name =3D _name_, \ .length =3D sizeof(struct software_node_ref_args), \ .type =3D DEV_PROP_REF, \ - { .pointer =3D &SOFTWARE_NODE_REFERENCE(_ref_, ##__VA_ARGS__), }, \ + { .pointer =3D __PROPERTY_ENTRY_REF_ARGS(_ref_, ##__VA_ARGS__) }, \ } =20 #define PROPERTY_ENTRY_BOOL(_name_) \ --=20 2.53.0.1018.g2bb0e51243-goog From nobody Sun Apr 5 16:28:25 2026 Received: from mail-dl1-f43.google.com (mail-dl1-f43.google.com [74.125.82.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BE41F363C66 for ; Tue, 24 Mar 2026 00:40:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774312805; cv=none; b=dtjX0OziArDcswpZsBWwk+cbwGN4BAZVoFRtqdktMkVtcJFTDXwAotZ6gPjA64u2GZC9K2uJoAmf3uWYWGk/8Lqn0fIEZiStXpa2D8q9Jx2HihrpsIKilbuuu6VCxQsKoAQqBRk+lKvUS2jrTdARuWKijdZJoVYLGyKNnL9CUDs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774312805; c=relaxed/simple; bh=Grx/pH7Whoel/08IPXs9sl4RENgf6azDLpfb9doS5b4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=r4AQ0y3LrrHvMoibb+AW6IH9V0VMOVpOLLgNKQwFum29yrjONB0Jh0V2SWD26MdBbBcjMHAgdDkqjJ3OMiCOPtqkBbwb8a/9/9Gs1t1lflnH7HYVyElYxEDE5LPbsQ1jUKWGJe6+2mPEwIKl5DFuAKu8rhVzqfWgQle6LkZhQ/g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=QI1ypQya; arc=none smtp.client-ip=74.125.82.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="QI1ypQya" Received: by mail-dl1-f43.google.com with SMTP id a92af1059eb24-128e4d0cc48so3716095c88.1 for ; Mon, 23 Mar 2026 17:40:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774312803; x=1774917603; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=hwlsItIufp55QkDByiWcscZ/zHchruIpUll+4+d6xMc=; b=QI1ypQyarsk/ooLHaFiBqaEXPdc4AY75LLLYDpDQDiFdx4tEWz7n8Vb0GajE5ChrPB FOmgKIL+NXDwYr+nYurFSYIJbvy9iycimXlRJUob7PDmoaShN72t697Phh8dO6QBcGet jr4CMbK+BnzEMeOYNZAcTxG/6NkJfLSRVrDfHfMKOxWVX/Cn4T5oiPu3QtUXse72h9xj AHBSNsTRdmZvUW+MTo7hTh6bTlRLkSReMNr76vTXmtz0G455h6wV2JqoemNabee/WDYg us+LgrIehfcSBsaggyoFcm9tFVbM5CNXMWJ+FFtiBZ8l3651HXtTkfNUILODqsHjMhYl HjEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774312803; x=1774917603; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=hwlsItIufp55QkDByiWcscZ/zHchruIpUll+4+d6xMc=; b=QRDRytWcifYwdyj41DxN6QMQYCfXPgZSaDgwJduBDv3sdbmAB64tByg4Fj8ObAQuZe HK07mQH43LfDce1LnkbH3IQ30nA5yTp24M7NNxJuSajYma0/hn82DTW8hPKPjckkbh4R b2nP49dWXuXxejhU5mtV++sKap50PgJ9z/LN0snWC0TW6eAYP7NST7bXGO57HRHPorB1 adtvBNjoEzRgvzNa42GllVumU9f2+KjQQQwr9uii59pgKc8JVER5H/r7mXBdoPg5BM2P GsnSXUdrBRQwKDaEkypq4p2ho5/0TPRr8W/NFvxye58tze4axyDSQmv0EJcUOYf8rpSS qylQ== X-Gm-Message-State: AOJu0YzBdkO+OmbPpyMT/wfQCij+GwFbZAl57AgvDr8/LhqSHfBQFfKQ mvzpp+QhhsgXGmtVwws07wxIxSaiy/68TeXyc0tQWKWAuZcbj+UiCmNJ X-Gm-Gg: ATEYQzwu9XlcuRN5i74ka9IN7rIrcNV29l9DWYR06uYGzTiHxQJ2E32uKzdQHLq1iQI 08IKhEjHo9rV/qPXWKqar+vZauMkJJT6Y6Fc5ibHh0gMRtOghIL94+M0uQjcts7Aun2Sv7RBCS3 nyZq3eU4DURUaOd6lJfN9HehfDHxhFCUECl+rndMIGiQoU4Zm5TDVKomj7HYoNb/8qRhkSTvMD4 bsa5hH+eDlFg/jLayRgwhRKTqwtbPIdmSR3FYttzBbA4WDvs85m10nWzHrWDi7caIzmOlQKyNsW J6zm74f06/5WNMbx2DmH7HQGAHM1c48SEpVXaJqpm+Vf870DIk/5AqrLdyv7CgH9rozugSOEg8v F8kRj/Zgp8XzwMx9DUHUO9s2/ziTLUyYHVVEXnUgAUktDDHD/S5y66I5gWSBAOmlJL5t2lctueh M/bFnKn6sBwcFsra+jwRFIaVqc3Pqb3METTbCAmzkQInPl8PJt4qa5YHzqpBIev2tQ3b9h+GZNp 6g9XEsSXop0VNc= X-Received: by 2002:a05:7022:4590:b0:128:cf5c:535a with SMTP id a92af1059eb24-12a7268c7dbmr6052354c88.11.1774312802827; Mon, 23 Mar 2026 17:40:02 -0700 (PDT) Received: from dtor-ws.sjc.corp.google.com ([2a00:79e0:2ebe:8:a296:1211:5ab0:bc95]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2c10b17b90dsm17543148eec.10.2026.03.23.17.40.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Mar 2026 17:40:02 -0700 (PDT) From: Dmitry Torokhov Date: Mon, 23 Mar 2026 17:39:39 -0700 Subject: [PATCH 3/4] software node: verify that property data is not on stack Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260323-property-gpio-fix-v1-3-9cb46e5fe7df@gmail.com> References: <20260323-property-gpio-fix-v1-0-9cb46e5fe7df@gmail.com> In-Reply-To: <20260323-property-gpio-fix-v1-0-9cb46e5fe7df@gmail.com> To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, Hans de Goede , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich , Andy Shevchenko , Daniel Scally , Heikki Krogerus , Sakari Ailus Cc: linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, driver-core@lists.linux.dev X-Mailer: b4 0.15-dev-a6826 When registering a software node, ensure that the property data is not located on the stack, as it is expected to persist for the lifetime of the node. Signed-off-by: Dmitry Torokhov --- drivers/base/swnode.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/base/swnode.c b/drivers/base/swnode.c index 51320837f3a9..45c319a08eb6 100644 --- a/drivers/base/swnode.c +++ b/drivers/base/swnode.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -917,6 +918,7 @@ EXPORT_SYMBOL_GPL(software_node_unregister_node_group); int software_node_register(const struct software_node *node) { struct swnode *parent =3D software_node_to_swnode(node->parent); + const struct property_entry *prop; =20 if (software_node_to_swnode(node)) return -EEXIST; @@ -924,6 +926,13 @@ int software_node_register(const struct software_node = *node) if (node->parent && !parent) return -EINVAL; =20 + for (prop =3D node->properties; prop && prop->name; prop++) { + if (!prop->is_inline && object_is_on_stack(prop->pointer)) { + pr_err("%s: property data can't be on stack\n", __func__); + return -EINVAL; + } + } + return PTR_ERR_OR_ZERO(swnode_register(node, parent, 0)); } EXPORT_SYMBOL_GPL(software_node_register); --=20 2.53.0.1018.g2bb0e51243-goog From nobody Sun Apr 5 16:28:25 2026 Received: from mail-dy1-f178.google.com (mail-dy1-f178.google.com [74.125.82.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 910FC36B047 for ; Tue, 24 Mar 2026 00:40:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774312808; cv=none; b=fItgrFZOpyH7wsYOiNtuelvEmUpdEqxtcGvtOslQYaPnLJMjDs+OEekHr/k2MRTtklA0yyepm5/rWWRW8dkCznAoULGTq4H6jrUvdPJ4EEHuvU4x8UKOahwOJswwklsEJRqohfQTs9j2eI1Os8K+SaXFAlkl9QavOq7UPxbyO8s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774312808; c=relaxed/simple; bh=Gk/XhY40PWnO3LOxD5YjgUSYIokh9KUYlW7/pTRxeiE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Sdfl/O94iCLSsmnsjHQhBADqZX2e4Ne2Ab5L6kIiDavx4MI0UCy1Y3IvYbeb3490XnMchwr3H0/f93Ss8iERCONI4izWbFSLZpbWMXi5ryD9kaXNtz+Oou/FVNOakrVrpW/q+Ws59CE05N5+fSbhrq+liQNFdZ0oqhRfVwt7Ev4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=YWVTJn04; arc=none smtp.client-ip=74.125.82.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="YWVTJn04" Received: by mail-dy1-f178.google.com with SMTP id 5a478bee46e88-2c0c482e069so2676752eec.0 for ; Mon, 23 Mar 2026 17:40:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774312804; x=1774917604; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=iu5Dic5CoGqaGahlCm060hwT3Wf5ekOnX3Fgg92paMs=; b=YWVTJn04HsQ7Hey2ly/vcOQJ0BW3ruRAR8L1AM/MCVZ6TjlSa723dYiSjNMq43+ema xRC2HHBAINwUF9q01onv65Nb5e4h+CmdDnfdI09ZXrXPxfuKdznGXcWx9VtKxOyx5BMe QZ9KGwHI3yNkk1cUDeSG0ukA9WXzI3nmPlSZLT/FUK7avvGb5v/V8YLOr3q2prJMwTfu 4Iq6/QOZZ1jUiUqUxUSVxdLmKdsx2dlsf1Xc/fYlaJv6jmrsLbXztIvuioCyJFs92+FW lf+0EyMf8I605Qu6KG2z0xKDhVjal82jtV5CvRymIDpKf+Y4vNag5iVj+3sFA/tLwfff bg3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774312804; x=1774917604; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=iu5Dic5CoGqaGahlCm060hwT3Wf5ekOnX3Fgg92paMs=; b=dnM3QepP178eihjmn3Z8Typ7Oe93SrtTpRTFZWS2Z/wi7HXvTBeISDxifqz5RJeDmP 1GXlMN5dNwlzHf/Alc37eBIIWSJ6RW3LeGz56XF9hd/iuO830Qrt357r4SnVnw/blrhQ PE4GVGf2fQqznJ4X8hE7zBcKGMwYAn5BXj+JB1li5eSSJcZRCDNrK4z6ok6s/qbXY+XU 1fkQObPST7cxeiykR+X/IwMhXFmh+P+sZkInyKDZRsaOz0kCOsD1DORQreylJpqxQK9x ufAx0mh83N0HTrp22OHPc4H3xlSclK4p1EQvQVw7HrfuEqBhvIvaS89+JggynDSfaTOo n3Kg== X-Gm-Message-State: AOJu0YwY6cmYqEFPGN9byWehm0b0sYJTJNlE3F9T9RqDujvDbYk7d2ri 3VHEDysC85wPDTqqXEo7gvmyRqLzA9h472mAMTggJTBObRRCCBjNK7pb X-Gm-Gg: ATEYQzzpM6RJdF+8b4gyAUfNTEcOfiM7/WQy0oTlvuW9eibsrbx09VDV6N5e6v0dNV+ 5cnovG5+Y55+OZLoC/Ie8x7hRXwbzFiQWL/j9iTXHBT6NXaeDTKyUlJYK8D2cbQSUpYiZXJPzoM vYVhJeWQaRn6SxvnTI+rLmJBYkbnwUDKF4tibcTVb+2oHr6LPnah9QW46pe6+5DMzMvzmrGj2t5 xWIJoh70zILT8eq39eL2W5suieFJEh4yLMx5mHf7IgtE3e24e/0a459zWGcMoCT/M3x2fAdxZUW M2FChfl1CC4HM712znLy4CMJLRFPqVPuv7wK+BNZ5yMQ1JE4DIDKcsIaW+WKWyEzg9Xzc4L1Kmv o+Q2oat8J6jRSjCf+650yYCN7htEjARmHi7ZmrDFKsOk7rESkthdt6hOibaL0p9+EIZcbJrwHb6 ngUg2r2bk+uCWVC3jqBDRP6vSCkqbwdD22iJvYPjrbowyWkUybN++XJci+LvT38uKhtjzmuwipO suIqNOWy6nyVfw= X-Received: by 2002:a05:7301:1486:b0:2ba:68d6:47ae with SMTP id 5a478bee46e88-2c1097ab4a5mr6019191eec.34.1774312804390; Mon, 23 Mar 2026 17:40:04 -0700 (PDT) Received: from dtor-ws.sjc.corp.google.com ([2a00:79e0:2ebe:8:a296:1211:5ab0:bc95]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2c10b17b90dsm17543148eec.10.2026.03.23.17.40.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Mar 2026 17:40:03 -0700 (PDT) From: Dmitry Torokhov Date: Mon, 23 Mar 2026 17:39:40 -0700 Subject: [PATCH 4/4] x86/geode: use PROPERTY_ENTRY_REF for GPIO properties Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260323-property-gpio-fix-v1-4-9cb46e5fe7df@gmail.com> References: <20260323-property-gpio-fix-v1-0-9cb46e5fe7df@gmail.com> In-Reply-To: <20260323-property-gpio-fix-v1-0-9cb46e5fe7df@gmail.com> To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, Hans de Goede , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich , Andy Shevchenko , Daniel Scally , Heikki Krogerus , Sakari Ailus Cc: linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, driver-core@lists.linux.dev X-Mailer: b4 0.15-dev-a6826 Now that the PROPERTY_ENTRY_REF macro can accept a pointer to struct software_node_ref_args directly, we don't need to use the more cumbersome PROPERTY_ENTRY_REF_ARRAY_LEN(..., 1) variant. Signed-off-by: Dmitry Torokhov --- arch/x86/platform/geode/geode-common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/platform/geode/geode-common.c b/arch/x86/platform/geo= de/geode-common.c index 1843ae385e2d..6572ae388d7d 100644 --- a/arch/x86/platform/geode/geode-common.c +++ b/arch/x86/platform/geode/geode-common.c @@ -31,7 +31,7 @@ static const struct software_node geode_gpio_keys_node = =3D { static struct software_node_ref_args geode_restart_gpio_ref; =20 static const struct property_entry geode_restart_key_props[] =3D { - PROPERTY_ENTRY_REF_ARRAY_LEN("gpios", &geode_restart_gpio_ref, 1), + PROPERTY_ENTRY_REF("gpios", &geode_restart_gpio_ref), PROPERTY_ENTRY_U32("linux,code", KEY_RESTART), PROPERTY_ENTRY_STRING("label", "Reset button"), PROPERTY_ENTRY_U32("debounce-interval", 100), @@ -147,7 +147,7 @@ int __init geode_create_leds(const char *label, const s= truct geode_led *leds, leds[i].pin, GPIO_ACTIVE_LOW); props[i * 3 + 0] =3D - PROPERTY_ENTRY_REF_ARRAY_LEN("gpios", &gpio_refs[i], 1); + PROPERTY_ENTRY_REF("gpios", &gpio_refs[i]); props[i * 3 + 1] =3D PROPERTY_ENTRY_STRING("linux,default-trigger", leds[i].default_on ? --=20 2.53.0.1018.g2bb0e51243-goog