Unable to handle kernel NULL pointer dereference at virtual address
Kernel code read, wrote or jumped to a virtual address that is not mapped or not permitted. This line opens the report; the address at its end is the first clue, often the best one.
The line
[ 42.101337] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000010
[ 42.110194] Mem abort info:
[ 42.112986] ESR = 0x0000000096000004
[ 42.118733] Internal error: Oops: 0000000096000004 [#1] PREEMPT SMP
[ 42.143390] pc : my_probe+0x24/0x80 [my_driver]An arm64 report, shortened and illustrative. On x86 the same event starts with BUG: kernel NULL pointer dereference, address: 0000000000000010 or BUG: unable to handle page fault for address: ....
What it means
On arm64 the words between kernel and at virtual address are chosen from the kind of fault: NULL pointer dereference when the address is below one page, paging request for any other unmapped address, and write to read-only memory, read from unreadable memory or execute from non-executable memory when the address is mapped but the access is not allowed.
The report continues with the fault details, an Internal error: Oops line and the register dump. Whether the board survives is decided there, not here: the process is killed and the kernel goes on, unless the fault was in an interrupt or panic_on_oops is set.
What the address says
Applies to: 64-bit kernels; the poison values are those of Linux v6.12 include/linux/poison.h on arm64 and x86-64.
| Address looks like | Usually means |
|---|---|
0000000000000000 to 0000000000000fff | A member read through a NULL structure pointer; the value is the member’s offset. |
dead000000000100 or dead000000000122 | A list entry used after list_del(): these are LIST_POISON1 and LIST_POISON2. |
6b6b6b6b6b6b6b6b | A pointer read from freed slab memory, with slab poisoning enabled (POISON_FREE is 0x6b). |
| A plausible kernel address | An object or mapping that has been freed or unmapped: use after free, a stale ioremap() or vmalloc() pointer. |
| Random-looking | An uninitialised pointer, or one overwritten by a buffer overflow. |
Source: Linux v6.12: include/linux/poison.h (LIST_POISON1, POISON_FREE)
Common causes
A NULL pointer that was not checked
The fault address is below 0x1000 and the kernel says NULL pointer dereference. A lookup that can fail returned NULL, or an error path left a field unset, and the code read a member through it. The address is the offset of that member inside its structure, which usually identifies the structure once you look at the function on the pc line.
Source: Linux v6.12: arch/arm64/mm/fault.c, the code that chooses the message
A pointer to something that has been freed
The message says paging request and the address looks like a real kernel pointer, or like one of the poison patterns the kernel writes into freed objects and deleted list entries. A timer, work item or interrupt handler is still using an object that another path released: a missing cancel in a remove function is the classic case.
Sources: Linux v6.12: include/linux/poison.h (LIST_POISON1, POISON_FREE) · Linux kernel docs: Kernel Address Sanitizer (KASAN)
A write to read-only memory
The address is mapped, but as read-only: kernel text, read-only data, or a structure declared const. Code that casts away const, or that writes through a pointer into a string literal or an ops table, gets write to read-only memory on arm64.
Source: Linux v6.12: arch/arm64/mm/fault.c, the code that chooses the message
A garbage pointer from corrupted memory
The address has no recognisable pattern and changes from run to run. The pointer was never initialised, or something overwrote it: a buffer overrun in a neighbouring object, or a kernel stack overflow. The function on the pc line is then the victim and not the culprit, and the search has to start from who else writes near that data.
Source: Linux kernel docs: Bug hunting
What to check first
- Read the words after
kerneland the address, and place the address in the table above. That alone often tells a NULL check from a lifetime bug. - Find the
pcline (orRIPon x86) a few lines down. It gives the function and offset where the access happened and the module it is in. - For a small address, list the function’s source and look for a structure member at that offset;
pahole -C <struct> vmlinuxprints the offsets. - For a poison value or a plausible kernel address, look for what frees or unregisters the object and what can still run afterwards: timers, work queues, interrupts, sysfs callbacks.
- Reproduce on a kernel with KASAN, or at least with slab debugging turned on at boot (
slub_debug=FZPU), so that the first bad access is reported with its allocation and free history. - If this is not the first report since boot (
[#2]or higher on the Oops line), go back to[#1]first.
In NeuroTerm
On a serial tab with pattern markers on, NeuroTerm recognises this line as “Board crash: Linux bad access”. A coding agent connected through Terminal Use gets that name in its list of tabs and among the markers of the output it reads, with a cursor for reading the lines around it. Setup is in Terminal Use (MCP).