From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
To: hare@kernel.org, jejb@linux.ibm.com, martin.petersen@oracle.com
Cc: hare@suse.com, linux-scsi@vger.kernel.org,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Subject: [PATCH 0/2] scsi: myrb: Fix a potential string truncation
Date: Tue, 12 Dec 2023 21:09:09 +0100 [thread overview]
Message-ID: <cover.1702411083.git.christophe.jaillet@wanadoo.fr> (raw)
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
next reply other threads:[~2023-12-12 20:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-12 20:09 Christophe JAILLET [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1702411083.git.christophe.jaillet@wanadoo.fr \
--to=christophe.jaillet@wanadoo.fr \
--cc=hare@kernel.org \
--cc=hare@suse.com \
--cc=jejb@linux.ibm.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox