Re: PROBLEM: Probabilistic segfault on AMD hardware with INVLPGB

From: Borislav Petkov

Date: Wed Jul 08 2026 - 12:31:37 EST


Hey man,

what's up?

I see you're having fun. :-P

On Tue, Jul 07, 2026 at 01:18:30PM +0100, Matt Fleming wrote:
> Hi Rik and Henrik,
>
> I've got a small C reproducer that triggers this within the first round
> on Cloudflare's AMD Turin machines:
>
> https://gist.github.com/mfleming/ca26ad3f8d65a12d23d62fb176480fc1
>
> Build:
>
> gcc -O2 -Wall -Wextra -pthread -static -o repro-invlpgb repro-invlpgb.c

You need to have -std=c11 here on Debian-based systems because it says

repro-invlpgb.c:94:30: error: implicit declaration of function ‘ATOMIC_VAR_INIT’; did you mean ‘ATOMIC_FLAG_INIT’? [-Wimplicit-function-declaration]
94 | static atomic_bool running = ATOMIC_VAR_INIT(true);

here due to not "seeing" the stdatomic.h include. I guess atomics are a C11
thing... :)

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette