github.com/SagerNet/gvisor@v0.0.0-20210707092255-7731c139d75c/pkg/sentry/kernel/g3doc/run_states.dot (about) 1 digraph { 2 subgraph { 3 App; 4 } 5 subgraph { 6 Interrupt; 7 InterruptAfterSignalDeliveryStop; 8 } 9 subgraph { 10 Syscall; 11 SyscallAfterPtraceEventSeccomp; 12 SyscallEnter; 13 SyscallAfterSyscallEnterStop; 14 SyscallAfterSysemuStop; 15 SyscallInvoke; 16 SyscallAfterPtraceEventClone; 17 SyscallAfterExecStop; 18 SyscallAfterVforkStop; 19 SyscallReinvoke; 20 SyscallExit; 21 } 22 subgraph { 23 Vsyscall; 24 VsyscallAfterPtraceEventSeccomp; 25 VsyscallInvoke; 26 } 27 subgraph { 28 Exit; 29 ExitMain; // leave thread group, release resources, reparent children, kill PID namespace and wait if TGID 1 30 ExitNotify; // signal parent/tracer, become waitable 31 ExitDone; // represented by t.runState == nil 32 } 33 34 // Task exit 35 Exit -> ExitMain; 36 ExitMain -> ExitNotify; 37 ExitNotify -> ExitDone; 38 39 // Execution of untrusted application code 40 App -> App; 41 42 // Interrupts (usually signal delivery) 43 App -> Interrupt; 44 Interrupt -> Interrupt; // if other interrupt conditions may still apply 45 Interrupt -> Exit; // if killed 46 47 // Syscalls 48 App -> Syscall; 49 Syscall -> SyscallEnter; 50 SyscallEnter -> SyscallInvoke; 51 SyscallInvoke -> SyscallExit; 52 SyscallExit -> App; 53 54 // exit, exit_group 55 SyscallInvoke -> Exit; 56 57 // execve 58 SyscallInvoke -> SyscallAfterExecStop; 59 SyscallAfterExecStop -> SyscallExit; 60 SyscallAfterExecStop -> App; // fatal signal pending 61 62 // vfork 63 SyscallInvoke -> SyscallAfterVforkStop; 64 SyscallAfterVforkStop -> SyscallExit; 65 66 // Vsyscalls 67 App -> Vsyscall; 68 Vsyscall -> VsyscallInvoke; 69 Vsyscall -> App; // fault while reading return address from stack 70 VsyscallInvoke -> App; 71 72 // ptrace-specific branches 73 Interrupt -> InterruptAfterSignalDeliveryStop; 74 InterruptAfterSignalDeliveryStop -> Interrupt; 75 SyscallEnter -> SyscallAfterSyscallEnterStop; 76 SyscallAfterSyscallEnterStop -> SyscallInvoke; 77 SyscallAfterSyscallEnterStop -> SyscallExit; // skipped by tracer 78 SyscallAfterSyscallEnterStop -> App; // fatal signal pending 79 SyscallEnter -> SyscallAfterSysemuStop; 80 SyscallAfterSysemuStop -> SyscallExit; 81 SyscallAfterSysemuStop -> App; // fatal signal pending 82 SyscallInvoke -> SyscallAfterPtraceEventClone; 83 SyscallAfterPtraceEventClone -> SyscallExit; 84 SyscallAfterPtraceEventClone -> SyscallAfterVforkStop; 85 86 // seccomp 87 Syscall -> App; // SECCOMP_RET_TRAP, SECCOMP_RET_ERRNO, SECCOMP_RET_KILL, SECCOMP_RET_TRACE without tracer 88 Syscall -> SyscallAfterPtraceEventSeccomp; // SECCOMP_RET_TRACE 89 SyscallAfterPtraceEventSeccomp -> SyscallEnter; 90 SyscallAfterPtraceEventSeccomp -> SyscallExit; // skipped by tracer 91 SyscallAfterPtraceEventSeccomp -> App; // fatal signal pending 92 Vsyscall -> VsyscallAfterPtraceEventSeccomp; 93 VsyscallAfterPtraceEventSeccomp -> VsyscallInvoke; 94 VsyscallAfterPtraceEventSeccomp -> App; 95 96 // Autosave 97 SyscallInvoke -> SyscallReinvoke; 98 SyscallReinvoke -> SyscallInvoke; 99 }