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

From: Sohil Mehta
Date: Mon Nov 17 2025 - 12:24:42 EST


On 11/17/2025 6:48 AM, Borislav Petkov wrote:

> Why is the first page frame special to justify a special check?
>

Any dereference to a very low address (the first page frame) is
typically considered as a "NULL" pointer dereference.

$ git log | grep "BUG: kernel NULL pointer dereference"

BUG: kernel NULL pointer dereference, address: 0000000000000000
BUG: kernel NULL pointer dereference, address: 0000000000000010
BUG: kernel NULL pointer dereference, address: 0000000000000008
BUG: kernel NULL pointer dereference, address: 0000000000000008
BUG: kernel NULL pointer dereference, address: 0000000000000040
BUG: kernel NULL pointer dereference, address: 0000000000000264
BUG: kernel NULL pointer dereference, address: 0000000000000000
BUG: kernel NULL pointer dereference, address: 0000000000000098
BUG: kernel NULL pointer dereference, address: 0000000000000000
BUG: kernel NULL pointer dereference, address: 00000000000003c0

The page fault error messages have similar logic:

if (address < PAGE_SIZE && !user_mode(regs))
pr_alert("BUG: kernel NULL pointer dereference, address: %px\n",
(void *)address);

I believe the check is to account for arithmetic or other operations
that may have happened on the "NULL" pointer before it is dereferenced.