lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c22d7613-fb2e-11ec-9544-a39ffc7fd955@intel.com>
Date:   Fri, 11 Aug 2023 12:13:30 -0700
From:   Sohil Mehta <sohil.mehta@...el.com>
To:     Jo Van Bulck <jo.vanbulck@...kuleuven.be>,
        <linux-kernel@...r.kernel.org>, <dave.hansen@...ux.intel.com>,
        <luto@...nel.org>, <peterz@...radead.org>, <mingo@...hat.com>
CC:     <x86@...nel.org>, <bp@...en8.de>, <tglx@...utronix.de>,
        <hpa@...or.com>
Subject: Re: [PATCH RESEND] x86/pti: Fix kernel warnings for pti= and nopti
 cmdline options.

On 8/11/2023 11:23 AM, Jo Van Bulck wrote:

> On 08.08.23 17:13, Sohil Mehta wrote:> Can mitigations be off through 
> some other mechanisms such as kernel config?
> I validated this both with and without the proposed patch.
> 

Great, thanks for checking that. The existing print is accurate then. If
it is printed "disabled on command line.", then PTI has been disabled
due to a command line option.

>> Maybe split the mitigations_off check into a separate if and it's own
>> unique print message?
>> Also, with the separated check you can avoid the unnecessary re-setting
>> of pti_mode when pti_mode == PTI_FORCE_OFF is true.
> 
> Thanks, makes sense. I'll make sure to do this in the next patch revision.
> 

Based on above, even when you split the if check only a single print
would be enough, right?

>> In the rare case that both pti= and nopti is set the existing code seems
>> to ignore the nopti option. Would the new implementation do the same?
> 
> Good point. In my understanding, passing such conflicting options is 
> undefined as per the specification [2] and I'm not sure if backwards 
> compatibility is a requirement?
> 

> That being said, I can see the argument that in this case of 
> security-sensitive functionality, it may be desirable to maintain 
> identical behavior for identical kernel parameter combinations and 
> sequences. 

I don't believe that is a requirement either. Sometimes kernel command
lines can get very long and people make mistakes. I just thought it is
neat that the current code is defaulting that way and we should probably
keep the same behavior since it makes sense.

> 
> --> I can update the patch to ensure backwards-compatible behavior in 
> both cases for the next patch revision.
> 

I agree, in both cases pti= overriding the other option (nopti or
mitigations=off) sounds reasonable to me.

Sohil

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ