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]
Date: Thu, 23 May 2024 20:27:34 +0200
From: Alexandre Chartre <alexandre.chartre@...cle.com>
To: Andrew Cooper <andrew.cooper3@...rix.com>,
        Dave Hansen <dave.hansen@...el.com>, x86@...nel.org,
        kvm@...r.kernel.org
Cc: alexandre.chartre@...cle.com, linux-kernel@...r.kernel.org,
        daniel.sneddon@...ux.intel.com, pawan.kumar.gupta@...ux.intel.com,
        tglx@...utronix.de, konrad.wilk@...cle.com, peterz@...radead.org,
        gregkh@...uxfoundation.org, seanjc@...gle.com,
        dave.hansen@...ux.intel.com, nik.borisov@...e.com, kpsingh@...nel.org,
        longman@...hat.com, bp@...en8.de, pbonzini@...hat.com
Subject: Re: [PATCH] x86/bhi: BHI mitigation can trigger warning in #DB
 handler



On 5/23/24 19:53, Andrew Cooper wrote:
> On 23/05/2024 6:03 pm, Alexandre Chartre wrote:
>>
>> On 5/23/24 17:36, Dave Hansen wrote:
>>> On 5/23/24 07:52, Alexandre Chartre wrote:
>>>>> Should we wrap up this gem and put it with the other entry selftests?
>>>>
>>>> It looks like tools/testing/selftests/x86/single_step_syscall.c tests
>>>> sysenter with TF set but it doesn't check if the kernel issues any
>>>> warning.
>>>
>>> Does it actually trip the warning though? I'm a bit surprised that
>>> nobody reported it if so.
>>
>> single_step_syscall does trigger the warning:
>>
>> $ ./single_step_syscall
>> [RUN]    Set TF and check nop
>> [OK]    Survived with TF set and 26 traps
>> [RUN]    Set TF and check syscall-less opportunistic sysret
>> [OK]    Survived with TF set and 30 traps
>> [RUN]    Set TF and check a fast syscall
>> [OK]    Survived with TF set and 40 traps
>> [RUN]    Fast syscall with TF cleared
>> [OK]    Nothing unexpected happened
>> [RUN]    Set TF and check SYSENTER
>>      Got SIGSEGV with RIP=ed7fe579, TF=256
>> [RUN]    Fast syscall with TF cleared
>> [OK]    Nothing unexpected happened
> 
> :-/
> 
> What about the exit code?
> 
> I find the absence of a [FAIL] concerning...
> 

$ ./single_step_syscall
[RUN]	Set TF and check nop
[OK]	Survived with TF set and 26 traps
[RUN]	Set TF and check syscall-less opportunistic sysret
[OK]	Survived with TF set and 30 traps
[RUN]	Set TF and check a fast syscall
[OK]	Survived with TF set and 40 traps
[RUN]	Fast syscall with TF cleared
[OK]	Nothing unexpected happened
[RUN]	Set TF and check SYSENTER
	Got SIGSEGV with RIP=bb44b579, TF=256
[RUN]	Fast syscall with TF cleared
[OK]	Nothing unexpected happened

$ echo $?
0

The program runs as expected (but it doesn't expect much than a SIGSEGV).
It triggers a warning from the kernel but it doesn't check if a warning
was produced.

alex.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ