Re: [PATCH v11 7/9] x86/traps: Communicate a LASS violation in #GP message

Andy Lutomirski
2025-10-31T20:03:59Z

On Fri, Oct 31, 2025, at 12:59 PM, Sohil Mehta wrote:
> On 10/31/2025 10:16 AM, Dave Hansen wrote:
>> On 10/29/25 14:03, Sohil Mehta wrote:
>>> To make the transition easier, enhance the #GP Oops message to include a
>>> hint about LASS violations. Also, add a special hint for kernel NULL
>>> pointer dereferences to match with the existing #PF message.
>>
>> Reviewed-by: Dave Hansen <dave.hansen@linux.intel.com>
>>
>> This also reminds me... Are there tests for this somewhere? How did you
>> test all these new messages?
>
> I have some very simple kernel modules that access invalid user memory
> and generate these faults. I configure the kernel not to panic/reboot.
> But, I have been running them manually.
>
> Invalid accesses from the kernel generate:
> #PF (without LASS):
> BUG: kernel NULL pointer dereference, address: 0000000000000000
> BUG: unable to handle page fault for address: 0000000000100000
>
> #GP (with LASS):
> Oops: general protection fault, kernel NULL pointer dereference 0x0: 0000
> Oops: general protection fault, probably LASS violation for address
> 0x100000: 0000
>
> For testing user SIGSEGVs, the Vsyscall tests have been sufficient to
> cover all scenarios.
>
> Were you looking for anything specific? I can clean them up and post
> them if required.

LKDTM is basically meant for this use case. If you can’t provoke a LASS failure from there, maybe just add another failure type? I would expect that LKDTM can already do a SMAP violation.