]> Projects (at) Tadryanom (dot) Me - AdrOS.git/commit
scheduler: harden SIGKILL SMP and clone semantics
authorTulio A M Mendes <[email protected]>
Tue, 9 Jun 2026 07:12:43 +0000 (04:12 -0300)
committerTulio A M Mendes <[email protected]>
Tue, 9 Jun 2026 07:12:43 +0000 (04:12 -0300)
commit7aba5c2105bfc8a10948d15b5b7e3cbbc68d6a5c
tree4a82782f38b7b5a8876786be50aa5f77e4f63869
parent995fc6470d7e398f74a95f94900ad9870975bc56
scheduler: harden SIGKILL SMP and clone semantics

Fix the remote SIGKILL path so it no longer tears down a task on behalf of another CPU before that task reaches a safe exit point. SIGKILL is now queued as a fatal pending signal, forcibly unblocked, blocked/sleeping tasks are woken, and reschedule IPIs are sent so the target exits on its own CPU.

Fix CLONE_VM address-space accounting by using the global address-space refcount table to detect the first shared-mm clone and to decide teardown during reap. This closes the leak/counter skew when a non-leader thread creates another CLONE_VM thread.

Align clone semantics with the implementation by rejecting unsupported shared-state flags from the syscall interface, while still inheriting cwd, file references, descriptor flags, signal handlers, and signal mask by copy. Update pthread/fulltest users accordingly.

Also prevent userspace from changing SIGKILL/SIGSTOP disposition or blocking them, make default SIGKILL delivery fatal in usermode signal dispatch, and extend the kill regression test so the child tries to block SIGKILL before spinning.
include/process.h
src/arch/x86/idt.c
src/kernel/scheduler.c
src/kernel/syscall.c
user/cmds/fulltest/fulltest.c
user/ulibc/src/pthread.c