Module task

Module task 

Source

Re-exports§

pub use limits::*;

Modules§

container_namespace
dynamic_thread_spawner
The API for spawning dynamic kernel threads.
limits
net
syscalls
tracing

Structs§

AbstractSocketNamespace
A registry of abstract sockets.
ArgNameAndValue
Kernel command line argument structure
AtomicStopState
AtomicTaskFlags
CapturedThreadState
This contains thread state that tracers can inspect and modify. It is captured when a thread stops, and optionally copied back (if dirty) when a thread starts again. An alternative implementation would involve the tracers acting on thread state directly; however, this would involve sharing CurrentTask structures across multiple threads, which goes against the intent of the design of CurrentTask.
Cgroup
Cgroup is a non-root cgroup in a cgroup hierarchy, and can have other Cgroups as children.
CgroupFreezerState
CgroupPidTable
CgroupPidTable contains the mapping of ThreadGroup (by pid) to non-root cgroup. If pid is valid but does not exist in the mapping, then it is assumed to be in the root cgroup.
CgroupRoot
CgroupRoot is the root of the cgroup hierarchy. The root cgroup is different from the rest of the cgroups in a cgroup hierarchy (sub-cgroups of the root) in a few ways:
ControllingTerminal
The controlling terminal of a session.
CurrentTask
The task object associated with the currently executing thread.
DeferredZombiePTracer
Child process that have exited, but the zombie ptrace needs to be consumed before they can be waited for.
DelayedReleaser
Service to handle delayed releases.
FullCredentials
Task permission are determined from their credentials, and if enabled, from their SEStarnix security state.
GenericDuration
This type is a convenience to use when the Timeline isn’t clear in Starnix. It allows storing a generic nanosecond duration which can be used to operate on Instants or Durations from any Timeline.
GrantedSyslog
HrTimer
HrTimerManager
The manager for high-resolution timers.
HwCap
Hardware capabilities.
HwCaps
Hardware capabilities for both 32-bit and 64-bit ELF binaries.
IntervalTimer
IpTables
Stores [IpTable]s associated with each protocol.
Kernel
The shared, mutable state for the entire Starnix kernel.
KernelCgroups
All cgroups of the kernel. There is a single cgroup v2 hierarchy, and one-or-more cgroup v1 hierarchies. TODO(https://fxbug.dev/389748287): Add cgroup v1 hierarchies on the kernel.
KernelFeatures
KernelStats
KernelThreads
The threads that the kernel runs internally.
LockedAndTask
LogSubscription
ManyZxHandleSignalHandler
NormalPriority
The task normal priority, used for favoring or disfavoring a task running with some non-real-time scheduling policies. Ranges from -20 to +19 in “user-space” representation and +1 to +40 in “kernel-internal” representation. See “The nice value” at sched(7) for full specification.
PageFaultExceptionReport
The decoded cross-platform parts we care about for page fault exception reports.
PidTable
PortWaitCanceler
Return values for wait_async methods that monitor the state of a handle.
ProcessExitInfo
ProcessGroup
ProcessGroupMutableState
PtraceCoreState
The ptrace state that a new task needs to connect to the same tracer as the task that clones it.
PtraceEventData
Information about what caused a ptrace-event-stop.
PtraceOptions
PtraceState
Per-task ptrace-related state
ReadyItem
RobustList
RobustListHead
RoleOverrides
Per-container overrides for thread roles.
RoleOverridesBuilder
Builder for RoleOverrides.
SchedulerManager
SchedulerState
SeccompData
SeccompFilter
SeccompFilterContainer
A list of seccomp filters, intended to be associated with a specific process.
SeccompFilterResult
The result of running a set of seccomp filters.
SeccompNotifier
The underlying implementation of the file descriptor that connects a process that triggers a SECCOMP_RET_USER_NOTIF with the monitoring process. This support seccomp’s ability to notify a user-space process on specific syscall triggers. See seccomp_unotify(2) for the semantics.
SeccompState
Per-process state that cannot be stored in the container (e.g., whether there is a container).
Session
A session is a collection of ProcessGroup objects that are related to each other. Each session has a session ID (sid), which is a unique identifier for the session.
SessionMutableState
SignalHandler
SimpleWaiter
Syslog
Task
A unit of execution.
TaskBuilder
TaskContainer
Container around a weak task and a strong TaskPersistentInfo. It is needed to keep the information even when the task is not upgradable, because when the task is dropped, there is a moment where the task is not yet released, yet the weak pointer is not upgradeable anymore. During this time, it is still necessary to access the persistent info to compute the state of the thread for the different wait syscalls.
TaskFlags
TaskMutableState
TaskPersistentInfoState
The information of the task that needs to be available to the ThreadGroup while computing which process a wait can target. It is necessary to shared this data with the ThreadGroup so that it is available while the task is being dropped and so is not accessible from a weak pointer.
ThreadGroup
A collection of Task objects that roughly correspond to a “process”.
ThreadGroupKey
A weak reference to a thread group that can be used in set and maps.
ThreadGroupMutableState
The mutable state of the ThreadGroup.
ThreadGroupParent
A wrapper around a Weak<ThreadGroup> that expects the underlying Weak to always be valid. The wrapper will check this at runtime during creation and upgrade.
ThreadState
The thread related information of a CurrentTask. The information should never be used outside of the thread owning the CurrentTask.
TimerRemaining
TimerTable
TypedWaitQueue
A wait queue that dispatches events based on the value of an enum.
UtsNamespace
WaitCanceler
Return values for wait_async methods.
WaitQueue
A list of waiters waiting for some event.
WaitResult
Waiter
A type that can put a thread to sleep waiting for a condition.
WaiterRef
A weak reference to a Waiter. Intended for holding in wait queues or stashing elsewhere for calling queue_events later.
ZombieProcess
ZombiePtracees
A list of zombie processes that were traced by a given tracer, but which have not yet notified that tracer of their exit. Once the tracer is notified, the original parent will be notified.
ZxioSignalHandler

Enums§

EventHandler
ExceptionResult
ExitStatus
FreezerState
KmsgLevel
ProcessEntryRef
ProcessSelector
A selector that can match a process. Works as a representation of the pid argument to syscalls like wait and kill.
PtraceAllowedPtracers
Indicates processes specifically allowed to trace a given process if using SCOPE_RESTRICTED. Used by prctl(PR_SET_PTRACER).
PtraceAttachType
Indicates the way that ptrace attached to the task.
PtraceEvent
PtraceStatus
For most of the time, for the purposes of ptrace, a tracee is either “going” or “stopped”. However, after certain ptrace calls, there are special rules to be followed.
ReadyItemKey
SeccompAction
SeccompStateValue
Possible values for the current status of the seccomp filters for this process.
SignalHandlerInner
StopState
This enum describes the state that a task or thread group can be in when being stopped. The names are taken from ptrace(2).
SyslogAccess
TargetTime
TaskStateCode
ThreadGroupLifecycleWaitValue
Values used for waiting on the ThreadGroup lifecycle wait queue.
Timeline
TimerWakeup
WaitCallback
WaitableChildResult

Constants§

PR_SET_PTRACER_ANY

Traits§

CgroupOps
Common operations of all cgroups.
CurrentTaskAndLockedReleasable
An object-safe/dyn-compatible trait to wrap Releasable types.
KernelOrTask
An object that can be either a Kernel or a CurrentTask.

Functions§

max_priority_for_sched_policy
min_priority_for_sched_policy
parse_cmdline
path_from_root
Returns the path from the root to this cgroup.
ptrace_attach
ptrace_attach_from_state
Uses the given core ptrace state (including tracer, attach type, etc) to attach to another task, given by tracee_task. Also sends a signal to stop tracee_task. Typical for when inheriting ptrace state from another task.
ptrace_detach
ptrace_dispatch
For all ptrace requests that require an attached tracee
ptrace_getregset
ptrace_peekuser
Implementation of ptrace(PTRACE_PEEKUSER). The user struct holds the registers and other information about the process. See ptrace(2) and sys/user.h for full details.
ptrace_pokeuser
ptrace_setregset
ptrace_syscall_enter
ptrace_syscall_exit
ptrace_traceme
register_delayed_release
Register the container to be deferred released.
with_new_current_task
Create a new system task, register it on the thread and run the given closure with it.

Type Aliases§

AbstractUnixSocketNamespace
AbstractVsockSocketNamespace
CgroupHandle
ClockId
CurrentTaskAndLocked
HrTimerHandle
HrTimerManagerHandle
IntervalTimerHandle
ProcessGroupReadGuard
ProcessGroupStateMutRef
ProcessGroupStateRef
ProcessGroupWriteGuard
RobustListHeadPtr
RobustListPtr
SeccompNotifierHandle
SessionReadGuard
SessionStateMutRef
SessionStateRef
SessionWriteGuard
TaskPersistentInfo
TaskReadGuard
TaskStateMutRef
TaskStateRef
TaskWriteGuard
ThreadGroupReadGuard
ThreadGroupStateMutRef
ThreadGroupStateRef
ThreadGroupWriteGuard
TimerId
UtsNamespaceHandle