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 for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20250304143603.995820-1-arnd@kernel.org>
Date: Tue,  4 Mar 2025 15:35:58 +0100
From: Arnd Bergmann <arnd@...nel.org>
To: Borislav Petkov <bp@...en8.de>,
	Tony Luck <tony.luck@...el.com>,
	Fan Ni <fan.ni@...sung.com>,
	Jonathan Cameron <Jonathan.Cameron@...wei.com>,
	Shiju Jose <shiju.jose@...wei.com>
Cc: Arnd Bergmann <arnd@...db.de>,
	James Morse <james.morse@....com>,
	Mauro Carvalho Chehab <mchehab@...nel.org>,
	Robert Richter <rric@...nel.org>,
	"Jiri Slaby (SUSE)" <jirislaby@...nel.org>,
	linux-edac@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: [PATCH] EDAC: fix dev_set_name() format string

From: Arnd Bergmann <arnd@...db.de>

Passing a variable string as the format to dev_set_name() causes a W=1 warning:

drivers/edac/edac_device.c:736:9: error: format not a string literal and no format arguments [-Werror=format-security]
  736 |         ret = dev_set_name(&ctx->dev, name);
      |         ^~~

Use a literal "%s" instead so the name can be the argument.

Fixes: db99ea5f2c03 ("EDAC: Add support for EDAC device features control")
Signed-off-by: Arnd Bergmann <arnd@...db.de>
---
 drivers/edac/edac_device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/edac/edac_device.c b/drivers/edac/edac_device.c
index 16611515ab34..0734909b08a4 100644
--- a/drivers/edac/edac_device.c
+++ b/drivers/edac/edac_device.c
@@ -733,7 +733,7 @@ int edac_dev_register(struct device *parent, char *name,
 	ctx->private = private;
 	dev_set_drvdata(&ctx->dev, ctx);
 
-	ret = dev_set_name(&ctx->dev, name);
+	ret = dev_set_name(&ctx->dev, "%s", name);
 	if (ret)
 		goto data_mem_free;
 
-- 
2.39.5


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ