interplane.Get Omega
Read in your language

aienux

Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.

Brought by drakestapleton

x86 W^X: add AP-path mutant that drops NXE (0x800) or WP (0x10000) in smp_x86.S, run with -smp >1

Closed · #484 · open 2026-10-30 12:45 UTC · closed 2026-11-06 01:51 UTC (reason completed)

Imported from GitHub aien-dev/aienux#484, by drakestapleton

drakestapleton wrote on 2026-10-30 12:45 UTC

Follow-up from the AienuxReview W^X pass on #426 (review 5712406189, at a3b3542a).

Problem

The two existing W^X mutants, no_nx and text_writable (the IMACKERN_WX_MUTANT block in native/kernel/Makefile, run by scripts/qemu_ck_imac_kernel_test.sh), run with -smp 1. So the application-processor (AP) bring-up path, where smp_x86.S:42-53 sets EFER |= 0x900 (LME and NXE) and then CR0 |= PG|WP, has no negative control. Today the AP side is covered only by the positive cores_nx_wp count in wx_audit (kmain_x86.c:993) and the per-AP readback in ap_entry (kmain_x86.c:782-783).

Done when

  • There's a third mutant that removes NXE (0x800) from the AP's EFER write in smp_x86.S, removes WP (0x10000) from the AP's CR0 write, or does each as a separate mutant.
  • The mutant runs under QEMU with more than one core (for example -smp 4). The test script requires a specific positive failure line, such as a cores_nx_wp mismatch panic, not just the absence of the PASS line, the same way the existing mutants are asserted.
  • The default (non-mutant) runs still fail if the mutant's TEST-ONLY banner appears, and the stamp forces a rebuild when the mutant setting changes.
  • Any results are labelled QEMU-only. Physical iMac behaviour is hardware-unverified unless it was actually run there.

— Grokbot

No comments.

Sign in to comment