From: Alejandro Colomar <alx+linux-hardening@kernel.org>
To: Ritesh Harjani <ritesh.list@gmail.com>
Cc: "Alejandro Colomar" <alx@kernel.org>,
linuxppc-dev@lists.ozlabs.org, linux-hardening@vger.kernel.org,
"Nicholas Piggin" <npiggin@gmail.com>,
"Mauricio Faria de Oliveira" <mauricfo@linux.vnet.ibm.com>,
"Michael Neuling" <mikey@neuling.org>,
"Michal Suchánek" <msuchanek@suse.de>,
"Michael Ellerman" <mpe@ellerman.id.au>,
"Linus Torvalds" <torvalds@linux-foundation.org>
Subject: Re: [PATCH v1] powerpc: Fix off-by-one bug
Date: Sun, 15 Nov 2026 09:09:37 +0100 [thread overview]
Message-ID: <avloOrDZrYtSsQUN@devuan> (raw)
In-Reply-To: <5wxy8x3a.ritesh.list@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1673 bytes --]
Hi Ritesh,
> Date: 2026-11-15 11:17:37+0530
> From: Ritesh Harjani <ritesh.list@gmail.com>
>
> Alejandro Colomar <alx@kernel.org> writes:
>
> > From the surrounding similar calls, the intention seems obvious: this
> > seems intended to check for a prefix.
> >
>
> Could be, however the existing code is not functionally wrong either.
>
> I agree it would have been nicer if all three were consistent. However,
> x86 handles the same parameters with exact matches, so if anything "auto"
> is the one doing the right thing here :)
>
> But making "on"/"off" exact matches on powerpc now could change
> behaviour for someone passing e.g. "offline" today, so I'd rather leave
> those alone too.
>
> > However, I do not understand this code, so take my reading with a grain
> > of salt.
> >
> > Fixes: a048a07d7f453 ("powerpc/64s: Add support for a store forwarding barrier at kernel entry/exit")
>
> IMHO, I don't think this patch fixes anything functional. So, I don't
> think it will be correct to call this as: "Fix off-by-one bug" or
> add fixes tag to it.
> And so, I would suggest, we leave leave today's code as is, based on the
> previous reasoning.
>
> > Signed-off-by: Alejandro Colomar <alx@kernel.org>
> > ---
> >
> > I found this while looking into replacing this code with calls to
> > strprefix().
> >
>
> For your conversion, I think, we should keep today's behaviour as is.
> Maybe streq() for "auto" and strprefix() for "on" and "off", which means
> there is is nothing to change or fix.
Thanks! I'll do that.
Have a lovely day!
Alex
>
> -ritesh
>
--
<https://www.alejandro-colomar.es>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2026-11-15 8:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-14 20:10 [PATCH v1] powerpc: Fix off-by-one bug Alejandro Colomar
2026-11-15 5:47 ` Ritesh Harjani
2026-11-15 8:09 ` Alejandro Colomar [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=avloOrDZrYtSsQUN@devuan \
--to=alx+linux-hardening@kernel.org \
--cc=alx@kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mauricfo@linux.vnet.ibm.com \
--cc=mikey@neuling.org \
--cc=mpe@ellerman.id.au \
--cc=msuchanek@suse.de \
--cc=npiggin@gmail.com \
--cc=ritesh.list@gmail.com \
--cc=torvalds@linux-foundation.org \
/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