From: "Martin K. Petersen" <martin.petersen@oracle.com>
To: Pranav Tyagi <pranav.tyagi03@gmail.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>,
linux-scsi@vger.kernel.org, target-devel@vger.kernel.org,
linux-kernel@vger.kernel.org, skhan@linuxfoundation.org,
linux-kernel-mentees@lists.linux.dev
Subject: Re: [PATCH] target/core: replace strncpy with strscpy
Date: Mon, 28 Jul 2025 23:09:29 -0400 [thread overview]
Message-ID: <yq1ms8nn2g8.fsf@ca-mkp.ca.oracle.com> (raw)
In-Reply-To: <CAH4c4jKgPv-Mb1=WvOW+jvGMABXcEgaDMxV0Wit32LPgJitekQ@mail.gmail.com> (Pranav Tyagi's message of "Fri, 25 Jul 2025 17:46:24 +0530")
Hi Pranav!
> As far as I looked, I could only find the following 4 instances of
> strncpy() for the file target_core_transport.c:
>
> target_core_transport.c:1115: strncpy(p_buf, buf, p_buf_len);
> target_core_transport.c:1165: strncpy(p_buf, buf, p_buf_len);
> target_core_transport.c:1225: strncpy(p_buf, buf, p_buf_len);
> target_core_transport.c:1279: strncpy(p_buf, buf, p_buf_len);
>
> And I have changed all of them in my patch. Kindly point me out to
> other instances, if I am missing any.
Sorry, I guess I didn't read far enough. I was focused on the VPD
identifier dump function and whether it could overrun the static buffer.
> Also, I intended this to be a cleanup patch for the deprecated
> strncpy() function and wanted to replace it with strscpy() which is
> encouraged. No functional changes were intended.
In our experience cleanup patches come with a very high risk of
introducing regressions. Regressions in the I/O stack could potentially
lead to issues such as systems failing to boot or people losing their
data. So we generally only merge patches if it can be demonstrated that
they fix an actual problem.
--
Martin K. Petersen
next prev parent reply other threads:[~2025-07-29 3:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-06 9:25 [PATCH] target/core: replace strncpy with strscpy Pranav Tyagi
2025-07-10 13:29 ` Pranav Tyagi
2025-07-25 1:51 ` Martin K. Petersen
2025-07-25 12:16 ` Pranav Tyagi
2025-07-29 3:09 ` Martin K. Petersen [this message]
2025-07-29 9:17 ` Pranav Tyagi
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=yq1ms8nn2g8.fsf@ca-mkp.ca.oracle.com \
--to=martin.petersen@oracle.com \
--cc=linux-kernel-mentees@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=pranav.tyagi03@gmail.com \
--cc=skhan@linuxfoundation.org \
--cc=target-devel@vger.kernel.org \
/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