roadmap NOT-STARTED

716. x86_64 names a kernel stack overflow the way aarch64 and riscv64 do

Title and slug are drafts. Raised at calef's request, from the second of two findings in notes/ci.md. The first is the sibling proposal x86_64's double fault runs on a stack of its own. Title and slug are drafts.

The finding

aarch64 and riscv64 say *** KERNEL STACK OVERFLOW *** and name the stack when a kernel fault lands in a guard page. x86_64 has the stacks and the guard pages and never asks the question.

Why it matters: the 2026-08-14 and 2026-08-16 incidents (notes/stack/kernel-stack-overflows-2026-08-14.md, notes/stack/guard-page-faults-2026-08-16.md) were each read as a memory fault until the kernel named the guard page. x86_64 would repeat that, and under DECISIONS §19 (architectural parity is a tenet) a capability that works on two ISAs and silently not the third is the bug.

Is the dependency on the double-fault proposal real?

Partly, and it decides the order. From the code and the SDM's exception-delivery rule, not from a run:

So this proposal is independently shippable and fixes a real subset, but the headline case needs the sibling's stack, and the check has to be callable from both vectors (14 and 8). Linux is built the same way: its exc_double_fault reads CR2 and calls handle_stack_overflow (see Prior art). The recommendation is to land the sibling first, or to land this with the shared check and the page-fault arm and let the sibling add the second call site. Either order is fine; shipping this alone must not claim to cover overflow in general. CR2 being the delivery-fault address at a double fault is what Linux's code assumes; I have not measured it on QEMU, and the proof plan does.

Proposal

  1. In the fatal arm of x86_trap_body, when vector == 14, call crate::stack::warn_if_guard_page(faulting_address(), frame.rsp) before the register dump, mirroring the aarch64 and riscv64 order. The interrupted rsp is exact here (frame.rsp), so the milestone 124 (a thread is born where it lives) correction, never reading the live sp, holds for free.
  2. Keep the check a function both vectors call, so the sibling's double-fault report can use it.
  3. Delete the per-item dead-code allowances this makes unnecessary, and leave no allowance behind: an allowance would launder a parity gap into "fine", which is what notes/ci.md says.

Proof plan

Prior art outside the tree

Read from source on 2026-10-03 (UTC):

Cost, risk, reversibility

Index row

aarch64 and riscv64 print KERNEL STACK OVERFLOW and name the stack when a fault lands in a guard page, and x86_64 has the guard pages and never asks. Proposed: call stack::warn_if_guard_page from x86_64's fault path.