Skip to content

Commit

Permalink
libselinux: getcon.3: add note about PID races
Browse files Browse the repository at this point in the history
Add a note that querying a foreign process via its PID is inherently
racy.

Suggested-by: Stephen Smalley <[email protected]>
Signed-off-by: Christian Göttsche <[email protected]>
Acked-by: Jason Zaman <[email protected]>
  • Loading branch information
cgzones authored and perfinion committed Feb 11, 2023
1 parent 494eb68 commit 49e65b8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libselinux/man/man3/getcon.3
Original file line number Diff line number Diff line change
Expand Up @@ -149,5 +149,9 @@ The retrieval functions might return success and set
.I *context
to NULL if and only if SELinux is not enabled.

Querying a foreign process via its PID, e.g. \fBgetpidcon\fR() or
\fBgetpidprevcon\fR(), is inherently racy and therefore should never be relied
upon for security purposes.

.SH "SEE ALSO"
.BR selinux "(8), " setexeccon "(3)"

0 comments on commit 49e65b8

Please sign in to comment.