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  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]
Date:   Thu, 13 Aug 2020 08:56:09 +0800
From:   kernel test robot <>
To:     Denis Efremov <>
        Julia Lawall <>,
        Stefan Achatz <>,
        Jiri Kosina <>,
        Benjamin Tissoires <>,
Subject: [PATCH] coccinelle: api: fix device_attr_show.cocci warnings

From: kernel test robot <>

drivers/hid/hid-roccat-isku.c:66:8-16: WARNING: use scnprintf or sprintf

 From Documentation/filesystems/sysfs.txt:
  show() must not use snprintf() when formatting the value to be
  returned to user space. If you can guarantee that an overflow
  will never happen you can use sprintf() otherwise you must use

Generated by: scripts/coccinelle/api/device_attr_show.cocci

Fixes: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <>
Signed-off-by: kernel test robot <>

tree: master
head:   7c2a69f610e64c8dec6a06a66e721f4ce1dd783a
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script

Please take the patch only if it's a positive warning. Thanks!

 hid-roccat-isku.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/hid/hid-roccat-isku.c
+++ b/drivers/hid/hid-roccat-isku.c
@@ -63,7 +63,7 @@ static ssize_t isku_sysfs_show_actual_pr
 	struct isku_device *isku =
-	return snprintf(buf, PAGE_SIZE, "%d\n", isku->actual_profile);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", isku->actual_profile);
 static ssize_t isku_sysfs_set_actual_profile(struct device *dev,

Powered by blists - more mailing lists