From: "Thiébaud Weksteen" <tweek@google.com>
To: Stephen Smalley <stephen.smalley.work@gmail.com>
Cc: "Paul Moore" <paul@paul-moore.com>,
"Seth Moore" <sethmo@google.com>,
selinux@vger.kernel.org,
"Jeffrey Vander Stoep" <jeffv@google.com>,
"Christian Göttsche" <cgzones@googlemail.com>,
"Thiébaud Weksteen" <tweek@google.com>
Subject: [PATCH] libselinux: Document thread caveat for security_compute_av.3
Date: Wed, 11 Jun 2025 17:02:48 +1000 [thread overview]
Message-ID: <20250611070248.2669186-1-tweek@google.com> (raw)
Move a similar paragraph for selinux_status_open.3 to a CAVEATS section.
See discussion at https://github.com/SELinuxProject/selinux/issues/287
Signed-off-by: Thiébaud Weksteen <tweek@google.com>
---
libselinux/man/man3/security_compute_av.3 | 5 +++++
libselinux/man/man3/selinux_status_open.3 | 9 +++++----
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/libselinux/man/man3/security_compute_av.3 b/libselinux/man/man3/security_compute_av.3
index 6c82eca5..af8797b5 100644
--- a/libselinux/man/man3/security_compute_av.3
+++ b/libselinux/man/man3/security_compute_av.3
@@ -181,6 +181,11 @@ function.
.SH "RETURN VALUE"
Returns zero on success or \-1 on error.
.
+.SH "CAVEATS"
+.sp
+These functions are not thread-safe, you have to protect them from
+concurrent calls using exclusive locks when multiple threads are executing.
+.
.SH "SEE ALSO"
.BR string_to_security_class (3),
.BR string_to_av_perm (3),
diff --git a/libselinux/man/man3/selinux_status_open.3 b/libselinux/man/man3/selinux_status_open.3
index 5c9da2f6..5592487f 100644
--- a/libselinux/man/man3/selinux_status_open.3
+++ b/libselinux/man/man3/selinux_status_open.3
@@ -82,10 +82,6 @@ Thus, don't use this value to know actual times of policy reloaded.
.BR selinux_status_deny_unknown ()
returns 0 if SELinux treats policy queries on undefined object classes or
permissions as being allowed, 1 if such queries are denied, or \-1 on error.
-.sp
-Also note that these interfaces are not thread-safe, so you have to protect
-them from concurrent calls using exclusive locks when multiple threads are
-performing.
.
.SH "RETURN VALUE"
.BR selinux_status_open ()
@@ -96,6 +92,11 @@ On error, \-1 shall be returned.
Any other functions with a return value shall return its characteristic
value as described above, or \-1 on errors.
.
+.SH "CAVEATS"
+.sp
+These functions are not thread-safe, you have to protect them from
+concurrent calls using exclusive locks when multiple threads are executing.
+.
.SH "SEE ALSO"
.ad l
.nh
--
2.50.0.rc0.642.g800a2b2222-goog
next reply other threads:[~2025-06-11 7:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-11 7:02 Thiébaud Weksteen [this message]
2025-06-24 15:10 ` [PATCH] libselinux: Document thread caveat for security_compute_av.3 James Carter
2025-07-02 17:33 ` James Carter
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=20250611070248.2669186-1-tweek@google.com \
--to=tweek@google.com \
--cc=cgzones@googlemail.com \
--cc=jeffv@google.com \
--cc=paul@paul-moore.com \
--cc=selinux@vger.kernel.org \
--cc=sethmo@google.com \
--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.