Skip to contentSkip to conversation

man/man2/seccomp.2: Document SECCOMP_FILTER_FLAG_TSYNC_ESRCH

PATCH In review funsafemath 3 participants 8 messages May 16 – May 18 Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 man/man2/seccomp.2: Document SECCOMP_FILTER_FLAG_TSYNC_ESRCH

Document SECCOMP_FILTER_FLAG_TSYNC_ESRCH flag, which allows to use SECCOMP_FILTER_FLAG_TSYNC and SECCOMP_FILTER_FLAG_NEW_LISTENER flags together by returning ESRCH on synchronization error instead of the thread ID.

<https://lore.kernel.org/r/[email protected]>

---
 man/man2/seccomp.2 | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
man/man2/seccomp.2 +15 -0
index 75c7b2d58..0729a653c 100644
@@ -241,6 +241,21 @@ .SH DESCRIPTION
 .B SECCOMP_MODE_STRICT
 or if it has attached new seccomp filters to itself,
 diverging from the calling thread's filter tree.
+.TP
+.BR SECCOMP_FILTER_FLAG_TSYNC_ESRCH " (since Linux 5.7)"
+.\" commit 51891498f2da78ee64dfad88fa53c9e85fb50abf
+Return
+.B ESRCH
+instead of the thread ID on synchronization failure if
+.B  SECCOMP_FILTER_FLAG_TSYNC
+was specified.
+.IP
+If this flag is not set, using
+.B SECCOMP_FILTER_FLAG_NEW_LISTENER
+and
+.B SECCOMP_FILTER_FLAG_TSYNC
+flags together results in
+.BR EINVAL .
 .RE
 .TP
 .BR SECCOMP_GET_ACTION_AVAIL " (since Linux 4.14)"
Signature · 1 line
2.52.0
#1 lore raw

Hi,

Quoted 7 lines · funsafemath

Document SECCOMP_FILTER_FLAG_TSYNC_ESRCH flag, which allows to use SECCOMP_FILTER_FLAG_TSYNC and SECCOMP_FILTER_FLAG_NEW_LISTENER flags together by returning ESRCH on synchronization error instead of the thread ID.

<https://lore.kernel.org/r/[email protected]>
---

Would you mind signing the patch?

Quoted 8 lines
 man/man2/seccomp.2 | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
man/man2/seccomp.2 +0 -0
index 75c7b2d58..0729a653c 100644

man/man2/seccomp.2 .SH DESCRIPTION · line 248

Quoted 8 lines
man/man2/seccomp.2 +5 -0
@@ -241,6 +241,21 @@ .SH DESCRIPTION
 .B SECCOMP_MODE_STRICT
 or if it has attached new seccomp filters to itself,
 diverging from the calling thread's filter tree.
+.TP
+.BR SECCOMP_FILTER_FLAG_TSYNC_ESRCH " (since Linux 5.7)"
+.\" commit 51891498f2da78ee64dfad88fa53c9e85fb50abf
+Return
+.B ESRCH

I expect that in user space, we'll see -1 in the return value, and ESRCH in errno, right? If so, we should say "Fail with ESRCH ...".

man/man2/seccomp.2 .SH DESCRIPTION · line 250

Quoted 2 lines
man/man2/seccomp.2 +2 -0
+instead of the thread ID on synchronization failure if
+.B  SECCOMP_FILTER_FLAG_TSYNC

Spurious double space. s/ / /

Have a lovely day!
Alex

Quoted 14 lines
man/man2/seccomp.2 +8 -0
+was specified.
+.IP
+If this flag is not set, using
+.B SECCOMP_FILTER_FLAG_NEW_LISTENER
+and
+.B SECCOMP_FILTER_FLAG_TSYNC
+flags together results in
+.BR EINVAL .
 .RE
 .TP
 .BR SECCOMP_GET_ACTION_AVAIL " (since Linux 4.14)"
Signature · 1 line
2.52.0
Signature · 1 line
<https://www.alejandro-colomar.es>
#2 lore raw
Quoted 16 lines · Alejandro Colomar

Hi,

Quoted 7 lines · funsafemath

Document SECCOMP_FILTER_FLAG_TSYNC_ESRCH flag, which allows to use SECCOMP_FILTER_FLAG_TSYNC and SECCOMP_FILTER_FLAG_NEW_LISTENER flags together by returning ESRCH on synchronization error instead of the thread ID.

<https://lore.kernel.org/r/[email protected]>
---

Would you mind signing the patch?

Quoted 3 lines
 man/man2/seccomp.2 | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
Quoted 16 lines

man/man2/seccomp.2 .SH DESCRIPTION · line 248

Quoted 13 lines
man/man2/seccomp.2 +5 -0
index 75c7b2d58..0729a653c 100644
@@ -241,6 +241,21 @@ .SH DESCRIPTION
 .B SECCOMP_MODE_STRICT
 or if it has attached new seccomp filters to itself,
 diverging from the calling thread's filter tree.
+.TP
+.BR SECCOMP_FILTER_FLAG_TSYNC_ESRCH " (since Linux 5.7)"
+.\" commit 51891498f2da78ee64dfad88fa53c9e85fb50abf
+Return
+.B ESRCH

I expect that in user space, we'll see -1 in the return value, and ESRCH in errno, right? If so, we should say "Fail with ESRCH ...".

Yes, exactly. Probably worth changing the wording in the commit message as well.

Tycho

#3 lore raw

Hi Tycho,

Quoted 34 lines · Tycho Andersen
Quoted 16 lines · Alejandro Colomar

Hi,

Quoted 7 lines · funsafemath

Document SECCOMP_FILTER_FLAG_TSYNC_ESRCH flag, which allows to use SECCOMP_FILTER_FLAG_TSYNC and SECCOMP_FILTER_FLAG_NEW_LISTENER flags together by returning ESRCH on synchronization error instead of the thread ID.

<https://lore.kernel.org/r/[email protected]>
---

Would you mind signing the patch?

Quoted 3 lines
 man/man2/seccomp.2 | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
Quoted 16 lines

man/man2/seccomp.2 .SH DESCRIPTION · line 248

Quoted 13 lines
man/man2/seccomp.2 +5 -0
index 75c7b2d58..0729a653c 100644
@@ -241,6 +241,21 @@ .SH DESCRIPTION
 .B SECCOMP_MODE_STRICT
 or if it has attached new seccomp filters to itself,
 diverging from the calling thread's filter tree.
+.TP
+.BR SECCOMP_FILTER_FLAG_TSYNC_ESRCH " (since Linux 5.7)"
+.\" commit 51891498f2da78ee64dfad88fa53c9e85fb50abf
+Return
+.B ESRCH

I expect that in user space, we'll see -1 in the return value, and ESRCH in errno, right? If so, we should say "Fail with ESRCH ...".

Quoted 2 lines

Yes, exactly. Probably worth changing the wording in the commit message as well.

Thanks! I've amended the commit message while applying v2.

Have a lovely night!
Alex

Quoted 2 lines

Tycho

Signature · 1 line
<https://www.alejandro-colomar.es>
#4 lore raw

v2 cover Document seccomp flags

In reply to funsafemath

Hello,

Yes, a libc wrapper would return -1, I've changed the wording and applied other suggestions.

funsafemath (2):
man/man2/seccomp.2: Document SECCOMP_FILTER_FLAG_TSYNC_ESRCH man/man2/seccomp.2: Document SECCOMP_FILTER_FLAG_WAIT_KILLABLE_RECV

 man/man2/seccomp.2 | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

Range-diff against v1:
1: c3c3b728b ! 1: fec59f483 man/man2/seccomp.2: Document SECCOMP_FILTER_FLAG_TSYNC_ESRCH
@@ Commit message

<https://lore.kernel.org/r/[email protected]>

+ Signed-off-by: funsafemath <[email protected]>
+
## man/man2/seccomp.2 ##
@@ man/man2/seccomp.2: .SH DESCRIPTION
.B SECCOMP_MODE_STRICT
@@ man/man2/seccomp.2: .SH DESCRIPTION
+.TP
+.BR SECCOMP_FILTER_FLAG_TSYNC_ESRCH " (since Linux 5.7)"
+.\" commit 51891498f2da78ee64dfad88fa53c9e85fb50abf
-+Return
++Fail with
+.B ESRCH
-+instead of the thread ID on synchronization failure if
-+.B SECCOMP_FILTER_FLAG_TSYNC
++instead of returning the thread ID on synchronization failure if
++.B SECCOMP_FILTER_FLAG_TSYNC
+was specified.
+.IP
+If this flag is not set, using
2: 423b0141b ! 2: 8ead033b8 man/man2/seccomp.2: Document SECCOMP_FILTER_FLAG_WAIT_KILLABLE_RECV
@@ Commit message

Relevant kernel documentation: <Documentation/userspace-api/seccomp_filter.rst>

+ Signed-off-by: funsafemath <[email protected]>
+
## man/man2/seccomp.2 ##
@@ man/man2/seccomp.2: .SH DESCRIPTION
.B SECCOMP_FILTER_FLAG_TSYNC
@@ man/man2/seccomp.2: .SH DESCRIPTION
+.\" commit c2aa2dfef243efe213a480a1ee8566507a5152f4 +Ignore non-fatal signals until the supervisor sends a response. +.IP
++The
+.B SECCOMP_FILTER_FLAG_NEW_LISTENER
+flag must be set.
.RE

Signature · 1 line
2.52.0
#5 lore raw

Re: [PATCH v2 0/2] Document seccomp flags

Hi,

Quoted 7 lines · funsafemath

Hello,

Yes, a libc wrapper would return -1, I've changed the wording and applied other suggestions.

funsafemath (2):
man/man2/seccomp.2: Document SECCOMP_FILTER_FLAG_TSYNC_ESRCH man/man2/seccomp.2: Document SECCOMP_FILTER_FLAG_WAIT_KILLABLE_RECV

Thanks! I've applied both patches.

Have a lovely night!
Alex

Quoted 50 lines
 man/man2/seccomp.2 | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

Range-diff against v1:
1: c3c3b728b ! 1: fec59f483 man/man2/seccomp.2: Document SECCOMP_FILTER_FLAG_TSYNC_ESRCH
@@ Commit message

<https://lore.kernel.org/r/[email protected]>

+ Signed-off-by: funsafemath <[email protected]>
+
## man/man2/seccomp.2 ##
@@ man/man2/seccomp.2: .SH DESCRIPTION
.B SECCOMP_MODE_STRICT
@@ man/man2/seccomp.2: .SH DESCRIPTION
+.TP
+.BR SECCOMP_FILTER_FLAG_TSYNC_ESRCH " (since Linux 5.7)"
+.\" commit 51891498f2da78ee64dfad88fa53c9e85fb50abf
-+Return
++Fail with
+.B ESRCH
-+instead of the thread ID on synchronization failure if
-+.B SECCOMP_FILTER_FLAG_TSYNC
++instead of returning the thread ID on synchronization failure if
++.B SECCOMP_FILTER_FLAG_TSYNC
+was specified.
+.IP
+If this flag is not set, using
2: 423b0141b ! 2: 8ead033b8 man/man2/seccomp.2: Document SECCOMP_FILTER_FLAG_WAIT_KILLABLE_RECV
@@ Commit message

Relevant kernel documentation: <Documentation/userspace-api/seccomp_filter.rst>

+ Signed-off-by: funsafemath <[email protected]>
+
## man/man2/seccomp.2 ##
@@ man/man2/seccomp.2: .SH DESCRIPTION
.B SECCOMP_FILTER_FLAG_TSYNC
@@ man/man2/seccomp.2: .SH DESCRIPTION
+.\" commit c2aa2dfef243efe213a480a1ee8566507a5152f4 +Ignore non-fatal signals until the supervisor sends a response. +.IP
++The
+.B SECCOMP_FILTER_FLAG_NEW_LISTENER
+flag must be set.
.RE

Signature · 1 line
2.52.0
Signature · 1 line
<https://www.alejandro-colomar.es>
#6 lore raw

PATCH v2 1/2 man/man2/seccomp.2: Document SECCOMP_FILTER_FLAG_TSYNC_ESRCH

In reply to funsafemath

Document SECCOMP_FILTER_FLAG_TSYNC_ESRCH flag, which allows to use SECCOMP_FILTER_FLAG_TSYNC and SECCOMP_FILTER_FLAG_NEW_LISTENER flags together by returning ESRCH on synchronization error instead of the thread ID.

<https://lore.kernel.org/r/[email protected]>

---
 man/man2/seccomp.2 | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
man/man2/seccomp.2 +15 -0
index 75c7b2d58..a2776aab7 100644
@@ -241,6 +241,21 @@ .SH DESCRIPTION
 .B SECCOMP_MODE_STRICT
 or if it has attached new seccomp filters to itself,
 diverging from the calling thread's filter tree.
+.TP
+.BR SECCOMP_FILTER_FLAG_TSYNC_ESRCH " (since Linux 5.7)"
+.\" commit 51891498f2da78ee64dfad88fa53c9e85fb50abf
+Fail with
+.B ESRCH
+instead of returning the thread ID on synchronization failure if
+.B SECCOMP_FILTER_FLAG_TSYNC
+was specified.
+.IP
+If this flag is not set, using
+.B SECCOMP_FILTER_FLAG_NEW_LISTENER
+and
+.B SECCOMP_FILTER_FLAG_TSYNC
+flags together results in
+.BR EINVAL .
 .RE
 .TP
 .BR SECCOMP_GET_ACTION_AVAIL " (since Linux 4.14)"
Signature · 1 line
2.52.0
#7 lore raw

PATCH v2 2/2 man/man2/seccomp.2: Document SECCOMP_FILTER_FLAG_WAIT_KILLABLE_RECV

In reply to funsafemath

Document the SECCOMP_FILTER_FLAG_WAIT_KILLABLE_RECV flag,
which makes the process ignore non-fatal signals until the supervisor sends a response

Relevant kernel documentation: <Documentation/userspace-api/seccomp_filter.rst>

---
 man/man2/seccomp.2 | 8 ++++++++
 1 file changed, 8 insertions(+)
man/man2/seccomp.2 +8 -0
index a2776aab7..d01a9eeaa 100644
@@ -256,6 +256,14 @@ .SH DESCRIPTION
 .B SECCOMP_FILTER_FLAG_TSYNC
 flags together results in
 .BR EINVAL .
+.TP
+.BR SECCOMP_FILTER_FLAG_WAIT_KILLABLE_RECV " (since Linux 5.19)"
+.\" commit c2aa2dfef243efe213a480a1ee8566507a5152f4
+Ignore non-fatal signals until the supervisor sends a response.
+.IP
+The
+.B SECCOMP_FILTER_FLAG_NEW_LISTENER
+flag must be set.
 .RE
 .TP
 .BR SECCOMP_GET_ACTION_AVAIL " (since Linux 4.14)"
Signature · 1 line
2.52.0