Skip to content

vms-7eb: executive L2 AF_PACKET datalink + PHY_IO gate (booted-SCS keystone, piece 1) - #1009

Merged
baron-3dl merged 2 commits into
mainfrom
vms-7eb-exec-l2-datalink
Aug 31, 2026
Merged

vms-7eb: executive L2 AF_PACKET datalink + PHY_IO gate (booted-SCS keystone, piece 1)#1009
baron-3dl merged 2 commits into
mainfrom
vms-7eb-exec-l2-datalink

Conversation

@baron-3dl

Copy link
Copy Markdown
Contributor

What & why

A booted (non-root) VMS process cannot open an AF_PACKET raw socket (needs CAP_NET_RAW) — this is why booted-node SCS was impossible, and why the lab probe only ever "joined a cluster" on the k3s pod's ambient caps. This adds an executive-owned L2 datalink: the kernel owns the AF_PACKET/SOCK_RAW socket (sock_create_kern, bypassing CAP_NET_RAW like exec_socket_create_icmp), reached by a new /dev/vms ioctl surface. So SCSD needs zero Linux caps. Opening it is gated on the real VMS PHY_IO privilege — the executive is the authority, never the environment (INV-6). This is the keystone of vms-110b (booted OVMX joins a real VAX); piece 1 of 3.

Proven against real /dev/vms (QEMU, KVM)

=== test_syssvc_l2_datalink: 14 passed, 0 failed ===
  PASS: L2_OPEN on a real interface -> SS$_NORMAL (nonzero handle/ifindex/MAC)
  PASS: L2_SEND a broadcast frame -> SS$_NORMAL, full length reported
  PASS: $SETPRV disable PHY_IO -> L2_OPEN -> SS$_NOPRIV   (executive-as-authority)
  PASS: L2_OPEN against a nonexistent interface -> SS$_NOSUCHDEV (honest, no fake)
=== FINAL RESULTS: 114 suites passed, 0 failed; 2006 assertions, 0 failed ===

The zero-cap property is real: the process holds no CAP_NET_RAW; the kernel does the I/O. That is exactly what makes the milestone gate un-fakeable (boot with CAP_NET_RAW denied → a join proves the executive did it).

Changes

  • New: src/kernel/vms_l2.h (VMS_IOCTL_L2_OPEN/SEND/RECV/CLOSE 0x92–0x95 + ABI _Static_asserts), src/kernel-core/vms_l2.c (handler: resolve proc → PHY_IO gateexec_l2_*, per-proc handle table), tests/qemu/test_syssvc_l2_datalink.c.
  • Primitive: exec_kbackend_linux.h real AF_PACKET kernel socket (+ brings the NIC up on open, PEDRIVER-style); NetBSD contract-only stubs (ride vms-024); contract in exec_kbackend.h.
  • Wired the N places: dispatch (vms_module.c), kif client (vms_kif.c/.h, SS$_NOSUCHDEV fail-honest), libvmssys_shr.vec, Makefile + distro Kbuild object lists, vms_internal.h handle table.
  • PHY_IO added to VMS_PRV_M_ENFORCED with userspace/kernel _Static_assert lockstep; test_syssvc_ident golden updated to render it (same precedent as vms-651/MOUNT).

Notes for the gate

Executive-as-authority ✓ · SS$_NOSUCHDEV fail-honest, no fallback ✓ · honest negctl (PHY_IO-dropped → SS$_NOPRIV) ✓ · real /dev/vms output ✓. No "joins" claim — that's piece 3 (the harness + a peer). Piece 2 (scsd reroute, compile-time transport separation) follows.

🤖 Generated with Claude Code

https://claude.ai/code/session_014MbZZun7YK3dhF2u6BnbCX

baron-3dl and others added 2 commits August 31, 2026 21:03
A booted (non-root) VMS process cannot open an AF_PACKET raw socket (needs
CAP_NET_RAW), which is why booted-node SCS was impossible. This adds an
executive-owned L2 datalink: the KERNEL owns the AF_PACKET/SOCK_RAW socket
(sock_create_kern, bypassing CAP_NET_RAW like exec_socket_create_icmp), reached
by a new /dev/vms ioctl surface, so SCSD needs zero Linux caps. Access is gated
on the real VMS PHY_IO privilege (executive is the authority, never the
environment) — vms-1e4's milestone slice.

New: src/kernel/vms_l2.h (VMS_IOCTL_L2_OPEN/SEND/RECV/CLOSE 0x92-0x95 + ABI
_Static_asserts), src/kernel-core/vms_l2.c (handler: vms_proc_find_or_err ->
PHY_IO gate -> exec_l2_*, per-proc handle table), tests/qemu/test_syssvc_l2_datalink.c.
Wired the "N places": exec_kbackend_linux.h (real AF_PACKET primitive) +
exec_kbackend.h contract + netbsd stubs (ride vms-024), vms_module.c dispatch,
vms_kif.c/.h client (SS$_NOSUCHDEV fail-honest), libvmssys_shr.vec exports,
Makefile + distro Kbuild object lists, vms_internal.h handle table,
prv_agreement.c PHY_IO lockstep. Userspace + vms.ko build clean; 59/59 host
unit tests pass (no regression).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014MbZZun7YK3dhF2u6BnbCX
…forced)

QEMU /dev/vms run surfaced two real failures (caught by the test, not shipped):

1. L2_SEND failed ENETDOWN — the minimal test initramfs leaves eth0
   administratively down; bind() succeeds but the first send fails. Fix
   (faithful): exec_l2_open now brings the interface UP when the executive
   opens the datalink — exactly as PEDRIVER brings up the LAN adapter when the
   cluster starts. Idempotent, RTNL-locked. This also makes a booted SCS
   self-sufficient (it gets a working link on open, not dependent on external
   ifup).

2. test_syssvc_ident F assertion: adding PRV$M_PHY_IO to VMS_PRV_M_ENFORCED
   (needed for the L2 gate) makes F$GETJPI CURPRIV render PHY_IO for SYSTEM/ALL,
   so the golden grew by ",PHY_IO" (bit 22, after MOUNT bit 17 in the ascending
   render). Exactly the precedent vms-651 set when it added MOUNT. Legitimate
   golden update reflecting a real enforcement change, not test-weakening.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014MbZZun7YK3dhF2u6BnbCX
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant