Skip to content

Commit

Permalink
docs: selinux: update flowchart
Browse files Browse the repository at this point in the history
Signed-off-by: Rahul Sandhu <[email protected]>
  • Loading branch information
WavyEbuilder committed Feb 27, 2025
1 parent 3e8a4d4 commit d66f51e
Showing 1 changed file with 15 additions and 19 deletions.
34 changes: 15 additions & 19 deletions doc/linux/SELINUX.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,23 @@ as loading the SELinux policy is the first thing dinit does.
The following flowchart provides an overview of the process of loading the policy:
```mermaid
flowchart TD
A[Start] --> B{"Is dinit running as the init system (PID1)?"}
A[Start] --> B{"Is dinit running as the system manager?"}
B -->|Yes| C{Have we been requested to not load the SELinux policy?}
B -->|No| D[Continue rest of dinit initialization]
C -->|Yes| D
C -->|No| E[Is the SELinux policy already loaded?]
C -->|No| D[Continue rest of dinit initialization]
C -->|Yes| E[Is the SELinux policy already loaded?]
E -->|Yes| D
E --> |No| F{Is /proc mounted?}
F --> |Yes| J
F --> |No| G[Attempt to mount /proc]
G --> H{Could we successfully mount /proc?}
H --> |Yes| J
H -->|No| I[Error exit early]
J[Attempt to load the SELinux policy]
E --> |No| G[Attempt to mount /proc]
G --> J[Attempt to load the SELinux policy]
J --> K{Did the SELinux policy load succeed?}
K -->|Yes| L[Attempt to calculate our new context and transition]
K -->|No| I
L --> M{Did we successfully transition?}
M -->|Yes| O{Did we mount /proc?}
M -->|No| N[Log an error to stderr]
N --> O
O -->|Yes| P[Unmount /proc]
O -->|No| D
P --> D
K -->|No| M{Was enforcing mode requested?}
M -->|Yes| I[Error exit early]
M -->|No| D
L --> N{Did we successfully transition?}
N -->|Yes| P{Did we mount /proc?}
N -->|No| O[Log an error]
O --> P
P -->|Yes| Q[Unmount /proc]
P -->|No| D
Q --> D
```

0 comments on commit d66f51e

Please sign in to comment.