[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20230905141631.GA3236@willie-the-truck>
Date: Tue, 5 Sep 2023 15:16:31 +0100
From: Will Deacon <will@...nel.org>
To: Mostafa Saleh <smostafa@...gle.com>
Cc: Justin Stitt <justinstitt@...gle.com>,
Catalin Marinas <catalin.marinas@....com>,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
Kees Cook <keescook@...omium.org>,
linux-hardening@...r.kernel.org
Subject: Re: [PATCH v3] arm64/sysreg: refactor deprecated strncpy
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@...gle.com>
If somebody can post a v4 based against mainline, then I'm happy to pick
it up as a fix.
Thanks.
Will
Powered by blists - more mailing lists