Skip to contentSkip to conversation

libselinux: Document thread caveat for security_compute_av.3

PATCH In review Thiébaud Weksteen 2 participants 3 messages Jun 11, 2025 – Jul 2, 2025 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libselinux: Document thread caveat for security_compute_av.3

Move a similar paragraph for selinux_status_open.3 to a CAVEATS section.

See discussion at https://github.com/SELinuxProject/selinux/issues/287

---
 libselinux/man/man3/security_compute_av.3 | 5 +++++
 libselinux/man/man3/selinux_status_open.3 | 9 +++++----
 2 files changed, 10 insertions(+), 4 deletions(-)
libselinux/man/man3/security_compute_av.3 +5 -0
index 6c82eca5..af8797b5 100644
@@ -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),
libselinux/man/man3/selinux_status_open.3 +5 -4
index 5c9da2f6..5592487f 100644
@@ -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
Signature · 1 line
2.50.0.rc0.642.g800a2b2222-goog
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Thiébaud Weksteen

Move a similar paragraph for selinux_status_open.3 to a CAVEATS section.

See discussion at https://github.com/SELinuxProject/selinux/issues/287

Quoted 52 lines
---
 libselinux/man/man3/security_compute_av.3 | 5 +++++
 libselinux/man/man3/selinux_status_open.3 | 9 +++++----
 2 files changed, 10 insertions(+), 4 deletions(-)
libselinux/man/man3/security_compute_av.3 +5 -0
index 6c82eca5..af8797b5 100644
@@ -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),
libselinux/man/man3/selinux_status_open.3 +5 -5
index 5c9da2f6..5592487f 100644
@@ -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

#2 lore raw
Quoted 10 lines · James Carter
Quoted 6 lines · Thiébaud Weksteen

Move a similar paragraph for selinux_status_open.3 to a CAVEATS section.

See discussion at https://github.com/SELinuxProject/selinux/issues/287

Merged.
Thanks,
Jim

Quoted 53 lines
Quoted 53 lines
---
 libselinux/man/man3/security_compute_av.3 | 5 +++++
 libselinux/man/man3/selinux_status_open.3 | 9 +++++----
 2 files changed, 10 insertions(+), 4 deletions(-)
libselinux/man/man3/security_compute_av.3 +5 -0
index 6c82eca5..af8797b5 100644
@@ -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),
libselinux/man/man3/selinux_status_open.3 +5 -5
index 5c9da2f6..5592487f 100644
@@ -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