From: Dave Hansen <dave.hansen@intel.com>
To: Jo Van Bulck <jo.vanbulck@cs.kuleuven.be>,
linux-kernel@vger.kernel.org, dave.hansen@linux.intel.com,
luto@kernel.org, peterz@infradead.org, mingo@redhat.com,
sohil.mehta@intel.com
Cc: x86@kernel.org, bp@alien8.de, tglx@linutronix.de, hpa@zytor.com
Subject: Re: [PATCH 1/1] x86/pti: Fix kernel warnings for pti= and nopti cmdline options.
Date: Fri, 11 Aug 2023 16:42:26 -0700 [thread overview]
Message-ID: <d76126be-9eda-d426-1fa5-a35fd4ca3d57@intel.com> (raw)
In-Reply-To: <295ea2ef-3480-856b-b93a-9ae36f7b2286@cs.kuleuven.be>
On 8/11/23 16:27, Jo Van Bulck wrote:
> On 11.08.23 14:36, Jo Van Bulck wrote:> static enum pti_mode {
>> PTI_AUTO = 0,
>> + PTI_FORCE_AUTO,
>> PTI_FORCE_OFF,
>> PTI_FORCE_ON
>> } pti_mode;
>
> I introduced a new PTI_FORCE_AUTO value here to make pti=auto override
> any mitigations=off parameter. However, I realize now that this may
> inadvertently affect other functions that test for pti_mode == PTI_AUTO
> (eg in pti_kernel_image_global_ok()).
>
> Having 2 constants PTI_AUTO and PTI_FORCE_AUTO is arguably not very
> neat, so we should better get rid of this. I see several options:
>
> - not have pti=auto override mitigations=off
> - have a global var to indicate pti= argument was passed
> - set pti_mode = PTI_AUTO in the pti_mode == PTI_FORCE_AUTO if branch
>
> Not sure which option would best match kernel coding guidelines?
This sound like it's getting a bit out of hand and reaching far beyond
cleaning up some (mostly) harmless warnings.
I bet we have a billion command-line parameters that conflict with each
other. mitigations=off and pti=auto is probably the least of our
worries. Nobody in their right mind is going to say, oh, I *only* want
PTI, I don't care about any other mitigations. That's nuts.
mitigations=off is the big hammer. If you set that, you're basically
shouting from the rooftops, "moar speed!!" You don't get security after
that.
pti=auto does *not* need to override mitigations=off.
next prev parent reply other threads:[~2023-08-11 23:42 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-11 21:36 [PATCH v2 0/1] x86/pti: Fix kernel warnings for pti= and nopti cmdline Jo Van Bulck
2023-08-11 21:36 ` [PATCH 1/1] x86/pti: Fix kernel warnings for pti= and nopti cmdline options Jo Van Bulck
2023-08-11 23:27 ` Jo Van Bulck
2023-08-11 23:42 ` Dave Hansen [this message]
2023-08-11 23:58 ` Sohil Mehta
2023-08-12 0:08 ` Dave Hansen
2023-08-12 0:15 ` Sohil Mehta
2023-08-12 15:53 ` Jo Van Bulck
2023-08-12 15:54 [PATCH v2 0/1] " Jo Van Bulck
2023-08-12 15:54 ` [PATCH 1/1] " Jo Van Bulck
2023-08-14 21:12 ` Sohil Mehta
2023-08-18 22:33 ` Jo Van Bulck
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=d76126be-9eda-d426-1fa5-a35fd4ca3d57@intel.com \
--to=dave.hansen@intel.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=jo.vanbulck@cs.kuleuven.be \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=sohil.mehta@intel.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.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
all inboxes | Powered by JetHome®