Re: [PATCH v12 6/8] x86/traps: Communicate a LASS violation in #GP message

From: Borislav Petkov
Date: Tue Nov 18 2025 - 06:24:26 EST


On Mon, Nov 17, 2025 at 11:45:38AM -0800, Sohil Mehta wrote:
> Would this update to the comment help clarify?

Yap, that LGTM.

> /*
> * A NULL pointer dereference usually causes a #PF. However, it
> * can result in a #GP when LASS is active. Provide the same
> * hint in the rare case that the condition is hit without LASS.
> */
> if (*addr < PAGE_SIZE)
> return GP_NULL_POINTER;
>
> /*
> * Assume that LASS caused the exception, because the address is
> * canonical and in the user half.
> */
> if (cpu_feature_enabled(X86_FEATURE_LASS))
> return GP_LASS_VIOLATION;

Thx.

--
Regards/Gruss,
Boris.

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