Re: [PATCH] x86/bhi: BHI mitigation can trigger warning in #DB handler

From: Alexandre Chartre
Date: Thu May 23 2024 - 10:53:11 EST



On 5/23/24 16:28, Dave Hansen wrote:
On 5/23/24 05:33, Alexandre Chartre wrote:
The problem can be reproduced with the following sequence:

$ cat sysenter_step.c
int main()
{ asm("pushf; pop %ax; bts $8,%ax; push %ax; popf; sysenter"); }

$ gcc -o sysenter_step sysenter_step.c

$ ./sysenter_step
Segmentation fault (core dumped)

The program is expected to crash, and the #DB handler will issue a warning.

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.

alex.