mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Will Deacon <will@kernel.org>
To: Justin Stitt <justinstitt@google.com>
Cc: Konrad Dybcio <konradybcio@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Mostafa Saleh <smostafa@google.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Kees Cook <keescook@chromium.org>,
	linux-hardening@vger.kernel.org
Subject: Re: [PATCH v4] arm64/sysreg: refactor deprecated strncpy
Date: Fri, 8 Sep 2023 11:18:32 +0100	[thread overview]
Message-ID: <20230908101831.GA6849@willie-the-truck> (raw)
In-Reply-To: <CAFhGd8pMeTuvn_OqzYtRbfAM7L_-Jb_hFA4WY0hMap_eG=F7RA@mail.gmail.com>

On Thu, Sep 07, 2023 at 11:17:08AM -0700, Justin Stitt wrote:
> On Thu, Sep 7, 2023 at 10:37 AM Konrad Dybcio <konradybcio@kernel.org> wrote:
> >
> >
> >
> > On 5.09.2023 22:10, Justin Stitt wrote:
> > > strncpy is deprecated [1] and should not be used if the src string is
> > > not NUL-terminated.
> > >
> > > When dealing with `cmdline` we are counting the number of characters
> > > until a space then copying these over into `buf`. Let's not use any of
> > > the str*() functions since the src string is not necessarily NUL-terminated.
> > >
> > > Prefer `memcpy()` alongside a forced NUL-termination as it more
> > > accurately describes what is going on within this function, i.e: copying
> > > from non NUL-terminated buffer into a NUL-terminated buffer.
> > >
> > > Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1]
> > > Link: https://github.com/KSPP/linux/issues/90
> > > Cc: linux-hardening@vger.kernel.org
> > > Suggested-by: Kees Cook <keescook@chromium.org>
> > > Signed-off-by: Justin Stitt <justinstitt@google.com>
> > > ---
> > Hi,
> >
> > some form of this patch [1] went into -next and it broke booting
> > on at least the Qualcomm SC8280XP-based Lenovo Thinkpad X13S.
> >
> 
> Thanks for the heads up! The previous versions of the patch (including
> the one that was applied) had some errors. This patch should be good
> and Will is looking to apply it to arm64 fixes tree.

Yes, it should be fixed in linux-next 20230908.

Cheers,

Will

      reply	other threads:[~2023-09-08 10:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-05 20:10 Justin Stitt
2023-09-06 18:48 ` Will Deacon
2023-09-06 23:24   ` Justin Stitt
2023-09-07 17:36 ` Konrad Dybcio
2023-09-07 18:17   ` Justin Stitt
2023-09-08 10:18     ` Will Deacon [this message]

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=20230908101831.GA6849@willie-the-truck \
    --to=will@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=justinstitt@google.com \
    --cc=keescook@chromium.org \
    --cc=konradybcio@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=smostafa@google.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

all inboxes | Powered by JetHome®