All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thorsten Blum <blum@kernel.org>
To: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Oliver Upton <oupton@kernel.org>,
	Yureka Lilian <yureka@cyberchaos.dev>,
	Marc Zyngier <maz@kernel.org>, Ard Biesheuvel <ardb@kernel.org>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] arm64: idreg-override: Detect trailing "--" in __parse_cmdline()
Date: Tue, 27 Oct 2026 15:49:45 +0100	[thread overview]
Message-ID: <auC6CbIclUCJK094@kernel.org> (raw)
In-Reply-To: <auCVj80cR8LILhXB@arm.com>

Hi Catalin,

On Tue, Oct 27, 2026 at 12:14:07PM +0000, Catalin Marinas wrote:
> On Thu, Oct 15, 2026 at 06:10:54PM +0200, Thorsten Blum wrote:
> > __parse_cmdline() detects "--" only if it is followed by whitespace.
> > However, at the end of the command line, it converts the dashes to
> > underscores and tries to match "__" as an option.
> > 
> > Detect trailing "--" directly instead of converting it to "__".
> > 
> > Fixes: dc3f5aae0638 ("arm64: idreg-override: Avoid parameq() and parameqn()")
> > Signed-off-by: Thorsten Blum <blum@kernel.org>
> > ---
> >  arch/arm64/kernel/pi/idreg-override.c | 5 +++--
> >  1 file changed, 3 insertions(+), 2 deletions(-)
> > 
> > diff --git a/arch/arm64/kernel/pi/idreg-override.c b/arch/arm64/kernel/pi/idreg-override.c
> > index acaf56234973..38aa28d19650 100644
> > --- a/arch/arm64/kernel/pi/idreg-override.c
> > +++ b/arch/arm64/kernel/pi/idreg-override.c
> > @@ -352,8 +352,9 @@ static __init void __parse_cmdline(const char *cmdline, bool parse_aliases)
> >  
> >  		cmdline = skip_spaces(cmdline);
> >  
> > -		/* terminate on "--" appearing on the command line by itself */
> > -		if (cmdline[0] == '-' && cmdline[1] == '-' && isspace(cmdline[2]))
> > +		/* Stop at "--" appearing as a separate argument. */
> > +		if (cmdline[0] == '-' && cmdline[1] == '-' &&
> > +		    (!cmdline[2] || isspace(cmdline[2])))
> >  			return;
> 
> I guess that's more of a cleanup. Does it actually fix anything to
> deserve a Fixes tag? We skip an unnecessary lookup for "__" but there's
> no functional difference.

Yes, it's a cleanup.

Functionally, the behavior is equivalent because it also happened to
work before. However, commit dc3f5aae0638 removed the explicit detection
of a trailing "--", so I added the Fixes tag mostly for provenance.

Thanks,
Thorsten


  reply	other threads:[~2026-10-27 14:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-15 16:10 [PATCH] arm64: idreg-override: Detect trailing "--" in __parse_cmdline() Thorsten Blum
2026-10-27 12:14 ` Catalin Marinas
2026-10-27 14:49   ` Thorsten Blum [this message]
2026-10-27 16:45     ` Catalin Marinas

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=auC6CbIclUCJK094@kernel.org \
    --to=blum@kernel.org \
    --cc=ardb@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=maz@kernel.org \
    --cc=oupton@kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=will@kernel.org \
    --cc=yureka@cyberchaos.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.