From: "Martin K. Petersen" <martin.petersen@oracle.com>
To: Kees Cook <keescook@chromium.org>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>,
"James E.J. Bottomley" <jejb@linux.ibm.com>,
Steffen Maier <maier@linux.ibm.com>,
Benjamin Block <bblock@linux.ibm.com>,
Heiko Carstens <hca@linux.ibm.com>,
Vasily Gorbik <gor@linux.ibm.com>,
Alexander Gordeev <agordeev@linux.ibm.com>,
Christian Borntraeger <borntraeger@linux.ibm.com>,
Sven Schnelle <svens@linux.ibm.com>,
Azeem Shaikh <azeemshaikh38@gmail.com>,
linux-s390@vger.kernel.org, linux-scsi@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org
Subject: Re: [PATCH v2] scsi: zfcp: Replace strlcpy() with strscpy()
Date: Tue, 05 Dec 2023 20:53:48 -0500 [thread overview]
Message-ID: <yq11qc0p04d.fsf@ca-mkp.ca.oracle.com> (raw)
In-Reply-To: <20231130204056.it.978-kees@kernel.org> (Kees Cook's message of "Thu, 30 Nov 2023 12:41:00 -0800")
Kees,
> strlcpy() reads the entire source buffer first. This read may exceed
> the destination size limit. This is both inefficient and can lead to
> linear read overflows if a source string is not NUL-terminated[1].
> Additionally, it returns the size of the source string, not the
> resulting size of the destination string. In an effort to remove
> strlcpy() completely[2], replace strlcpy() here with strscpy().
Applied to 6.8/scsi-staging, thanks!
--
Martin K. Petersen Oracle Linux Engineering
next prev parent reply other threads:[~2023-12-06 1:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-30 20:41 [PATCH v2] scsi: zfcp: Replace strlcpy() with strscpy() Kees Cook
2023-12-04 17:17 ` Benjamin Block
2023-12-06 1:53 ` Martin K. Petersen [this message]
2023-12-14 4:29 ` Martin K. Petersen
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=yq11qc0p04d.fsf@ca-mkp.ca.oracle.com \
--to=martin.petersen@oracle.com \
--cc=agordeev@linux.ibm.com \
--cc=azeemshaikh38@gmail.com \
--cc=bblock@linux.ibm.com \
--cc=borntraeger@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=jejb@linux.ibm.com \
--cc=keescook@chromium.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=maier@linux.ibm.com \
--cc=svens@linux.ibm.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