All of lore.kernel.org
 help / color / mirror / Atom feed
* drivers/video/fbdev/sstfb.c:736:8-16: WARNING: use scnprintf or sprintf
@ 2020-09-15  7:28 kernel test robot
  2020-09-15  7:28 ` [PATCH] coccinelle: api: fix device_attr_show.cocci warnings kernel test robot
  2020-09-15  7:28 ` kernel test robot
  0 siblings, 2 replies; 4+ messages in thread
From: kernel test robot @ 2020-09-15  7:28 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 1198 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   fc4f28bb3daf3265d6bc5f73b497306985bb23ab
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
date:   6 weeks ago
:::::: branch date: 9 hours ago
:::::: commit date: 6 weeks ago
config: arm64-randconfig-c004-20200913 (attached as .config)
compiler: aarch64-linux-gcc (GCC) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Julia Lawall <julia.lawall@lip6.fr>


coccinelle warnings: (new ones prefixed by >>)

>> drivers/video/fbdev/sstfb.c:736:8-16: WARNING: use scnprintf or sprintf
--
>> drivers/usb/usbip/stub_dev.c:33:8-16: WARNING: use scnprintf or sprintf
--
>> drivers/usb/usbip/vudc_sysfs.c:203:8-16: WARNING: use scnprintf or sprintf

Please review and possibly fold the followup patch.

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 34581 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-09-15  7:28 drivers/video/fbdev/sstfb.c:736:8-16: WARNING: use scnprintf or sprintf kernel test robot
@ 2020-09-15  7:28 ` kernel test robot
  2020-09-15  7:28 ` kernel test robot
  1 sibling, 0 replies; 4+ messages in thread
From: kernel test robot @ 2020-09-15  7:28 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 1759 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Valentina Manea <valentina.manea.m@gmail.com>
CC: Shuah Khan <skhan@linuxfoundation.org>
CC: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>
CC: linux-usb(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/usb/usbip/stub_dev.c:33: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
  scnprintf().

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

Fixes: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   fc4f28bb3daf3265d6bc5f73b497306985bb23ab
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
:::::: branch date: 9 hours ago
:::::: commit date: 6 weeks ago

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

 stub_dev.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/usb/usbip/stub_dev.c
+++ b/drivers/usb/usbip/stub_dev.c
@@ -30,7 +30,7 @@ static ssize_t usbip_status_show(struct
 	status = sdev->ud.status;
 	spin_unlock_irq(&sdev->ud.lock);
 
-	return snprintf(buf, PAGE_SIZE, "%d\n", status);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", status);
 }
 static DEVICE_ATTR_RO(usbip_status);
 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-09-15  7:28 drivers/video/fbdev/sstfb.c:736:8-16: WARNING: use scnprintf or sprintf kernel test robot
  2020-09-15  7:28 ` [PATCH] coccinelle: api: fix device_attr_show.cocci warnings kernel test robot
@ 2020-09-15  7:28 ` kernel test robot
  1 sibling, 0 replies; 4+ messages in thread
From: kernel test robot @ 2020-09-15  7:28 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 1768 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Valentina Manea <valentina.manea.m@gmail.com>
CC: Shuah Khan <skhan@linuxfoundation.org>
CC: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>
CC: linux-usb(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/usb/usbip/vudc_sysfs.c:203: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
  scnprintf().

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

Fixes: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   fc4f28bb3daf3265d6bc5f73b497306985bb23ab
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
:::::: branch date: 9 hours ago
:::::: commit date: 6 weeks ago

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

 vudc_sysfs.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/usb/usbip/vudc_sysfs.c
+++ b/drivers/usb/usbip/vudc_sysfs.c
@@ -200,7 +200,7 @@ static ssize_t usbip_status_show(struct
 	status = udc->ud.status;
 	spin_unlock_irq(&udc->ud.lock);
 
-	return snprintf(out, PAGE_SIZE, "%d\n", status);
+	return scnprintf(out, PAGE_SIZE, "%d\n", status);
 }
 static DEVICE_ATTR_RO(usbip_status);
 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* drivers/video/fbdev/sstfb.c:736:8-16: WARNING: use scnprintf or sprintf
@ 2020-08-18 22:52 kernel test robot
  0 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2020-08-18 22:52 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 1039 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   18445bf405cb331117bc98427b1ba6f12418ad17
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
date:   2 weeks ago
:::::: branch date: 85 minutes ago
:::::: commit date: 2 weeks ago
config: x86_64-randconfig-c002-20200818 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Julia Lawall <julia.lawall@lip6.fr>


coccinelle warnings: (new ones prefixed by >>)

>> drivers/video/fbdev/sstfb.c:736:8-16: WARNING: use scnprintf or sprintf

Please review and possibly fold the followup patch.

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 34576 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-09-15  7:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-15  7:28 drivers/video/fbdev/sstfb.c:736:8-16: WARNING: use scnprintf or sprintf kernel test robot
2020-09-15  7:28 ` [PATCH] coccinelle: api: fix device_attr_show.cocci warnings kernel test robot
2020-09-15  7:28 ` kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2020-08-18 22:52 drivers/video/fbdev/sstfb.c:736:8-16: WARNING: use scnprintf or sprintf kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.