Skip to content

Conversation

@hexagonal-sun
Copy link
Owner

  • arch: arm64: vdso: new
    Add a very basic VDSO module which allow the kernel to provide various
    functions to userspace, such as sig_return.

  • arch: arm64: signal: use VDSO for sigreturn
    Support non SA_RESTORER sigactions by using the trampoline in the kernel
    VDSO.

  • process: refactor signal handling and fix action table sharing
    This commit refactors the signal handling subsystem to address a bug in
    process creation and to improve the separation of concerns between
    signal delivery and signal disposition.

    1. Fix Action Table Sharing:
      Previously, the signal action table was wrapped in an Arc, causing
      forked child processes to inadvertently share signal dispositions with
      the parent. SignalActionState now contains a direct SigActionSet and
      implements Clone, ensuring that processes receive a private copy of the
      action table upon fork/clone.

    2. Decouple Signal Selection from Execution:
      The logic for selecting a pending signal has been moved from the
      disposition state into a new take_signal method on OwnedTask. This
      decouples the "taking" of a signal (respecting masks and priorities)
      from the "actioning" of that signal. This is a prerequisite for
      implementing ptrace.

    3. Various cleanup bits:

    • Renamed SignalState to SignalActionState to more accurately
      reflect that it manages signal dispositions.
    • Removed the pending signal set out of the action state and directly
      into the ThreadGroup and OwnedTask.
    • Renamed set_pending to set_signal for consistency.
    • Simplified the signal delivery loop in dispatch_userspace_task
      using the new take_signal API.

Add a very basic VDSO module which allow the kernel to provide various
functions to userspace, such as `sig_return`.
Support non SA_RESTORER sigactions by using the trampoline in the kernel
VDSO.
This commit refactors the signal handling subsystem to address a bug in
process creation and to improve the separation of concerns between
signal delivery and signal disposition.

1. Fix Action Table Sharing:
Previously, the signal action table was wrapped in an `Arc`, causing
forked child processes to inadvertently share signal dispositions with
the parent. `SignalActionState` now contains a direct `SigActionSet` and
implements Clone, ensuring that processes receive a private copy of the
action table upon fork/clone.

2. Decouple Signal Selection from Execution:
The logic for selecting a pending signal has been moved from the
disposition state into a new `take_signal` method on `OwnedTask`. This
decouples the "taking" of a signal (respecting masks and priorities)
from the "actioning" of that signal. This is a prerequisite for
implementing ptrace.

3. Various cleanup bits:
- Renamed `SignalState` to `SignalActionState` to more accurately
  reflect that it manages signal dispositions.
- Removed the `pending` signal set out of the action state and directly
  into the `ThreadGroup` and `OwnedTask`.
- Renamed `set_pending` to `set_signal` for consistency.
- Simplified the signal delivery loop in `dispatch_userspace_task`
  using the new `take_signal` API.
@hexagonal-sun hexagonal-sun merged commit e604b0a into master Jan 9, 2026
4 checks passed
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.

3 participants