All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian Göttsche" <cgzones@googlemail.com>
To: selinux@vger.kernel.org
Cc: Stephen Smalley <stephen.smalley.work@gmail.com>
Subject: [PATCH v2 2/2] libselinux: getcon.3: add note about PID races
Date: Wed,  1 Feb 2023 14:15:16 +0100	[thread overview]
Message-ID: <20230201131516.19967-2-cgzones@googlemail.com> (raw)
In-Reply-To: <20230201131516.19967-1-cgzones@googlemail.com>

Add a note that querying a foreign process via its PID is inherently
racy.

Suggested-by: Stephen Smalley <stephen.smalley.work@gmail.com>
Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
---
 libselinux/man/man3/getcon.3 | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libselinux/man/man3/getcon.3 b/libselinux/man/man3/getcon.3
index 1b4fe4b7..be60341b 100644
--- a/libselinux/man/man3/getcon.3
+++ b/libselinux/man/man3/getcon.3
@@ -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)"
-- 
2.39.1


  reply	other threads:[~2023-02-01 13:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-09 17:09 [PATCH] libselinux: add getpidprevcon Christian Göttsche
2023-01-10 13:17 ` Stephen Smalley
2023-01-10 14:14   ` Christian Göttsche
2023-01-10 14:21     ` Stephen Smalley
2023-01-10 14:28       ` Stephen Smalley
2023-02-01 13:15 ` [PATCH v2 1/2] " Christian Göttsche
2023-02-01 13:15   ` Christian Göttsche [this message]
2023-02-11  6:24     ` [PATCH v2 2/2] libselinux: getcon.3: add note about PID races Jason Zaman
2023-02-11  6:24   ` [PATCH v2 1/2] libselinux: add getpidprevcon Jason Zaman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230201131516.19967-2-cgzones@googlemail.com \
    --to=cgzones@googlemail.com \
    --cc=selinux@vger.kernel.org \
    --cc=stephen.smalley.work@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.