]> Projects (at) Tadryanom (dot) Me - AdrOS.git/commit
security: add SMP spinlock protection to futex table (H5)
authorTulio A M Mendes <[email protected]>
Thu, 11 Jun 2026 00:52:51 +0000 (21:52 -0300)
committerTulio A M Mendes <[email protected]>
Thu, 11 Jun 2026 00:52:51 +0000 (21:52 -0300)
commit4419fc9381af39d8e7809d34b9f74196a824a712
treeb723ea4a83e5dbebbf7c5f8829a1ab0657b7eae1
parenta11cee289addcbfc546eef3434313f9d9d321fc8
security: add SMP spinlock protection to futex table (H5)

- Add g_futex_lock spinlock to protect global futex_waiters table
- Protect futex_cleanup_process with spinlock
- Protect FUTEX_WAIT path with spinlock:
  - Slot allocation and registration
  - Timeout cleanup on early return
  - Cleanup after schedule() wakeup
- Protect FUTEX_WAKE path with spinlock:
  - Wakeup loop over waiters
- Existing shared keying by (addr_space, uaddr) preserved
- Prevents race conditions in SMP environments

Validation:
- make -j12: PASS
- make test-host: PASS (111/111)
- make test SMOKE_SMP=4: PASS (127/127)
- make test-battery: PASS (153/153)
- make analyzer: PASS

Addresses H5 from docs/URGENT_SECURITY_STATUS_2026-06-09.md
src/kernel/syscall.c