public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] scsi: myrb: Fix a potential string truncation
@ 2023-12-12 20:09 Christophe JAILLET
  2023-12-12 20:09 ` [PATCH 1/2] scsi: myrb: Fix a potential string truncation in rebuild_show() Christophe JAILLET
  2023-12-12 20:09 ` [PATCH 2/2] scsi: myrb: Use sysfs_emit() Christophe JAILLET
  0 siblings, 2 replies; 6+ messages in thread
From: Christophe JAILLET @ 2023-12-12 20:09 UTC (permalink / raw)
  To: hare, jejb, martin.petersen
  Cc: hare, linux-scsi, linux-kernel, kernel-janitors,
	Christophe JAILLET

Patch 1/2 fixes a potential string truncation issue in rebuild_show(). It is
intended to be minimal in order to ease potential backport.

Patch 2/2 is a bigger patch that turns some snprintf() usage in _show functions
into preferred sysfs_emit() calls.
This patch overrides the changes made in 1/2.


There is another warning when building with W=1:
    1051 |                 "%u.%02u-%c-%02u",
         |                 ^~~~~~~~~~~~~~~~~
   drivers/scsi/myrb.c:1050:9: note: ‘snprintf’ output between 10 and 14 bytes into a destination of size 12
but I think that it is a false positive because snprintf() in Linux does not
strickly folows the standard C behavior of snprintf(). If I understand correctly
Linux handles %02u when C ignores it.

Christophe JAILLET (2):
  scsi: myrb: Fix a potential string truncation in rebuild_show()
  scsi: myrb: Use sysfs_emit()

 drivers/scsi/myrb.c | 38 +++++++++++++++++++-------------------
 1 file changed, 19 insertions(+), 19 deletions(-)

-- 
2.34.1


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

end of thread, other threads:[~2023-12-12 20:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-12 20:09 [PATCH 0/2] scsi: myrb: Fix a potential string truncation Christophe JAILLET
2023-12-12 20:09 ` [PATCH 1/2] scsi: myrb: Fix a potential string truncation in rebuild_show() Christophe JAILLET
2023-12-12 20:14   ` Bart Van Assche
2023-12-12 20:20     ` Christophe JAILLET
2023-12-12 20:28       ` Bart Van Assche
2023-12-12 20:09 ` [PATCH 2/2] scsi: myrb: Use sysfs_emit() Christophe JAILLET

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox