From: Will Deacon <will@kernel.org>
To: Mostafa Saleh <smostafa@google.com>
Cc: Justin Stitt <justinstitt@google.com>,
Catalin Marinas <catalin.marinas@arm.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 v3] arm64/sysreg: refactor deprecated strncpy
Date: Tue, 5 Sep 2023 15:16:31 +0100 [thread overview]
Message-ID: <20230905141631.GA3236@willie-the-truck> (raw)
In-Reply-To: <ZPHUb4svC//EhyqJ@google.com>
On Fri, Sep 01, 2023 at 12:09:19PM +0000, Mostafa Saleh wrote:
> On Thu, Aug 31, 2023 at 10:55:59PM +0000, Justin Stitt wrote:
> > diff --git a/arch/arm64/kernel/idreg-override.c b/arch/arm64/kernel/idreg-override.c
> > index 2fe2491b692c..3addc09f8746 100644
> > --- a/arch/arm64/kernel/idreg-override.c
> > +++ b/arch/arm64/kernel/idreg-override.c
> > @@ -263,8 +263,8 @@ static __init void __parse_cmdline(const char *cmdline, bool parse_aliases)
> > return;
> >
> > len = min(len, ARRAY_SIZE(buf) - 1);
> > - strncpy(buf, cmdline, len);
> > - buf[len] = 0;
> > + memcpy(buf, cmdline, len);
> > + buf[len] = '\0';
> >
> > if (strcmp(buf, "--") == 0)
> > return;
> >
> > ---
> > base-commit: 706a741595047797872e669b3101429ab8d378ef
> > change-id: 20230810-strncpy-arch-arm64-1f3d328bd9b8
>
> Your patch will not apply on mainline but on the revert, otherwise
>
> Tested-by: Mostafa Saleh <smostafa@google.com>
If somebody can post a v4 based against mainline, then I'm happy to pick
it up as a fix.
Thanks.
Will
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
prev parent reply other threads:[~2023-09-05 14:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-31 22:55 [PATCH v3] arm64/sysreg: refactor deprecated strncpy Justin Stitt
2023-09-01 12:09 ` Mostafa Saleh
2023-09-05 14:16 ` 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=20230905141631.GA3236@willie-the-truck \
--to=will@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=justinstitt@google.com \
--cc=keescook@chromium.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