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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a329ecf1-5ed9-46c1-86d2-9e8d9ce69195@zytor.com>
Date: Tue, 16 Apr 2024 09:58:45 -0700
From: Xin Li <xin@...or.com>
To: Borislav Petkov <bp@...en8.de>
Cc: linux-kernel@...r.kernel.org, luto@...nel.org, tglx@...utronix.de,
        mingo@...hat.com, dave.hansen@...ux.intel.com, x86@...nel.org,
        hpa@...or.com
Subject: Re: [PATCH v1 1/1] x86/fred: Fix int80 emulation for FRED

On 4/16/2024 3:11 AM, Borislav Petkov wrote:
> On Fri, Apr 12, 2024 at 04:40:58PM -0700, Xin Li (Intel) wrote:
>> Commit 55617fb991df
> 
> Use the full commit abbreviation when mentioning commits:
> 
> "Commit
> 
>    55617fb991df ("x86/entry: Do not allow external 0x80 interrupts")
> 
> .."

oh, I should have done it!

> 
>> added a bunch of tests to the int $0x80 path,
> 
> Added a bunch of tests?
> 

'checks' might be a better term to use?

> What does that even mean?
> 
>> however they are unnecessary and event wrong in fact under FRED.
> 
> Are the bunch of tests wrong or is do_int80_emulation() simply the wrong
> handler to use on a FRED?

I think the explanations are below, and you saw it a bit later.

BTW, comments are added around the code changes.

> 
>> First FRED distinguishes external interrupts from software interrupts,
>> thus int80_emulation() should NEVER be called for handling an external
>> interrupt, and then int80_is_external() should be skipped under FRED.
>>
>> Second, the FRED kernel entry handler NEVER dispatches INTx, which is
>> of event type EVENT_TYPE_SWINT, so the user mode checking in
>> do_int80_emulation() is redundant, and should be skipped.
>>
>> It might be even better to strip down do_int80_emulation() to a lean
>> fred_int80_emulation(), not to mention int80_emulation() does a
>> CLEAR_BRANCH_HISTORY.
> 
> Yah, how about you do a FRED-specific INT80 handler instead of
> sprinkling moar tests around? fred_intx() looks like the right place to
> stuff it in...
> 

I will add fred_int80_emulation(), which duplicates a big part of
do_int80_emulation(), however this seems more readable.

Thanks!
     Xin

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ