lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250613134817.681832-13-herve.codina@bootlin.com>
Date: Fri, 13 Jun 2025 15:47:52 +0200
From: Herve Codina <herve.codina@...tlin.com>
To: Andrew Lunn <andrew@...n.ch>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	"Rafael J. Wysocki" <rafael@...nel.org>,
	Danilo Krummrich <dakr@...nel.org>,
	Shawn Guo <shawnguo@...nel.org>,
	Sascha Hauer <s.hauer@...gutronix.de>,
	Pengutronix Kernel Team <kernel@...gutronix.de>,
	Fabio Estevam <festevam@...il.com>,
	Michael Turquette <mturquette@...libre.com>,
	Stephen Boyd <sboyd@...nel.org>,
	Andi Shyti <andi.shyti@...nel.org>,
	Wolfram Sang <wsa+renesas@...g-engineering.com>,
	Peter Rosin <peda@...ntia.se>,
	Derek Kiernan <derek.kiernan@....com>,
	Dragan Cvetic <dragan.cvetic@....com>,
	Arnd Bergmann <arnd@...db.de>,
	Herve Codina <herve.codina@...tlin.com>,
	Rob Herring <robh@...nel.org>,
	Saravana Kannan <saravanak@...gle.com>,
	Bjorn Helgaas <bhelgaas@...gle.com>,
	Mark Brown <broonie@...nel.org>,
	Len Brown <lenb@...nel.org>,
	Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
	Daniel Scally <djrscally@...il.com>,
	Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
	Sakari Ailus <sakari.ailus@...ux.intel.com>
Cc: Wolfram Sang <wsa@...nel.org>,
	Geert Uytterhoeven <geert+renesas@...der.be>,
	Davidlohr Bueso <dave@...olabs.net>,
	Dave Jiang <dave.jiang@...el.com>,
	Alison Schofield <alison.schofield@...el.com>,
	Vishal Verma <vishal.l.verma@...el.com>,
	Ira Weiny <ira.weiny@...el.com>,
	Dan Williams <dan.j.williams@...el.com>,
	linux-kernel@...r.kernel.org,
	imx@...ts.linux.dev,
	linux-arm-kernel@...ts.infradead.org,
	linux-clk@...r.kernel.org,
	linux-i2c@...r.kernel.org,
	devicetree@...r.kernel.org,
	linux-pci@...r.kernel.org,
	linux-spi@...r.kernel.org,
	linux-acpi@...r.kernel.org,
	linux-cxl@...r.kernel.org,
	Allan Nielsen <allan.nielsen@...rochip.com>,
	Horatiu Vultur <horatiu.vultur@...rochip.com>,
	Steen Hegelund <steen.hegelund@...rochip.com>,
	Luca Ceresoli <luca.ceresoli@...tlin.com>,
	Thomas Petazzoni <thomas.petazzoni@...tlin.com>
Subject: [PATCH v3 12/28] driver core: fw_devlink: Tag the fwnode dev member as private

The dev member in the fwnode structure should be accessed only by the
fwnode core. The fw_devlink_set_device() helper has been introduced to
avoid users to set this member directly. All users have been converted
and use fw_devlink_set_device() to set the field.

To avoid future abusers who might set the field directly and allow
sparse to detect them, tag the dev field as a private field.

Signed-off-by: Herve Codina <herve.codina@...tlin.com>
---
 include/linux/fwnode.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/fwnode.h b/include/linux/fwnode.h
index a1345e274125..5762914fdbf2 100644
--- a/include/linux/fwnode.h
+++ b/include/linux/fwnode.h
@@ -54,7 +54,7 @@ struct fwnode_handle {
 	const struct fwnode_operations *ops;
 
 	/* The below is used solely by device links, don't use otherwise */
-	struct device *dev;
+	struct device *__private dev;
 	struct list_head suppliers;
 	struct list_head consumers;
 	u8 flags;
@@ -234,7 +234,7 @@ bool fw_devlink_is_strict(void);
 static inline void fw_devlink_set_device(struct fwnode_handle *fwnode,
 					 struct device *dev)
 {
-	fwnode->dev = dev;
+	ACCESS_PRIVATE(fwnode, dev) = dev;
 }
 
 #endif
-- 
2.49.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ