linux-hardening.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Azeem Shaikh <azeemshaikh38@gmail.com>
To: Richard Weinberger <richard@nod.at>
Cc: Maxim Krasnyansky <maxk@qti.qualcomm.com>,
	anton ivanov <anton.ivanov@cambridgegreys.com>,
	Johannes Berg <johannes@sipsolutions.net>,
	linux-hardening <linux-hardening@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	linux-um <linux-um@lists.infradead.org>,
	"Jason A. Donenfeld" <Jason@zx2c4.com>,
	kernel test robot <lkp@intel.com>
Subject: Re: [PATCH v2] uml: Replace strlcpy with strscpy
Date: Tue, 6 Jun 2023 17:08:27 -0400	[thread overview]
Message-ID: <CADmuW3WzC61-si1j61kzwfx5EcsvSt4QBaY9VHiybBRWAN3yyA@mail.gmail.com> (raw)
In-Reply-To: <1833651082.3690424.1686084717406.JavaMail.zimbra@nod.at>

On Tue, Jun 6, 2023 at 4:51 PM Richard Weinberger <richard@nod.at> wrote:
>
> ----- Ursprüngliche Mail -----
> > Von: "Azeem Shaikh" <azeemshaikh38@gmail.com>
> > 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].
> > In an effort to remove strlcpy() completely [2], replace
> > strlcpy() here with strscpy().
> > No return values were used, so direct replacement is safe.
> >
> > [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy
> > [2] https://github.com/KSPP/linux/issues/89
> >
> > Signed-off-by: Azeem Shaikh <azeemshaikh38@gmail.com>
> > Reported-by: kernel test robot <lkp@intel.com>
> > Closes:
> > https://lore.kernel.org/oe-kbuild-all/202305311135.zGMT1gYR-lkp@intel.com/
>
> Are you sure Reported-by and Closes make sense?
> AFAIK the report was only on your first patch and nothing against upstream.
> So stating this in the updated patch is in vain.

I left the metadata in only for the sake of posterity. If it's not
helpful, I'm ok with removing it.

> Other than that,
> Acked-by: Richard Weinberger <richard@nod.at>

Thanks!

  reply	other threads:[~2023-06-06 21:08 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-06 18:24 [PATCH v2] uml: Replace strlcpy with strscpy Azeem Shaikh
2023-06-06 20:51 ` Richard Weinberger
2023-06-06 21:08   ` Azeem Shaikh [this message]
2023-06-07  4:23     ` Eric Biggers
2023-06-07  8:28       ` Reported-by/Closes tag for uncommitted issues (was: Re: [PATCH v2] uml: Replace strlcpy with strscpy) Johannes Berg
2023-06-07  8:34         ` Richard Weinberger
2023-06-07  9:10           ` Philip Li
2023-06-07  9:17             ` Johannes Berg
2023-06-07  9:39               ` Philip Li
2023-06-07  9:43                 ` Johannes Berg
2023-06-07  9:47                   ` Philip Li

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=CADmuW3WzC61-si1j61kzwfx5EcsvSt4QBaY9VHiybBRWAN3yyA@mail.gmail.com \
    --to=azeemshaikh38@gmail.com \
    --cc=Jason@zx2c4.com \
    --cc=anton.ivanov@cambridgegreys.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-um@lists.infradead.org \
    --cc=lkp@intel.com \
    --cc=maxk@qti.qualcomm.com \
    --cc=richard@nod.at \
    /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;
as well as URLs for NNTP newsgroup(s).