All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/32] Patches from others
@ 2021-07-28 20:19 Alejandro Colomar
  2021-07-28 20:19 ` [PATCH 01/32] readv2: Note preadv2(..., RWF_NOWAIT) bug in BUGS section Alejandro Colomar
                   ` (32 more replies)
  0 siblings, 33 replies; 92+ messages in thread
From: Alejandro Colomar @ 2021-07-28 20:19 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Alejandro Colomar, linux-man

Hi Michael,

Here is a patch set including patches from others, patches of mine fixing
bug reports of others, tweaks to others' patches, and small patches of mine.

I resent in this patch set all the patches that I sent a few weeks ago,
so you can ignore any older threads of mine.

Cheers,

Alex

--


Alejandro Colomar (11):
  readv.2: Minor tweaks to Will's patch
  vdso.7: Remove outdated limitation for powerpc
  vdso.7: Add y2038 compliant gettime for ppc/32
  posixoptions.7: Fix legacy functions list (s/getcwd/getwd/)
  printf.3: wfix
  futex.2: Minor tweaks to Kurt's patch
  capabilities.7: Minor tweaks to Kir's patch
  seccomp_unotify.2: Minor tweaks to Rodrigo's patch
  strstr.3: Add special case for empty needle
  sigaction.2: Apply minor tweaks to Peter's patch
  strlen.3, wcslen.3: Add recommendations for safer variants

Dan Robertson (1):
  man2/fallocate.2: tfix documentation of shared blocks

Jakub Wilk (3):
  seccomp_unotify.2: tfix
  proc.5: tfix
  scripts/bash_aliases: tfix

Kir Kolyshkin (3):
  capabilities.7: tfix
  user_namespaces.7: fix a ref
  capabilities.7, user_namespaces.7: describe CAP_SETFCAP

Kurt Kanzenbach (1):
  futex.2: Document FUTEX_LOCK_PI2

Peter Collingbourne (1):
  sigaction.2: Document SA_EXPOSE_TAGBITS and the flag support detection
    protocol

Richard Palethorpe (1):
  wait.2: Add ESRCH for when pid == INT_MIN

Rodrigo Campos (1):
  seccomp_unotify.2: Add doc for SECCOMP_ADDFD_FLAG_SEND

Sagar Patel (1):
  tkill.2: tfix

Shawn Landden (1):
  execve.2: Fix absolute/relative pathname

Thomas Voss (1):
  Various pages: Consistently use '*argv[]'

Viet Than (1):
  time.2: wfix regarding year-2038

Will Manley (1):
  readv2: Note preadv2(..., RWF_NOWAIT) bug in BUGS section

kXuan (1):
  recv.2: tfix

Štěpán Němec (2):
  path_resolution.7: tfix
  namespaces.7: fix confusion caused by text reorganization

наб (2):
  ascii.7: add vertical rule to separate the two columns
  pipe.7: also mention writev(2) in atomicity sexion

 man2/bpf.2                |   2 +-
 man2/copy_file_range.2    |   2 +-
 man2/execve.2             |   9 ++-
 man2/fallocate.2          |   2 +-
 man2/futex.2              | 110 +++++++++++++++++++++----------
 man2/membarrier.2         |   4 +-
 man2/perf_event_open.2    |   2 +-
 man2/readv.2              |  11 +++-
 man2/recv.2               |   2 +-
 man2/seccomp.2            |   2 +-
 man2/seccomp_unotify.2    |  30 ++++++++-
 man2/sigaction.2          | 133 ++++++++++++++++++++++++++++++++++++++
 man2/time.2               |   2 +-
 man2/tkill.2              |   2 +-
 man2/wait.2               |   9 +++
 man3/bsearch.3            |   2 +-
 man3/getopt.3             |   2 +-
 man3/getsubopt.3          |   2 +-
 man3/printf.3             |   2 +-
 man3/pthread_setname_np.3 |   2 +-
 man3/strlen.3             |   6 ++
 man3/strstr.3             |   8 +++
 man3/wcslen.3             |   9 ++-
 man3/wordexp.3            |   2 +-
 man5/proc.5               |   2 +-
 man7/ascii.7              |   2 +-
 man7/capabilities.7       |   9 ++-
 man7/fanotify.7           |   2 +-
 man7/namespaces.7         |   4 +-
 man7/path_resolution.7    |   2 +-
 man7/pipe.7               |   2 +
 man7/posixoptions.7       |   2 +-
 man7/user_namespaces.7    |   8 ++-
 man7/vdso.7               |  27 +-------
 scripts/bash_aliases      |   2 +-
 35 files changed, 330 insertions(+), 89 deletions(-)

-- 
2.32.0


^ permalink raw reply	[flat|nested] 92+ messages in thread

* [PATCH 01/32] readv2: Note preadv2(..., RWF_NOWAIT) bug in BUGS section
  2021-07-28 20:19 [PATCH 00/32] Patches from others Alejandro Colomar
@ 2021-07-28 20:19 ` Alejandro Colomar
  2021-08-08  2:29   ` Michael Kerrisk (man-pages)
  2021-07-28 20:19 ` [PATCH 02/32] readv.2: Minor tweaks to Will's patch Alejandro Colomar
                   ` (31 subsequent siblings)
  32 siblings, 1 reply; 92+ messages in thread
From: Alejandro Colomar @ 2021-07-28 20:19 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Will Manley, linux-man, Alejandro Colomar

From: Will Manley <will@williammanley.net>

To save the next person before they fall foul of it.  See
<https://lore.kernel.org/linux-fsdevel/fea8b16d-5a69-40f9-b123-e84dcd6e8f2e@www.fastmail.com/T/#u>
and <https://github.com/tokio-rs/tokio/issues/3803> for more information.

Signed-off-by: Will Manley <will@williammanley.net>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man2/readv.2 | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/man2/readv.2 b/man2/readv.2
index df42cf830..3355fa9d7 100644
--- a/man2/readv.2
+++ b/man2/readv.2
@@ -243,7 +243,9 @@ If some data was successfully read, it will return the number of bytes read.
 If no bytes were read, it will return \-1 and set
 .IR errno
 to
-.BR EAGAIN .
+.BR EAGAIN
+(but see
+.BR BUGS ")."
 Currently, this flag is meaningful only for
 .BR preadv2 ().
 .TP
@@ -425,6 +427,13 @@ iov[1].iov_len = strlen(str1);
 nwritten = writev(STDOUT_FILENO, iov, 2);
 .EE
 .in
+.SH BUGS
+Linux v5.9 and v5.10 have a bug where
+.BR preadv2()
+with the
+.BR RWF_NOWAIT
+flag may return 0 even when not at end of file.  See
+https://lore.kernel.org/linux-fsdevel/fea8b16d-5a69-40f9-b123-e84dcd6e8f2e@www.fastmail.com/T/#u
 .SH SEE ALSO
 .BR pread (2),
 .BR read (2),
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH 02/32] readv.2: Minor tweaks to Will's patch
  2021-07-28 20:19 [PATCH 00/32] Patches from others Alejandro Colomar
  2021-07-28 20:19 ` [PATCH 01/32] readv2: Note preadv2(..., RWF_NOWAIT) bug in BUGS section Alejandro Colomar
@ 2021-07-28 20:19 ` Alejandro Colomar
  2021-08-08  2:30   ` Michael Kerrisk (man-pages)
  2021-07-28 20:19 ` [PATCH 03/32] vdso.7: Remove outdated limitation for powerpc Alejandro Colomar
                   ` (30 subsequent siblings)
  32 siblings, 1 reply; 92+ messages in thread
From: Alejandro Colomar @ 2021-07-28 20:19 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Alejandro Colomar, linux-man, Will Manley

Cc: Will Manley <will@williammanley.net>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man2/readv.2 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/man2/readv.2 b/man2/readv.2
index 3355fa9d7..0debc2d57 100644
--- a/man2/readv.2
+++ b/man2/readv.2
@@ -245,7 +245,7 @@ If no bytes were read, it will return \-1 and set
 to
 .BR EAGAIN
 (but see
-.BR BUGS ")."
+.BR BUGS ).
 Currently, this flag is meaningful only for
 .BR preadv2 ().
 .TP
@@ -433,7 +433,7 @@ Linux v5.9 and v5.10 have a bug where
 with the
 .BR RWF_NOWAIT
 flag may return 0 even when not at end of file.  See
-https://lore.kernel.org/linux-fsdevel/fea8b16d-5a69-40f9-b123-e84dcd6e8f2e@www.fastmail.com/T/#u
+https://lore.kernel.org\:/linux-fsdevel\:/fea8b16d-5a69-40f9-b123-e84dcd6e8f2e@www.fastmail.com\:/T\:/#u
 .SH SEE ALSO
 .BR pread (2),
 .BR read (2),
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH 03/32] vdso.7: Remove outdated limitation for powerpc
  2021-07-28 20:19 [PATCH 00/32] Patches from others Alejandro Colomar
  2021-07-28 20:19 ` [PATCH 01/32] readv2: Note preadv2(..., RWF_NOWAIT) bug in BUGS section Alejandro Colomar
  2021-07-28 20:19 ` [PATCH 02/32] readv.2: Minor tweaks to Will's patch Alejandro Colomar
@ 2021-07-28 20:19 ` Alejandro Colomar
  2021-08-08  0:17   ` Michael Kerrisk (man-pages)
  2021-07-28 20:19 ` [PATCH 04/32] vdso.7: Add y2038 compliant gettime for ppc/32 Alejandro Colomar
                   ` (29 subsequent siblings)
  32 siblings, 1 reply; 92+ messages in thread
From: Alejandro Colomar @ 2021-07-28 20:19 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Alejandro Colomar, linux-man, Christophe Leroy

Christophe Leroy via Bugzilla:

[
https://man7.org/linux/man-pages/man7/vdso.7.html
(as of today, flagged 2021-03-22)

ppc/32 and ppc/64 sections both have the following note:

       The CLOCK_REALTIME_COARSE and CLOCK_MONOTONIC_COARSE clocks
       are not supported by the __kernel_clock_getres and
       __kernel_clock_gettime interfaces; the kernel falls back to
       the real system call

This note has been wrong from quite some time now,
since commit 654abc69ef2e
("powerpc/vdso32: Add support for CLOCK_{REALTIME/MONOTONIC}_COARSE")
and commit 5c929885f1bb
("powerpc/vdso64: Add support for CLOCK_{REALTIME/MONOTONIC}_COARSE")
]

Reported-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man7/vdso.7 | 26 --------------------------
 1 file changed, 26 deletions(-)

diff --git a/man7/vdso.7 b/man7/vdso.7
index ef6bef5bd..1d527c38e 100644
--- a/man7/vdso.7
+++ b/man7/vdso.7
@@ -385,19 +385,6 @@ __kernel_sync_dicache_p5	LINUX_2.6.15
 .in
 .ft P
 \}
-.PP
-The
-.B CLOCK_REALTIME_COARSE
-and
-.B CLOCK_MONOTONIC_COARSE
-clocks are
-.I not
-supported by the
-.I __kernel_clock_getres
-and
-.I __kernel_clock_gettime
-interfaces;
-the kernel falls back to the real system call.
 .SS ppc/64 functions
 .\" See linux/arch/powerpc/kernel/vdso64/vdso64.lds.S
 The table below lists the symbols exported by the vDSO.
@@ -423,19 +410,6 @@ __kernel_sync_dicache_p5	LINUX_2.6.15
 .in
 .ft P
 \}
-.PP
-The
-.B CLOCK_REALTIME_COARSE
-and
-.B CLOCK_MONOTONIC_COARSE
-clocks are
-.I not
-supported by the
-.I __kernel_clock_getres
-and
-.I __kernel_clock_gettime
-interfaces;
-the kernel falls back to the real system call.
 .SS riscv functions
 .\" See linux/arch/riscv/kernel/vdso/vdso.lds.S
 The table below lists the symbols exported by the vDSO.
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH 04/32] vdso.7: Add y2038 compliant gettime for ppc/32
  2021-07-28 20:19 [PATCH 00/32] Patches from others Alejandro Colomar
                   ` (2 preceding siblings ...)
  2021-07-28 20:19 ` [PATCH 03/32] vdso.7: Remove outdated limitation for powerpc Alejandro Colomar
@ 2021-07-28 20:19 ` Alejandro Colomar
  2021-08-08  0:48   ` Michael Kerrisk (man-pages)
  2021-08-08  2:22   ` Michael Kerrisk (man-pages)
  2021-07-28 20:19 ` [PATCH 05/32] posixoptions.7: Fix legacy functions list (s/getcwd/getwd/) Alejandro Colomar
                   ` (28 subsequent siblings)
  32 siblings, 2 replies; 92+ messages in thread
From: Alejandro Colomar @ 2021-07-28 20:19 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Alejandro Colomar, linux-man, Christophe Leroy

Christophe Leroy via Bugzilla:

[
https://man7.org/linux/man-pages/man7/vdso.7.html (2021-03-22)

In ppc32 functions section, the Y2038 compliant function
__kernel_clock_gettime64() is missing.

It was added by commit d0e3fc69d00d
("powerpc/vdso: Provide __kernel_clock_gettime64() on vdso32")
]

.../linux$ git describe d0e3fc69d00d
v5.10-rc2-76-gd0e3fc69d00d

Reported-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man7/vdso.7 | 1 +
 1 file changed, 1 insertion(+)

diff --git a/man7/vdso.7 b/man7/vdso.7
index 1d527c38e..5fb22ab5e 100644
--- a/man7/vdso.7
+++ b/man7/vdso.7
@@ -371,6 +371,7 @@ symbol	version
 _
 __kernel_clock_getres	LINUX_2.6.15
 __kernel_clock_gettime	LINUX_2.6.15
+__kernel_clock_gettime64	LINUX_5.10
 __kernel_datapage_offset	LINUX_2.6.15
 __kernel_get_syscall_map	LINUX_2.6.15
 __kernel_get_tbfreq	LINUX_2.6.15
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH 05/32] posixoptions.7: Fix legacy functions list (s/getcwd/getwd/)
  2021-07-28 20:19 [PATCH 00/32] Patches from others Alejandro Colomar
                   ` (3 preceding siblings ...)
  2021-07-28 20:19 ` [PATCH 04/32] vdso.7: Add y2038 compliant gettime for ppc/32 Alejandro Colomar
@ 2021-07-28 20:19 ` Alejandro Colomar
  2021-08-08  0:55   ` Michael Kerrisk (man-pages)
  2021-07-28 20:19 ` [PATCH 06/32] man2/fallocate.2: tfix documentation of shared blocks Alejandro Colomar
                   ` (27 subsequent siblings)
  32 siblings, 1 reply; 92+ messages in thread
From: Alejandro Colomar @ 2021-07-28 20:19 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Alejandro Colomar, linux-man, Alan Peakall

Alan:

[
The on-line copy of the manual page "posixoptions(7)" dated
2018-04-30 has an entry for "getcwd()" in the section headed
"XSI - _XOPEN_LEGACY - _SC_XOPEN_LEGACY".
I believe that entry should be "getwd()" as that is the API call
which was present in X/Open-6 but withdrawn in X/Open-7.
]

Reported-by: Alan Peakall <Alan.Peakall@helpsystems.com>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man7/posixoptions.7 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man7/posixoptions.7 b/man7/posixoptions.7
index d2ee10302..d6882fe05 100644
--- a/man7/posixoptions.7
+++ b/man7/posixoptions.7
@@ -968,7 +968,7 @@ The following functions are present:
 .IR fcvt ()
 .IR ftime ()
 .IR gcvt ()
-.IR getcwd ()
+.IR getwd ()
 .IR index ()
 .IR mktemp ()
 .IR rindex ()
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH 06/32] man2/fallocate.2: tfix documentation of shared blocks
  2021-07-28 20:19 [PATCH 00/32] Patches from others Alejandro Colomar
                   ` (4 preceding siblings ...)
  2021-07-28 20:19 ` [PATCH 05/32] posixoptions.7: Fix legacy functions list (s/getcwd/getwd/) Alejandro Colomar
@ 2021-07-28 20:19 ` Alejandro Colomar
  2021-08-08  0:54   ` Michael Kerrisk (man-pages)
  2021-07-28 20:19 ` [PATCH 07/32] printf.3: wfix Alejandro Colomar
                   ` (26 subsequent siblings)
  32 siblings, 1 reply; 92+ messages in thread
From: Alejandro Colomar @ 2021-07-28 20:19 UTC (permalink / raw)
  To: mtk.manpages
  Cc: Dan Robertson, linux-man, Darrick J . Wong, Alejandro Colomar

From: Dan Robertson <dan@dlrobertson.com>

Fix a typo in the documentation of using fallocate to allocate shared
blocks. The flag FALLOC_FL_UNSHARE should instead be documented as
FALLOC_FL_UNSHARE_RANGE.

Fixes: 63a599c657d8 ("man2/fallocate.2: Document behavior with shared blocks")
Signed-off-by: Dan Robertson <dan@dlrobertson.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man2/fallocate.2 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man2/fallocate.2 b/man2/fallocate.2
index a62706193..b4cb3516f 100644
--- a/man2/fallocate.2
+++ b/man2/fallocate.2
@@ -81,7 +81,7 @@ Preallocating zeroed blocks beyond the end of the file in this manner
 is useful for optimizing append workloads.
 .PP
 If the
-.B FALLOC_FL_UNSHARE
+.B FALLOC_FL_UNSHARE_RANGE
 flag is specified in
 .IR mode ,
 shared file data extents will be made private to the file to guarantee
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH 07/32] printf.3: wfix
  2021-07-28 20:19 [PATCH 00/32] Patches from others Alejandro Colomar
                   ` (5 preceding siblings ...)
  2021-07-28 20:19 ` [PATCH 06/32] man2/fallocate.2: tfix documentation of shared blocks Alejandro Colomar
@ 2021-07-28 20:19 ` Alejandro Colomar
  2021-08-07 21:34   ` Michael Kerrisk (man-pages)
  2021-07-28 20:19 ` [PATCH 08/32] Various pages: Consistently use '*argv[]' Alejandro Colomar
                   ` (25 subsequent siblings)
  32 siblings, 1 reply; 92+ messages in thread
From: Alejandro Colomar @ 2021-07-28 20:19 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Alejandro Colomar, linux-man, Sergey Petrakov

Reported-by: Sergey Petrakov <kr@spmail.info>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man3/printf.3 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man3/printf.3 b/man3/printf.3
index fcc3bd6f3..1074626e1 100644
--- a/man3/printf.3
+++ b/man3/printf.3
@@ -115,7 +115,7 @@ is the same as
 except that it outputs to a file descriptor,
 .IR fd ,
 instead of to a
-.I stdio
+.I FILE
 stream.
 .PP
 The functions
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH 08/32] Various pages: Consistently use '*argv[]'
  2021-07-28 20:19 [PATCH 00/32] Patches from others Alejandro Colomar
                   ` (6 preceding siblings ...)
  2021-07-28 20:19 ` [PATCH 07/32] printf.3: wfix Alejandro Colomar
@ 2021-07-28 20:19 ` Alejandro Colomar
  2021-08-07 21:35   ` Michael Kerrisk (man-pages)
  2021-07-28 20:19 ` [PATCH 09/32] path_resolution.7: tfix Alejandro Colomar
                   ` (24 subsequent siblings)
  32 siblings, 1 reply; 92+ messages in thread
From: Alejandro Colomar @ 2021-07-28 20:19 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Thomas Voss, linux-man, Alejandro Colomar

From: Thomas Voss <thomasavoss@protonmail.com>

Scripted change:

$ find man? -type f \
  | sed -i 's/int argc, char \*\*argv/int argc, char \*argv\[\]/';

Signed-off-by: Thomas Voss <thomasavoss@protonmail.com>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man2/bpf.2                | 2 +-
 man2/copy_file_range.2    | 2 +-
 man2/membarrier.2         | 4 ++--
 man2/perf_event_open.2    | 2 +-
 man2/seccomp.2            | 2 +-
 man3/bsearch.3            | 2 +-
 man3/getopt.3             | 2 +-
 man3/getsubopt.3          | 2 +-
 man3/pthread_setname_np.3 | 2 +-
 man3/wordexp.3            | 2 +-
 man7/fanotify.7           | 2 +-
 11 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/man2/bpf.2 b/man2/bpf.2
index 6e1ffa198..246053201 100644
--- a/man2/bpf.2
+++ b/man2/bpf.2
@@ -1212,7 +1212,7 @@ riscv (since Linux 5.1).
  * 4. print number of received TCP/UDP packets every second
  */
 int
-main(int argc, char **argv)
+main(int argc, char *argv[])
 {
     int sock, map_fd, prog_fd, key;
     long long value = 0, tcp_cnt, udp_cnt;
diff --git a/man2/copy_file_range.2 b/man2/copy_file_range.2
index 467a16300..03bafcffc 100644
--- a/man2/copy_file_range.2
+++ b/man2/copy_file_range.2
@@ -236,7 +236,7 @@ or server-side-copy (in the case of NFS).
 #include <unistd.h>
 
 int
-main(int argc, char **argv)
+main(int argc, char *argv[])
 {
     int fd_in, fd_out;
     struct stat stat;
diff --git a/man2/membarrier.2 b/man2/membarrier.2
index fec82f228..2771ebdcb 100644
--- a/man2/membarrier.2
+++ b/man2/membarrier.2
@@ -358,7 +358,7 @@ slow_path(int *read_a)
 }
 
 int
-main(int argc, char **argv)
+main(int argc, char *argv[])
 {
     int read_a, read_b;
 
@@ -444,7 +444,7 @@ slow_path(int *read_a)
 }
 
 int
-main(int argc, char **argv)
+main(int argc, char *argv[])
 {
     int read_a, read_b;
 
diff --git a/man2/perf_event_open.2 b/man2/perf_event_open.2
index d2523dd3d..daf5edddf 100644
--- a/man2/perf_event_open.2
+++ b/man2/perf_event_open.2
@@ -3762,7 +3762,7 @@ perf_event_open(struct perf_event_attr *hw_event, pid_t pid,
 }
 
 int
-main(int argc, char **argv)
+main(int argc, char *argv[])
 {
     struct perf_event_attr pe;
     long long count;
diff --git a/man2/seccomp.2 b/man2/seccomp.2
index a3421871f..8c80fb7bb 100644
--- a/man2/seccomp.2
+++ b/man2/seccomp.2
@@ -1199,7 +1199,7 @@ install_filter(int syscall_nr, int t_arch, int f_errno)
 }
 
 int
-main(int argc, char **argv)
+main(int argc, char *argv[])
 {
     if (argc < 5) {
         fprintf(stderr, "Usage: "
diff --git a/man3/bsearch.3 b/man3/bsearch.3
index 25ab3e8de..43e8b9c57 100644
--- a/man3/bsearch.3
+++ b/man3/bsearch.3
@@ -124,7 +124,7 @@ compmi(const void *m1, const void *m2)
 }
 
 int
-main(int argc, char **argv)
+main(int argc, char *argv[])
 {
     qsort(months, nr_of_months, sizeof(months[0]), compmi);
     for (int i = 1; i < argc; i++) {
diff --git a/man3/getopt.3 b/man3/getopt.3
index 0d6ad1c54..ce4c28088 100644
--- a/man3/getopt.3
+++ b/man3/getopt.3
@@ -491,7 +491,7 @@ with most of its features.
 #include <getopt.h>
 
 int
-main(int argc, char **argv)
+main(int argc, char *argv[])
 {
     int c;
     int digit_optind = 0;
diff --git a/man3/getsubopt.3 b/man3/getsubopt.3
index 99d112e63..2649984bb 100644
--- a/man3/getsubopt.3
+++ b/man3/getsubopt.3
@@ -160,7 +160,7 @@ The following program expects suboptions following a "\-o" option.
 #include <stdio.h>
 
 int
-main(int argc, char **argv)
+main(int argc, char *argv[])
 {
     enum {
         RO_OPT = 0,
diff --git a/man3/pthread_setname_np.3 b/man3/pthread_setname_np.3
index a1fb3fa21..77c18a3cf 100644
--- a/man3/pthread_setname_np.3
+++ b/man3/pthread_setname_np.3
@@ -180,7 +180,7 @@ threadfunc(void *parm)
 }
 
 int
-main(int argc, char **argv)
+main(int argc, char *argv[])
 {
     pthread_t thread;
     int rc;
diff --git a/man3/wordexp.3 b/man3/wordexp.3
index c583d559e..0aef4cc68 100644
--- a/man3/wordexp.3
+++ b/man3/wordexp.3
@@ -240,7 +240,7 @@ is approximately that of "ls [a-c]*.c".
 #include <wordexp.h>
 
 int
-main(int argc, char **argv)
+main(int argc, char *argv[])
 {
     wordexp_t p;
     char **w;
diff --git a/man7/fanotify.7 b/man7/fanotify.7
index 6a7e70d75..9c218fd06 100644
--- a/man7/fanotify.7
+++ b/man7/fanotify.7
@@ -1069,7 +1069,7 @@ $ \fBmkdir \-p /home/user/testdir\fP          # In another terminal
 #define BUF_SIZE 256
 
 int
-main(int argc, char **argv)
+main(int argc, char *argv[])
 {
     int fd, ret, event_fd, mount_fd;
     ssize_t len, path_len;
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH 09/32] path_resolution.7: tfix
  2021-07-28 20:19 [PATCH 00/32] Patches from others Alejandro Colomar
                   ` (7 preceding siblings ...)
  2021-07-28 20:19 ` [PATCH 08/32] Various pages: Consistently use '*argv[]' Alejandro Colomar
@ 2021-07-28 20:19 ` Alejandro Colomar
  2021-08-07 21:37   ` Michael Kerrisk (man-pages)
  2021-07-28 20:19 ` [PATCH 10/32] futex.2: Document FUTEX_LOCK_PI2 Alejandro Colomar
                   ` (23 subsequent siblings)
  32 siblings, 1 reply; 92+ messages in thread
From: Alejandro Colomar @ 2021-07-28 20:19 UTC (permalink / raw)
  To: mtk.manpages
  Cc: Štěpán Němec, linux-man, Alejandro Colomar

From: Štěpán Němec <stepnem@gmail.com>

Signed-off-by: Štěpán Němec <stepnem@gmail.com>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man7/path_resolution.7 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man7/path_resolution.7 b/man7/path_resolution.7
index 0901ed7c8..f24837ef9 100644
--- a/man7/path_resolution.7
+++ b/man7/path_resolution.7
@@ -63,7 +63,7 @@ argument).
 The current working directory is inherited from the parent, and can
 be changed by use of the
 .BR chdir (2)
-system call.)
+system call.
 .PP
 Pathnames starting with a \(aq/\(aq character are called absolute pathnames.
 Pathnames not starting with a \(aq/\(aq are called relative pathnames.
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH 10/32] futex.2: Document FUTEX_LOCK_PI2
  2021-07-28 20:19 [PATCH 00/32] Patches from others Alejandro Colomar
                   ` (8 preceding siblings ...)
  2021-07-28 20:19 ` [PATCH 09/32] path_resolution.7: tfix Alejandro Colomar
@ 2021-07-28 20:19 ` Alejandro Colomar
  2021-07-29 10:18   ` Alejandro Colomar (man-pages)
  2021-07-28 20:19 ` [PATCH 11/32] futex.2: Minor tweaks to Kurt's patch Alejandro Colomar
                   ` (22 subsequent siblings)
  32 siblings, 1 reply; 92+ messages in thread
From: Alejandro Colomar @ 2021-07-28 20:19 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Kurt Kanzenbach, linux-man

From: Kurt Kanzenbach <kurt@linutronix.de>

FUTEX_LOCK_PI2 is a new futex operation which was recently introduced into the
Linux kernel. It works exactly like FUTEX_LOCK_PI. However, it has support for
selectable clocks for timeouts. By default CLOCK_MONOTONIC is used. If
FUTEX_CLOCK_REALTIME is specified then the timeout is measured against
CLOCK_REALTIME.

This new operation addresses an inconsistency in the futex interface:
FUTEX_LOCK_PI only works with timeouts based on CLOCK_REALTIME in contrast to
all the other PI operations.

Document the FUTEX_LOCK_PI2 command.

Signed-off-by: Kurt Kanzenbach <kurt@linutronix.de>
---
 man2/futex.2 | 53 ++++++++++++++++++++++++++++++++++++++++++++++++----
 1 file changed, 49 insertions(+), 4 deletions(-)

diff --git a/man2/futex.2 b/man2/futex.2
index ada96c517..2f340e0e0 100644
--- a/man2/futex.2
+++ b/man2/futex.2
@@ -241,10 +241,13 @@ and so on.
 This option bit can be employed only with the
 .BR FUTEX_WAIT_BITSET ,
 .BR FUTEX_WAIT_REQUEUE_PI ,
-and
 (since Linux 4.5)
 .\" commit 337f13046ff03717a9e99675284a817527440a49
-.BR FUTEX_WAIT
+.BR FUTEX_WAIT ,
+and
+(since Linux v5.14.0)
+.\" commit bf22a6976897977b0a3f1aeba6823c959fc4fdae
+.BR FUTEX_LOCK_PI2
 operations.
 .IP
 If this option is set, the kernel measures the
@@ -904,7 +907,9 @@ value to 0 if the previous value was the expected TID.
 If a futex is already acquired (i.e., has a nonzero value),
 waiters must employ the
 .B FUTEX_LOCK_PI
-operation to acquire the lock.
+or
+.B FUTEX_LOCK_PI2
+operations to acquire the lock.
 If other threads are waiting for the lock, then the
 .B FUTEX_WAITERS
 bit is set in the futex value;
@@ -964,6 +969,8 @@ Note that the PI futex operations must be used as paired operations
 and are subject to some additional requirements:
 .IP * 3
 .B FUTEX_LOCK_PI
+,
+.B FUTEX_LOCK_PI2
 and
 .B FUTEX_TRYLOCK_PI
 pair with
@@ -1122,6 +1129,27 @@ arguments are ignored.
 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 .\"
 .TP
+.BR FUTEX_LOCK_PI2 " (since Linux 5.14.0)"
+.\" commit bf22a6976897977b0a3f1aeba6823c959fc4fdae
+This operation works similar like
+.BR FUTEX_LOCK_PI .
+The only difference is the
+timeout argument.
+.BR FUTEX_LOCK_PI2
+has support for selectable clocks.
+.IP
+If
+.I timeout
+is not NULL, the structure it points to specifies
+an absolute timeout.
+If
+.I timeout
+is NULL, the operation can block indefinitely.
+.IP
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.TP
 .BR FUTEX_TRYLOCK_PI " (since Linux 2.6.18)"
 .\" commit c87e2837be82df479a6bae9f155c43516d2feebc
 This operation tries to acquire the lock at
@@ -1168,6 +1196,8 @@ arguments are ignored.
 .\" commit c87e2837be82df479a6bae9f155c43516d2feebc
 This operation wakes the top priority waiter that is waiting in
 .B FUTEX_LOCK_PI
+or
+.B FUTEX_LOCK_PI2
 on the futex address provided by the
 .I uaddr
 argument.
@@ -1379,6 +1409,9 @@ Returns the number of waiters that were woken up.
 .B FUTEX_LOCK_PI
 Returns 0 if the futex was successfully locked.
 .TP
+.B FUTEX_LOCK_PI2
+Returns 0 if the futex was successfully locked.
+.TP
 .B FUTEX_TRYLOCK_PI
 Returns 0 if the futex was successfully locked.
 .TP
@@ -1435,6 +1468,7 @@ is not equal to the expected value
 .TP
 .BR EAGAIN
 .RB ( FUTEX_LOCK_PI ,
+.BR FUTEX_LOCK_PI2 ,
 .BR FUTEX_TRYLOCK_PI ,
 .BR FUTEX_CMP_REQUEUE_PI )
 The futex owner thread ID of
@@ -1448,6 +1482,7 @@ Try again.
 .TP
 .BR EDEADLK
 .RB ( FUTEX_LOCK_PI ,
+.BR FUTEX_LOCK_PI2 ,
 .BR FUTEX_TRYLOCK_PI ,
 .BR FUTEX_CMP_REQUEUE_PI )
 The futex word at
@@ -1536,11 +1571,14 @@ The kernel detected an inconsistency between the user-space state at
 .I uaddr
 and the kernel state\(emthat is, it detected a waiter which waits in
 .BR FUTEX_LOCK_PI
+or
+.BR FUTEX_LOCK_PI2
 on
 .IR uaddr .
 .TP
 .B EINVAL
 .RB ( FUTEX_LOCK_PI ,
+.BR FUTEX_LOCK_PI2 ,
 .BR FUTEX_TRYLOCK_PI ,
 .BR FUTEX_UNLOCK_PI )
 The kernel detected an inconsistency between the user-space state at
@@ -1590,6 +1628,8 @@ that is, the kernel detected a waiter which waits on
 .I uaddr
 via
 .BR FUTEX_LOCK_PI
+or
+.BR FUTEX_LOCK_PI2
 (instead of
 .BR FUTEX_WAIT_REQUEUE_PI ).
 .TP
@@ -1618,6 +1658,7 @@ The system-wide limit on the total number of open files has been reached.
 .TP
 .BR ENOMEM
 .RB ( FUTEX_LOCK_PI ,
+.BR FUTEX_LOCK_PI2 ,
 .BR FUTEX_TRYLOCK_PI ,
 .BR FUTEX_CMP_REQUEUE_PI )
 The kernel could not allocate memory to hold state information.
@@ -1634,11 +1675,13 @@ option was specified in
 but the accompanying operation was neither
 .BR FUTEX_WAIT ,
 .BR FUTEX_WAIT_BITSET ,
+.BR FUTEX_WAIT_REQUEUE_PI ,
 nor
-.BR FUTEX_WAIT_REQUEUE_PI .
+.BR FUTEX_LOCK_PI2 .
 .TP
 .BR ENOSYS
 .RB ( FUTEX_LOCK_PI ,
+.BR FUTEX_LOCK_PI2 ,
 .BR FUTEX_TRYLOCK_PI ,
 .BR FUTEX_UNLOCK_PI ,
 .BR FUTEX_CMP_REQUEUE_PI ,
@@ -1649,6 +1692,7 @@ are not supported on some CPU variants.
 .TP
 .BR EPERM
 .RB ( FUTEX_LOCK_PI ,
+.BR FUTEX_LOCK_PI2 ,
 .BR FUTEX_TRYLOCK_PI ,
 .BR FUTEX_CMP_REQUEUE_PI )
 The caller is not allowed to attach itself to the futex at
@@ -1665,6 +1709,7 @@ The caller does not own the lock represented by the futex word.
 .TP
 .BR ESRCH
 .RB ( FUTEX_LOCK_PI ,
+.BR FUTEX_LOCK_PI2 ,
 .BR FUTEX_TRYLOCK_PI ,
 .BR FUTEX_CMP_REQUEUE_PI )
 The thread ID in the futex word at
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH 11/32] futex.2: Minor tweaks to Kurt's patch
  2021-07-28 20:19 [PATCH 00/32] Patches from others Alejandro Colomar
                   ` (9 preceding siblings ...)
  2021-07-28 20:19 ` [PATCH 10/32] futex.2: Document FUTEX_LOCK_PI2 Alejandro Colomar
@ 2021-07-28 20:19 ` Alejandro Colomar
  2021-07-29 10:24   ` Alejandro Colomar (man-pages)
  2021-07-28 20:19 ` [PATCH 12/32] capabilities.7: tfix Alejandro Colomar
                   ` (21 subsequent siblings)
  32 siblings, 1 reply; 92+ messages in thread
From: Alejandro Colomar @ 2021-07-28 20:19 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Alejandro Colomar, linux-man

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man2/futex.2 | 69 ++++++++++++++++++++++++++--------------------------
 1 file changed, 34 insertions(+), 35 deletions(-)

diff --git a/man2/futex.2 b/man2/futex.2
index 2f340e0e0..217b76734 100644
--- a/man2/futex.2
+++ b/man2/futex.2
@@ -222,9 +222,9 @@ This allows the kernel to make some additional performance optimizations.
 .\" taking reference counts on file backing store, and so on.
 .IP
 As a convenience,
-.IR <linux/futex.h>
+.I <linux/futex.h>
 defines a set of constants with the suffix
-.BR _PRIVATE
+.B _PRIVATE
 that are equivalents of all of the operations listed below,
 .\" except the obsolete FUTEX_FD, for which the "private" flag was
 .\" meaningless
@@ -247,19 +247,19 @@ This option bit can be employed only with the
 and
 (since Linux v5.14.0)
 .\" commit bf22a6976897977b0a3f1aeba6823c959fc4fdae
-.BR FUTEX_LOCK_PI2
+.B FUTEX_LOCK_PI2
 operations.
 .IP
 If this option is set, the kernel measures the
 .I timeout
 against the
-.BR CLOCK_REALTIME
+.B CLOCK_REALTIME
 clock.
 .IP
 If this option is not set, the kernel measures the
 .I timeout
 against the
-.BR CLOCK_MONOTONIC
+.B CLOCK_MONOTONIC
 clock.
 .PP
 The operation specified in
@@ -968,9 +968,8 @@ PI futexes are operated on by specifying one of the values listed below in
 Note that the PI futex operations must be used as paired operations
 and are subject to some additional requirements:
 .IP * 3
-.B FUTEX_LOCK_PI
-,
-.B FUTEX_LOCK_PI2
+.BR FUTEX_LOCK_PI ,
+.BR FUTEX_LOCK_PI2 ,
 and
 .B FUTEX_TRYLOCK_PI
 pair with
@@ -1123,7 +1122,7 @@ The
 .IR uaddr2 ,
 .IR val ,
 and
-.IR val3
+.I val3
 arguments are ignored.
 .\"
 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
@@ -1135,7 +1134,7 @@ This operation works similar like
 .BR FUTEX_LOCK_PI .
 The only difference is the
 timeout argument.
-.BR FUTEX_LOCK_PI2
+.B FUTEX_LOCK_PI2
 has support for selectable clocks.
 .IP
 If
@@ -1466,7 +1465,7 @@ The value pointed to by
 is not equal to the expected value
 .IR val3 .
 .TP
-.BR EAGAIN
+.B EAGAIN
 .RB ( FUTEX_LOCK_PI ,
 .BR FUTEX_LOCK_PI2 ,
 .BR FUTEX_TRYLOCK_PI ,
@@ -1480,7 +1479,7 @@ is about to exit,
 but has not yet handled the internal state cleanup.
 Try again.
 .TP
-.BR EDEADLK
+.B EDEADLK
 .RB ( FUTEX_LOCK_PI ,
 .BR FUTEX_LOCK_PI2 ,
 .BR FUTEX_TRYLOCK_PI ,
@@ -1522,18 +1521,18 @@ a spurious wakeup; since Linux 2.6.22, this no longer happens.
 .TP
 .B EINVAL
 The operation in
-.IR futex_op
+.I futex_op
 is one of those that employs a timeout, but the supplied
 .I timeout
 argument was invalid
 .RI ( tv_sec
 was less than zero, or
-.IR tv_nsec
+.I tv_nsec
 was not less than 1,000,000,000).
 .TP
 .B EINVAL
 The operation specified in
-.IR futex_op
+.I futex_op
 employs one or both of the pointers
 .I uaddr
 and
@@ -1545,17 +1544,17 @@ the address is not four-byte-aligned.
 .RB ( FUTEX_WAIT_BITSET ,
 .BR FUTEX_WAKE_BITSET )
 The bit mask supplied in
-.IR val3
+.I val3
 is zero.
 .TP
 .B EINVAL
 .RB ( FUTEX_CMP_REQUEUE_PI )
 .I uaddr
 equals
-.IR uaddr2
+.I uaddr2
 (i.e., an attempt was made to requeue to the same futex).
 .TP
-.BR EINVAL
+.B EINVAL
 .RB ( FUTEX_FD )
 The signal number supplied in
 .I val
@@ -1570,9 +1569,9 @@ is invalid.
 The kernel detected an inconsistency between the user-space state at
 .I uaddr
 and the kernel state\(emthat is, it detected a waiter which waits in
-.BR FUTEX_LOCK_PI
+.B FUTEX_LOCK_PI
 or
-.BR FUTEX_LOCK_PI2
+.B FUTEX_LOCK_PI2
 on
 .IR uaddr .
 .TP
@@ -1588,7 +1587,7 @@ This indicates either state corruption
 or that the kernel found a waiter on
 .I uaddr
 which is waiting via
-.BR FUTEX_WAIT
+.B FUTEX_WAIT
 or
 .BR FUTEX_WAIT_BITSET .
 .TP
@@ -1601,9 +1600,9 @@ and the kernel state;
 .\"	The kernel sees: I have non PI state for a futex you tried to
 .\"     tell me was PI
 that is, the kernel detected a waiter which waits via
-.BR FUTEX_WAIT
+.B FUTEX_WAIT
 or
-.BR FUTEX_WAIT_BITSET
+.B FUTEX_WAIT_BITSET
 on
 .IR uaddr2 .
 .TP
@@ -1613,9 +1612,9 @@ The kernel detected an inconsistency between the user-space state at
 .I uaddr
 and the kernel state;
 that is, the kernel detected a waiter which waits via
-.BR FUTEX_WAIT
+.B FUTEX_WAIT
 or
-.BR FUTEX_WAIT_BITSET
+.B FUTEX_WAIT_BITSET
 on
 .IR uaddr .
 .TP
@@ -1627,9 +1626,9 @@ and the kernel state;
 that is, the kernel detected a waiter which waits on
 .I uaddr
 via
-.BR FUTEX_LOCK_PI
+.B FUTEX_LOCK_PI
 or
-.BR FUTEX_LOCK_PI2
+.B FUTEX_LOCK_PI2
 (instead of
 .BR FUTEX_WAIT_REQUEUE_PI ).
 .TP
@@ -1656,7 +1655,7 @@ Invalid argument.
 .RB ( FUTEX_FD )
 The system-wide limit on the total number of open files has been reached.
 .TP
-.BR ENOMEM
+.B ENOMEM
 .RB ( FUTEX_LOCK_PI ,
 .BR FUTEX_LOCK_PI2 ,
 .BR FUTEX_TRYLOCK_PI ,
@@ -1669,7 +1668,7 @@ Invalid operation specified in
 .TP
 .B ENOSYS
 The
-.BR FUTEX_CLOCK_REALTIME
+.B FUTEX_CLOCK_REALTIME
 option was specified in
 .IR futex_op ,
 but the accompanying operation was neither
@@ -1679,7 +1678,7 @@ but the accompanying operation was neither
 nor
 .BR FUTEX_LOCK_PI2 .
 .TP
-.BR ENOSYS
+.B ENOSYS
 .RB ( FUTEX_LOCK_PI ,
 .BR FUTEX_LOCK_PI2 ,
 .BR FUTEX_TRYLOCK_PI ,
@@ -1690,7 +1689,7 @@ A run-time check determined that the operation is not available.
 The PI-futex operations are not implemented on all architectures and
 are not supported on some CPU variants.
 .TP
-.BR EPERM
+.B EPERM
 .RB ( FUTEX_LOCK_PI ,
 .BR FUTEX_LOCK_PI2 ,
 .BR FUTEX_TRYLOCK_PI ,
@@ -1703,11 +1702,11 @@ the futex at
 .IR uaddr2 ).
 (This may be caused by a state corruption in user space.)
 .TP
-.BR EPERM
+.B EPERM
 .RB ( FUTEX_UNLOCK_PI )
 The caller does not own the lock represented by the futex word.
 .TP
-.BR ESRCH
+.B ESRCH
 .RB ( FUTEX_LOCK_PI ,
 .BR FUTEX_LOCK_PI2 ,
 .BR FUTEX_TRYLOCK_PI ,
@@ -1716,7 +1715,7 @@ The thread ID in the futex word at
 .I uaddr
 does not exist.
 .TP
-.BR ESRCH
+.B ESRCH
 .RB ( FUTEX_CMP_REQUEUE_PI )
 The thread ID in the futex word at
 .I uaddr2
@@ -1724,7 +1723,7 @@ does not exist.
 .TP
 .B ETIMEDOUT
 The operation in
-.IR futex_op
+.I futex_op
 employed the timeout specified in
 .IR timeout ,
 and the timeout expired before the operation completed.
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH 12/32] capabilities.7: tfix
  2021-07-28 20:19 [PATCH 00/32] Patches from others Alejandro Colomar
                   ` (10 preceding siblings ...)
  2021-07-28 20:19 ` [PATCH 11/32] futex.2: Minor tweaks to Kurt's patch Alejandro Colomar
@ 2021-07-28 20:19 ` Alejandro Colomar
  2021-08-07 21:39   ` Michael Kerrisk (man-pages)
  2021-07-28 20:19 ` [PATCH 13/32] user_namespaces.7: fix a ref Alejandro Colomar
                   ` (20 subsequent siblings)
  32 siblings, 1 reply; 92+ messages in thread
From: Alejandro Colomar @ 2021-07-28 20:19 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Kir Kolyshkin, linux-man, Alejandro Colomar

From: Kir Kolyshkin <kolyshkin@gmail.com>

Add a missing comma.

Fixes: 3dcdef9437fafb
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man7/capabilities.7 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man7/capabilities.7 b/man7/capabilities.7
index cf9dc190f..9f8f0087f 100644
--- a/man7/capabilities.7
+++ b/man7/capabilities.7
@@ -215,7 +215,7 @@ Lock memory
 .BR shmctl (2));
 .IP *
 Allocate memory using huge pages
-.RB ( memfd_create (2)
+.RB ( memfd_create (2),
 .BR mmap (2),
 .BR shmctl (2)).
 .PD 0
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH 13/32] user_namespaces.7: fix a ref
  2021-07-28 20:19 [PATCH 00/32] Patches from others Alejandro Colomar
                   ` (11 preceding siblings ...)
  2021-07-28 20:19 ` [PATCH 12/32] capabilities.7: tfix Alejandro Colomar
@ 2021-07-28 20:19 ` Alejandro Colomar
  2021-08-07 21:40   ` Michael Kerrisk (man-pages)
  2021-07-28 20:19 ` [PATCH 14/32] capabilities.7, user_namespaces.7: describe CAP_SETFCAP Alejandro Colomar
                   ` (19 subsequent siblings)
  32 siblings, 1 reply; 92+ messages in thread
From: Alejandro Colomar @ 2021-07-28 20:19 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Kir Kolyshkin, linux-man, Alejandro Colomar

From: Kir Kolyshkin <kolyshkin@gmail.com>

The file being referred to no longer exists, as it was moved to
*.rst first (commit 20a78ae9ed297f2) and then to under
admin-guide (commit bf6b7a742e3f82b). Both those commits
are from 2019 (Linux 5.3).

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man7/user_namespaces.7 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man7/user_namespaces.7 b/man7/user_namespaces.7
index f2e02c978..518e7a3bb 100644
--- a/man7/user_namespaces.7
+++ b/man7/user_namespaces.7
@@ -1383,4 +1383,4 @@ main(int argc, char *argv[])
 .BR pid_namespaces (7)
 .PP
 The kernel source file
-.IR Documentation/namespaces/resource\-control.txt .
+.IR Documentation/admin\-guide/namespaces/resource\-control.rst .
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH 14/32] capabilities.7, user_namespaces.7: describe CAP_SETFCAP
  2021-07-28 20:19 [PATCH 00/32] Patches from others Alejandro Colomar
                   ` (12 preceding siblings ...)
  2021-07-28 20:19 ` [PATCH 13/32] user_namespaces.7: fix a ref Alejandro Colomar
@ 2021-07-28 20:19 ` Alejandro Colomar
  2021-08-08  2:54   ` Michael Kerrisk (man-pages)
  2021-08-08  9:09   ` Michael Kerrisk (man-pages)
  2021-07-28 20:19 ` [PATCH 15/32] capabilities.7: Minor tweaks to Kir's patch Alejandro Colomar
                   ` (18 subsequent siblings)
  32 siblings, 2 replies; 92+ messages in thread
From: Alejandro Colomar @ 2021-07-28 20:19 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Kir Kolyshkin, linux-man, Alejandro Colomar

From: Kir Kolyshkin <kolyshkin@gmail.com>

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man7/capabilities.7    | 6 ++++++
 man7/user_namespaces.7 | 6 ++++++
 2 files changed, 12 insertions(+)

diff --git a/man7/capabilities.7 b/man7/capabilities.7
index 9f8f0087f..2f9c9a61e 100644
--- a/man7/capabilities.7
+++ b/man7/capabilities.7
@@ -349,6 +349,12 @@ write a group ID mapping in a user namespace (see
 .TP
 .BR CAP_SETFCAP " (since Linux 2.6.24)"
 Set arbitrary capabilities on a file.
+.IP
+.\" commit db2e718a47984b9d71ed890eb2ea36ecf150de18
+Since Linux 5.12, this capability is
+also needed to map uid 0 (as in
+.BR unshare\ -Ur ,
+.RB see unshare (1).
 .TP
 .B CAP_SETPCAP
 If file capabilities are supported (i.e., since Linux 2.6.24):
diff --git a/man7/user_namespaces.7 b/man7/user_namespaces.7
index 518e7a3bb..3378b6057 100644
--- a/man7/user_namespaces.7
+++ b/man7/user_namespaces.7
@@ -577,6 +577,12 @@ or be in the parent user namespace of the process
 The mapped user IDs (group IDs) must in turn have a mapping
 in the parent user namespace.
 .IP 4.
+.\" commit db2e718a47984b9d71ed890eb2ea36ecf150de18
+If a writing process is root (i.e. UID 0) trying to map host user ID 0,
+it must have
+.B CAP_SETFCAP
+capability (since Linux 5.12).
+.IP 5.
 One of the following two cases applies:
 .RS
 .IP * 3
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH 15/32] capabilities.7: Minor tweaks to Kir's patch
  2021-07-28 20:19 [PATCH 00/32] Patches from others Alejandro Colomar
                   ` (13 preceding siblings ...)
  2021-07-28 20:19 ` [PATCH 14/32] capabilities.7, user_namespaces.7: describe CAP_SETFCAP Alejandro Colomar
@ 2021-07-28 20:19 ` Alejandro Colomar
  2021-07-29 11:16   ` Alejandro Colomar (man-pages)
  2021-08-08  3:03   ` Michael Kerrisk (man-pages)
  2021-07-28 20:19 ` [PATCH 16/32] seccomp_unotify.2: Add doc for SECCOMP_ADDFD_FLAG_SEND Alejandro Colomar
                   ` (17 subsequent siblings)
  32 siblings, 2 replies; 92+ messages in thread
From: Alejandro Colomar @ 2021-07-28 20:19 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Alejandro Colomar, linux-man

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man7/capabilities.7 | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/man7/capabilities.7 b/man7/capabilities.7
index 2f9c9a61e..4d08545ed 100644
--- a/man7/capabilities.7
+++ b/man7/capabilities.7
@@ -353,8 +353,9 @@ Set arbitrary capabilities on a file.
 .\" commit db2e718a47984b9d71ed890eb2ea36ecf150de18
 Since Linux 5.12, this capability is
 also needed to map uid 0 (as in
-.BR unshare\ -Ur ,
-.RB see unshare (1).
+.IR "unshare -Ur" ,
+see
+.BR unshare (1).
 .TP
 .B CAP_SETPCAP
 If file capabilities are supported (i.e., since Linux 2.6.24):
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH 16/32] seccomp_unotify.2: Add doc for SECCOMP_ADDFD_FLAG_SEND
  2021-07-28 20:19 [PATCH 00/32] Patches from others Alejandro Colomar
                   ` (14 preceding siblings ...)
  2021-07-28 20:19 ` [PATCH 15/32] capabilities.7: Minor tweaks to Kir's patch Alejandro Colomar
@ 2021-07-28 20:19 ` Alejandro Colomar
  2021-08-08  1:01   ` Michael Kerrisk (man-pages)
  2021-07-28 20:19 ` [PATCH 17/32] seccomp_unotify.2: Minor tweaks to Rodrigo's patch Alejandro Colomar
                   ` (16 subsequent siblings)
  32 siblings, 1 reply; 92+ messages in thread
From: Alejandro Colomar @ 2021-07-28 20:19 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Rodrigo Campos, linux-man, Alejandro Colomar

From: Rodrigo Campos <rodrigo@kinvolk.io>

This flag was recently added to Linux 5.14 by a patch I wrote:
	https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0ae71c7720e3ae3aabd2e8a072d27f7bd173d25c

This patch adds documentation for the flag, the error code that the flag
added and explains in the caveat when it is useful.

Signed-off-by: Rodrigo Campos <rodrigo@kinvolk.io>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man2/seccomp_unotify.2 | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/man2/seccomp_unotify.2 b/man2/seccomp_unotify.2
index 2673d9bc7..9bd27214f 100644
--- a/man2/seccomp_unotify.2
+++ b/man2/seccomp_unotify.2
@@ -739,6 +739,17 @@ When allocating the file descriptor in the target,
 use the file descriptor number specified in the
 .I newfd
 field.
+.TP
+.BR SECCOMP_ADDFD_FLAG_SEND
+Available since Linux 5.14, combines the
+.B SECCOMP_IOCTL_NOTIF_ADDFD
+ioctl with
+.B SECCOMP_IOCTL_NOTIF_SEND
+into an atomic operation. On successful invocation, the target process's
+errno will be 0 and the return value will be the file descriptor number that was
+installed in the target. If allocating the file descriptor in the tatget fails,
+the target's syscall continues to be blocked until a successful response is
+sent.
 .RE
 .TP
 .I srcfd
@@ -801,6 +812,13 @@ Allocating the file descriptor in the target would cause the target's
 limit to be exceeded (see
 .BR getrlimit (2)).
 .TP
+.B EBUSY
+If the flag
+.B SECCOMP_IOCTL_NOTIF_SEND
+is used, this means the operation can't proceed until other
+.B SECCOMP_IOCTL_NOTIF_ADDFD
+requests are processed.
+.TP
 .B EINPROGRESS
 The user-space notification specified in the
 .I id
@@ -1131,6 +1149,14 @@ that would
 normally be restarted by the
 .BR SA_RESTART
 flag.
+.PP
+Furthermore, if the supervisor response is a file descriptor
+added with
+.B SECCOMP_IOCTL_NOTIF_ADDFD,
+then the flag
+.B SECCOMP_ADDFD_FLAG_SEND
+can be used to atomically add the file descriptor and return that value,
+making sure no file descriptors are inadvertently leaked into the target.
 .\" FIXME
 .\" About the above, Kees Cook commented:
 .\"
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH 17/32] seccomp_unotify.2: Minor tweaks to Rodrigo's patch
  2021-07-28 20:19 [PATCH 00/32] Patches from others Alejandro Colomar
                   ` (15 preceding siblings ...)
  2021-07-28 20:19 ` [PATCH 16/32] seccomp_unotify.2: Add doc for SECCOMP_ADDFD_FLAG_SEND Alejandro Colomar
@ 2021-07-28 20:19 ` Alejandro Colomar
  2021-07-29 11:15   ` Alejandro Colomar (man-pages)
  2021-08-08  1:13   ` Michael Kerrisk (man-pages)
  2021-07-28 20:19 ` [PATCH 18/32] recv.2: tfix Alejandro Colomar
                   ` (15 subsequent siblings)
  32 siblings, 2 replies; 92+ messages in thread
From: Alejandro Colomar @ 2021-07-28 20:19 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Alejandro Colomar, linux-man

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man2/seccomp_unotify.2 | 32 +++++++++++++++++---------------
 1 file changed, 17 insertions(+), 15 deletions(-)

diff --git a/man2/seccomp_unotify.2 b/man2/seccomp_unotify.2
index 9bd27214f..ae449ae36 100644
--- a/man2/seccomp_unotify.2
+++ b/man2/seccomp_unotify.2
@@ -740,16 +740,18 @@ use the file descriptor number specified in the
 .I newfd
 field.
 .TP
-.BR SECCOMP_ADDFD_FLAG_SEND
-Available since Linux 5.14, combines the
+.BR SECCOMP_ADDFD_FLAG_SEND " (since Linux 5.14)"
+Combines the
 .B SECCOMP_IOCTL_NOTIF_ADDFD
 ioctl with
 .B SECCOMP_IOCTL_NOTIF_SEND
-into an atomic operation. On successful invocation, the target process's
-errno will be 0 and the return value will be the file descriptor number that was
-installed in the target. If allocating the file descriptor in the tatget fails,
-the target's syscall continues to be blocked until a successful response is
-sent.
+into an atomic operation.
+On successful invocation, the target process's errno will be 0
+and the return value will be the file descriptor number
+that was installed in the target.
+If allocating the file descriptor in the tatget fails,
+the target's syscall continues to be blocked
+until a successful response is sent.
 .RE
 .TP
 .I srcfd
@@ -1149,14 +1151,6 @@ that would
 normally be restarted by the
 .BR SA_RESTART
 flag.
-.PP
-Furthermore, if the supervisor response is a file descriptor
-added with
-.B SECCOMP_IOCTL_NOTIF_ADDFD,
-then the flag
-.B SECCOMP_ADDFD_FLAG_SEND
-can be used to atomically add the file descriptor and return that value,
-making sure no file descriptors are inadvertently leaked into the target.
 .\" FIXME
 .\" About the above, Kees Cook commented:
 .\"
@@ -1176,6 +1170,14 @@ making sure no file descriptors are inadvertently leaked into the target.
 .\" calls because it's impossible for the kernel to restart the call
 .\" with the right timeout value. I wonder what happens when those
 .\" system calls are restarted in the scenario we're discussing.)
+.PP
+Furthermore, if the supervisor response is a file descriptor
+added with
+.B SECCOMP_IOCTL_NOTIF_ADDFD,
+then the flag
+.B SECCOMP_ADDFD_FLAG_SEND
+can be used to atomically add the file descriptor and return that value,
+making sure no file descriptors are inadvertently leaked into the target.
 .SH BUGS
 If a
 .BR SECCOMP_IOCTL_NOTIF_RECV
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH 18/32] recv.2: tfix
  2021-07-28 20:19 [PATCH 00/32] Patches from others Alejandro Colomar
                   ` (16 preceding siblings ...)
  2021-07-28 20:19 ` [PATCH 17/32] seccomp_unotify.2: Minor tweaks to Rodrigo's patch Alejandro Colomar
@ 2021-07-28 20:19 ` Alejandro Colomar
  2021-08-07 21:43   ` Michael Kerrisk (man-pages)
  2021-07-28 20:19 ` [PATCH 19/32] ascii.7: add vertical rule to separate the two columns Alejandro Colomar
                   ` (14 subsequent siblings)
  32 siblings, 1 reply; 92+ messages in thread
From: Alejandro Colomar @ 2021-07-28 20:19 UTC (permalink / raw)
  To: mtk.manpages; +Cc: kXuan, linux-man, Alejandro Colomar

From: kXuan <kxuanobj@gmail.com>

The recv.2 misspelled `SO_EE_OFFENDER` to `SOCK_EE_OFFENDER`.

This patch fix this typo.

Signed-off-by: kXuan <kxuanobj@gmail.com>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man2/recv.2 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man2/recv.2 b/man2/recv.2
index 2659957a6..884c86355 100644
--- a/man2/recv.2
+++ b/man2/recv.2
@@ -196,7 +196,7 @@ number of the queued error.
 is the origin code of where the error originated.
 The other fields are protocol-specific.
 The macro
-.B SOCK_EE_OFFENDER
+.B SO_EE_OFFENDER
 returns a pointer to the address of the network object
 where the error originated from given a pointer to the ancillary message.
 If this address is not known, the
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH 19/32] ascii.7: add vertical rule to separate the two columns
  2021-07-28 20:19 [PATCH 00/32] Patches from others Alejandro Colomar
                   ` (17 preceding siblings ...)
  2021-07-28 20:19 ` [PATCH 18/32] recv.2: tfix Alejandro Colomar
@ 2021-07-28 20:19 ` Alejandro Colomar
  2021-08-07 22:46   ` Michael Kerrisk (man-pages)
  2021-07-28 20:19 ` [PATCH 20/32] wait.2: Add ESRCH for when pid == INT_MIN Alejandro Colomar
                   ` (13 subsequent siblings)
  32 siblings, 1 reply; 92+ messages in thread
From: Alejandro Colomar @ 2021-07-28 20:19 UTC (permalink / raw)
  To: mtk.manpages; +Cc: наб, linux-man, Alejandro Colomar

From: наб <nabijaczleweli@nabijaczleweli.xyz>

I regularly get mildly lost in this table (and, indeed, didn't realise
it had two columns the first few times I used it to look at something
from the left column) ‒ separating the two columns improves clarity,
and makes which soup of numbers belongs to which character
much more obvious

Other encodings don't need this as they don't use double-columnated
tables

Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man7/ascii.7 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man7/ascii.7 b/man7/ascii.7
index f1c0c8d74..053b13809 100644
--- a/man7/ascii.7
+++ b/man7/ascii.7
@@ -48,7 +48,7 @@ C program \f(CW\(aq\eX\(aq\fP escapes are noted.
 .ft CW
 \}
 .TS
-l l l l l l l l.
+l l l l | l l l l.
 Oct	Dec	Hex	Char	Oct	Dec	Hex	Char
 _
 000	0	00	NUL \(aq\e0\(aq (null character)	100	64	40	@
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH 20/32] wait.2: Add ESRCH for when pid == INT_MIN
  2021-07-28 20:19 [PATCH 00/32] Patches from others Alejandro Colomar
                   ` (18 preceding siblings ...)
  2021-07-28 20:19 ` [PATCH 19/32] ascii.7: add vertical rule to separate the two columns Alejandro Colomar
@ 2021-07-28 20:19 ` Alejandro Colomar
  2021-08-07 23:05   ` Michael Kerrisk (man-pages)
  2021-07-28 20:19 ` [PATCH 21/32] seccomp_unotify.2: tfix Alejandro Colomar
                   ` (12 subsequent siblings)
  32 siblings, 1 reply; 92+ messages in thread
From: Alejandro Colomar @ 2021-07-28 20:19 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Richard Palethorpe, linux-man, Alejandro Colomar

From: Richard Palethorpe <rpalethorpe@suse.com>

Please see upstream commit:

 commit dd83c161fbcc5d8be637ab159c0de015cbff5ba4
 Author: zhongjiang <zhongjiang@huawei.com>
 Date:   Mon Jul 10 15:53:01 2017 -0700

     kernel/exit.c: avoid undefined behaviour when calling wait4()

It avoids negating INT_MIN by returning early with ESRCH.

Signed-off-by: Richard Palethorpe <rpalethorpe@suse.com>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man2/wait.2 | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/man2/wait.2 b/man2/wait.2
index 5ae955b3f..63d872ee6 100644
--- a/man2/wait.2
+++ b/man2/wait.2
@@ -455,6 +455,15 @@ was caught; see
 The
 .I options
 argument was invalid.
+.TP
+.B ESRCH
+(for
+.BR wait ()
+or
+.BR waitpid ())
+.I pid
+is equal to
+.I INT_MIN
 .SH CONFORMING TO
 SVr4, 4.3BSD, POSIX.1-2001.
 .SH NOTES
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH 21/32] seccomp_unotify.2: tfix
  2021-07-28 20:19 [PATCH 00/32] Patches from others Alejandro Colomar
                   ` (19 preceding siblings ...)
  2021-07-28 20:19 ` [PATCH 20/32] wait.2: Add ESRCH for when pid == INT_MIN Alejandro Colomar
@ 2021-07-28 20:19 ` Alejandro Colomar
  2021-08-08  1:13   ` Michael Kerrisk (man-pages)
  2021-07-28 20:19 ` [PATCH 22/32] proc.5: tfix Alejandro Colomar
                   ` (11 subsequent siblings)
  32 siblings, 1 reply; 92+ messages in thread
From: Alejandro Colomar @ 2021-07-28 20:19 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Jakub Wilk, linux-man, Alejandro Colomar

From: Jakub Wilk <jwilk@jwilk.net>

Remove duplicated word.

Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man2/seccomp_unotify.2 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man2/seccomp_unotify.2 b/man2/seccomp_unotify.2
index ae449ae36..2605be9fb 100644
--- a/man2/seccomp_unotify.2
+++ b/man2/seccomp_unotify.2
@@ -1105,7 +1105,7 @@ Alternatively, in the
 example, the supervisor might use
 .BR poll (2)
 to monitor both the notification file descriptor
-(so as as to discover when the target's
+(so as to discover when the target's
 .BR accept (2)
 call has been interrupted) and the listening file descriptor
 (so as to know when a connection is available).
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH 22/32] proc.5: tfix
  2021-07-28 20:19 [PATCH 00/32] Patches from others Alejandro Colomar
                   ` (20 preceding siblings ...)
  2021-07-28 20:19 ` [PATCH 21/32] seccomp_unotify.2: tfix Alejandro Colomar
@ 2021-07-28 20:19 ` Alejandro Colomar
  2021-08-07 22:55   ` Michael Kerrisk (man-pages)
  2021-07-28 20:19 ` [PATCH 23/32] scripts/bash_aliases: tfix Alejandro Colomar
                   ` (10 subsequent siblings)
  32 siblings, 1 reply; 92+ messages in thread
From: Alejandro Colomar @ 2021-07-28 20:19 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Jakub Wilk, linux-man, Alejandro Colomar

From: Jakub Wilk <jwilk@jwilk.net>

Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man5/proc.5 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man5/proc.5 b/man5/proc.5
index 69f6e15dd..416bbb5fc 100644
--- a/man5/proc.5
+++ b/man5/proc.5
@@ -5606,7 +5606,7 @@ first.
 .IR  /proc/sys/vm/sysctl_hugetlb_shm_group " (since Linux 2.6.7)"
 This writable file contains a group ID that is allowed
 to allocate memory using huge pages.
-If a process has a filesystem group ID or any supplememtary group ID that
+If a process has a filesystem group ID or any supplementary group ID that
 matches this group ID,
 then it can make huge-page allocations without holding the
 .BR CAP_IPC_LOCK
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH 23/32] scripts/bash_aliases: tfix
  2021-07-28 20:19 [PATCH 00/32] Patches from others Alejandro Colomar
                   ` (21 preceding siblings ...)
  2021-07-28 20:19 ` [PATCH 22/32] proc.5: tfix Alejandro Colomar
@ 2021-07-28 20:19 ` Alejandro Colomar
  2021-08-07 22:47   ` Michael Kerrisk (man-pages)
  2021-07-28 20:20 ` [PATCH 24/32] namespaces.7: fix confusion caused by text reorganization Alejandro Colomar
                   ` (9 subsequent siblings)
  32 siblings, 1 reply; 92+ messages in thread
From: Alejandro Colomar @ 2021-07-28 20:19 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Jakub Wilk, linux-man, Alejandro Colomar

From: Jakub Wilk <jwilk@jwilk.net>

Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 scripts/bash_aliases | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/bash_aliases b/scripts/bash_aliases
index 102c458d7..ecac0029d 100644
--- a/scripts/bash_aliases
+++ b/scripts/bash_aliases
@@ -24,7 +24,7 @@ EX_USAGE=64;
 #	C
 
 #  sed_rm_ccomments()  removes C comments.
-# It can't handle multiple comments in a sinlge line correctly,
+# It can't handle multiple comments in a single line correctly,
 # nor mixed or embedded //... and /*...*/ comments.
 # Use as a filter (see man_lsfunc() in this file).
 
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH 24/32] namespaces.7: fix confusion caused by text reorganization
  2021-07-28 20:19 [PATCH 00/32] Patches from others Alejandro Colomar
                   ` (22 preceding siblings ...)
  2021-07-28 20:19 ` [PATCH 23/32] scripts/bash_aliases: tfix Alejandro Colomar
@ 2021-07-28 20:20 ` Alejandro Colomar
  2021-08-07 23:48   ` Michael Kerrisk (man-pages)
  2021-07-28 20:20 ` [PATCH 25/32] pipe.7: also mention writev(2) in atomicity sexion Alejandro Colomar
                   ` (8 subsequent siblings)
  32 siblings, 1 reply; 92+ messages in thread
From: Alejandro Colomar @ 2021-07-28 20:20 UTC (permalink / raw)
  To: mtk.manpages
  Cc: Štěpán Němec, linux-man, Alejandro Colomar

From: Štěpán Němec <stepnem@gmail.com>

Since commit ee81d7e41852, the flags list has been (only) above, not
below, these references.

(The flags table was added even before that, in commit
0b497138b908 ("namespaces.7: Add table of namespaces to top of page"))

Fixes: ee81d7e41852 ("namespaces.7: Include manual page references in the summary table of namespace types")
Signed-off-by: Štěpán Němec <stepnem@gmail.com>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man7/namespaces.7 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/man7/namespaces.7 b/man7/namespaces.7
index d35c2d383..0ac32c77e 100644
--- a/man7/namespaces.7
+++ b/man7/namespaces.7
@@ -97,7 +97,7 @@ If the
 .I flags
 argument of the call specifies one or more of the
 .B CLONE_NEW*
-flags listed below, then new namespaces are created for each flag,
+flags listed above, then new namespaces are created for each flag,
 and the child process is made a member of those namespaces.
 (This system call also implements a number of features
 unrelated to namespaces.)
@@ -119,7 +119,7 @@ If the
 .I flags
 argument of the call specifies one or more of the
 .B CLONE_NEW*
-flags listed below, then new namespaces are created for each flag,
+flags listed above, then new namespaces are created for each flag,
 and the calling process is made a member of those namespaces.
 (This system call also implements a number of features
 unrelated to namespaces.)
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH 25/32] pipe.7: also mention writev(2) in atomicity sexion
  2021-07-28 20:19 [PATCH 00/32] Patches from others Alejandro Colomar
                   ` (23 preceding siblings ...)
  2021-07-28 20:20 ` [PATCH 24/32] namespaces.7: fix confusion caused by text reorganization Alejandro Colomar
@ 2021-07-28 20:20 ` Alejandro Colomar
  2021-08-08  9:30   ` Michael Kerrisk (man-pages)
  2021-07-28 20:20 ` [PATCH 26/32] tkill.2: tfix Alejandro Colomar
                   ` (7 subsequent siblings)
  32 siblings, 1 reply; 92+ messages in thread
From: Alejandro Colomar @ 2021-07-28 20:20 UTC (permalink / raw)
  To: mtk.manpages; +Cc: наб, linux-man, Alejandro Colomar

From: наб <nabijaczleweli@nabijaczleweli.xyz>

writev(2) notes that buffers don't interleave with other process'
(a reasonable question to ask), but points to pipe(7) for an exception.
pipe(7) did /not/ mention "writev", "iov", "scat", or "gath", which are,
in order, reasonable search terms: this was confusing at best and
alarming at worst

By mentioning writev(2) in the heading, we clearly note that this sort
of interleaving behaviour matches write(2)'s and isn't a concern

Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man7/pipe.7 | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/man7/pipe.7 b/man7/pipe.7
index c3210320c..29f6cf6cb 100644
--- a/man7/pipe.7
+++ b/man7/pipe.7
@@ -246,6 +246,8 @@ limits; see BUGS.
 .SS PIPE_BUF
 POSIX.1 says that
 .BR write (2)s
+and
+.BR writev (2)s
 of less than
 .B PIPE_BUF
 bytes must be atomic: the output data is written to the pipe as a
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH 26/32] tkill.2: tfix
  2021-07-28 20:19 [PATCH 00/32] Patches from others Alejandro Colomar
                   ` (24 preceding siblings ...)
  2021-07-28 20:20 ` [PATCH 25/32] pipe.7: also mention writev(2) in atomicity sexion Alejandro Colomar
@ 2021-07-28 20:20 ` Alejandro Colomar
  2021-08-07 22:48   ` Michael Kerrisk (man-pages)
  2021-07-28 20:20 ` [PATCH 27/32] strstr.3: Add special case for empty needle Alejandro Colomar
                   ` (6 subsequent siblings)
  32 siblings, 1 reply; 92+ messages in thread
From: Alejandro Colomar @ 2021-07-28 20:20 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Sagar Patel, linux-man, Alejandro Colomar

From: Sagar Patel <sagarmp@cs.unc.edu>

Correct function signature by adding missing parenthesis.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man2/tkill.2 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man2/tkill.2 b/man2/tkill.2
index 6ff930e17..6e1afcd36 100644
--- a/man2/tkill.2
+++ b/man2/tkill.2
@@ -39,7 +39,7 @@ tkill, tgkill \- send a signal to a thread
 .PP
 .B #include <signal.h>
 .PP
-.BI "int tgkill, pid_t " tgid ", pid_t " tid ", int " sig );
+.BI "int tgkill(pid_t " tgid ", pid_t " tid ", int " sig );
 .fi
 .PP
 .IR Note :
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH 27/32] strstr.3: Add special case for empty needle
  2021-07-28 20:19 [PATCH 00/32] Patches from others Alejandro Colomar
                   ` (25 preceding siblings ...)
  2021-07-28 20:20 ` [PATCH 26/32] tkill.2: tfix Alejandro Colomar
@ 2021-07-28 20:20 ` Alejandro Colomar
  2021-08-07 23:53   ` Michael Kerrisk (man-pages)
  2021-07-28 20:20 ` [PATCH 28/32] sigaction.2: Document SA_EXPOSE_TAGBITS and the flag support detection protocol Alejandro Colomar
                   ` (5 subsequent siblings)
  32 siblings, 1 reply; 92+ messages in thread
From: Alejandro Colomar @ 2021-07-28 20:20 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Alejandro Colomar, linux-man, Stefan Kanthak

Reported-by: Stefan Kanthak <stefan.kanthak@nexgo.de>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man3/strstr.3 | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/man3/strstr.3 b/man3/strstr.3
index e085409c2..41ee87489 100644
--- a/man3/strstr.3
+++ b/man3/strstr.3
@@ -61,6 +61,14 @@ but ignores the case of both arguments.
 .SH RETURN VALUE
 These functions return a pointer to the beginning of the
 located substring, or NULL if the substring is not found.
+.PP
+Note the special case:
+If
+.I needle
+is the empty string,
+the return value is always
+.I haystack
+itself.
 .SH ATTRIBUTES
 For an explanation of the terms used in this section, see
 .BR attributes (7).
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH 28/32] sigaction.2: Document SA_EXPOSE_TAGBITS and the flag support detection protocol
  2021-07-28 20:19 [PATCH 00/32] Patches from others Alejandro Colomar
                   ` (26 preceding siblings ...)
  2021-07-28 20:20 ` [PATCH 27/32] strstr.3: Add special case for empty needle Alejandro Colomar
@ 2021-07-28 20:20 ` Alejandro Colomar
  2021-08-08 21:32   ` Michael Kerrisk (man-pages)
  2021-07-28 20:20 ` [PATCH 29/32] sigaction.2: Apply minor tweaks to Peter's patch Alejandro Colomar
                   ` (4 subsequent siblings)
  32 siblings, 1 reply; 92+ messages in thread
From: Alejandro Colomar @ 2021-07-28 20:20 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Peter Collingbourne, linux-man, Alejandro Colomar

From: Peter Collingbourne <pcc@google.com>

Signed-off-by: Peter Collingbourne <pcc@google.com>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man2/sigaction.2 | 123 +++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 123 insertions(+)

diff --git a/man2/sigaction.2 b/man2/sigaction.2
index 57ad6418c..4bf6f095e 100644
--- a/man2/sigaction.2
+++ b/man2/sigaction.2
@@ -261,6 +261,44 @@ This flag is meaningful only when establishing a signal handler.
 .\" .I sa_sigaction
 .\" field was added in Linux 2.1.86.)
 .\"
+.TP
+.B SA_UNSUPPORTED
+Used to dynamically probe for flag bit support.
+.IP
+If an attempt to register a handler succeeds with this flag set in
+.I act->sa_flags
+alongside other flags that are potentially unsupported by the kernel,
+and an immediately subsequent
+.BR sigaction ()
+call specifying the same signal number n and with non-NULL
+.I oldact
+yields
+.B SA_UNSUPPORTED
+.I clear
+in
+.IR oldact->sa_flags ,
+then
+.I oldact->sa_flags
+may be used as a bitmask
+describing which of the potentially unsupported flags are,
+in fact, supported.
+See the section "Dynamically probing for flag bit support"
+below for more details.
+.TP
+.BR SA_EXPOSE_TAGBITS " (since Linux 5.11)"
+Normally, when delivering a signal,
+an architecture-specific set of tag bits are cleared from the
+.I si_addr
+field of
+.IR siginfo_t .
+If this flag is set,
+an architecture-specific subset of the tag bits will be preserved in
+.IR si_addr .
+.IP
+Programs that need to be compatible with Linux versions older than 5.11
+must use
+.B SA_UNSUPPORTED
+to probe for support.
 .SS The siginfo_t argument to a SA_SIGINFO handler
 When the
 .B SA_SIGINFO
@@ -846,6 +884,91 @@ Triggered by a
 .BR seccomp (2)
 filter rule.
 .RE
+.SS Dynamically probing for flag bit support
+The
+.BR sigaction ()
+call on Linux accepts unknown bits set in
+.I act->sa_flags
+without error.
+The behavior of the kernel starting with Linux 5.11 is that a second
+.BR sigaction ()
+will clear unknown bits from
+.IR oldact->sa_flags .
+However, historically, a second
+.BR sigaction ()
+call would typically leave those bits set in
+.IR oldact->sa_flags .
+.PP
+This means that support for new flags cannot be detected
+simply by testing for a flag in
+.IR sa_flags ,
+and a program must test that
+.B SA_UNSUPPORTED
+has been cleared before relying on the contents of
+.IR sa_flags .
+.PP
+Since the behavior of the signal handler cannot be guaranteed
+unless the check passes,
+it is wise to either block the affected signal
+while registering the handler and performing the check in this case,
+or where this is not possible,
+for example if the signal is synchronous, to issue the second
+.BR sigaction ()
+in the signal handler itself.
+.PP
+In kernels that do not support a specific flag,
+the kernel's behavior is as if the flag was not set,
+even if the flag was set in
+.IR act->sa_flags .
+.PP
+The flags
+.BR SA_NOCLDSTOP ,
+.BR SA_NOCLDWAIT ,
+.BR SA_SIGINFO ,
+.BR SA_ONSTACK ,
+.BR SA_RESTART ,
+.BR SA_NODEFER ,
+.BR SA_RESETHAND ,
+and, if defined by the architecture,
+.B SA_RESTORER
+may not be reliably probed for using this mechanism,
+because they were introduced before Linux 5.11.
+However, in general, programs may assume that these flags are supported,
+since they have all been supported since Linux 2.6,
+which was released in the year 2003.
+.PP
+The following example program exits with status 0 if
+.B SA_EXPOSE_TAGBITS
+is determined to be supported, and 1 otherwise.
+.PP
+.EX
+#include <signal.h>
+#include <stdio.h>
+#include <unistd.h>
+
+void handler(int signo, siginfo_t *info, void *context) {
+    struct sigaction oldact;
+    if (sigaction(SIGSEGV, 0, &oldact) == 0 &&
+        !(oldact.sa_flags & SA_UNSUPPORTED) &&
+        (oldact.sa_flags & SA_EXPOSE_TAGBITS)) {
+        _exit(0);
+    } else {
+        _exit(1);
+    }
+}
+
+int main(void) {
+    struct sigaction act = {0};
+    act.sa_flags = SA_SIGINFO | SA_UNSUPPORTED | SA_EXPOSE_TAGBITS;
+    act.sa_sigaction = handler;
+    if (sigaction(SIGSEGV, &act, 0) != 0) {
+        perror("sigaction");
+        return 1;
+    }
+
+    raise(SIGSEGV);
+}
+.EE
 .SH RETURN VALUE
 .BR sigaction ()
 returns 0 on success; on error, \-1 is returned, and
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH 29/32] sigaction.2: Apply minor tweaks to Peter's patch
  2021-07-28 20:19 [PATCH 00/32] Patches from others Alejandro Colomar
                   ` (27 preceding siblings ...)
  2021-07-28 20:20 ` [PATCH 28/32] sigaction.2: Document SA_EXPOSE_TAGBITS and the flag support detection protocol Alejandro Colomar
@ 2021-07-28 20:20 ` Alejandro Colomar
  2021-07-29 11:14   ` Alejandro Colomar (man-pages)
  2021-08-08 21:32   ` Michael Kerrisk (man-pages)
  2021-07-28 20:20 ` [PATCH 30/32] strlen.3, wcslen.3: Add recommendations for safer variants Alejandro Colomar
                   ` (3 subsequent siblings)
  32 siblings, 2 replies; 92+ messages in thread
From: Alejandro Colomar @ 2021-07-28 20:20 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Alejandro Colomar, linux-man

- Move example program to a new EXAMPLES section
- Invert logic in the handler to have the failure in the conditional path,
  and the success in out of any conditionals.
- Use NULL, EXIT_SUCCESS, and EXIT_FAILURE instead of magic numbers
- Separate declarations from code
- Put function return type on its own line
- Put function opening brace on its line

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man2/sigaction.2 | 76 +++++++++++++++++++++++++++---------------------
 1 file changed, 43 insertions(+), 33 deletions(-)

diff --git a/man2/sigaction.2 b/man2/sigaction.2
index 4bf6f095e..18404dde1 100644
--- a/man2/sigaction.2
+++ b/man2/sigaction.2
@@ -936,39 +936,6 @@ because they were introduced before Linux 5.11.
 However, in general, programs may assume that these flags are supported,
 since they have all been supported since Linux 2.6,
 which was released in the year 2003.
-.PP
-The following example program exits with status 0 if
-.B SA_EXPOSE_TAGBITS
-is determined to be supported, and 1 otherwise.
-.PP
-.EX
-#include <signal.h>
-#include <stdio.h>
-#include <unistd.h>
-
-void handler(int signo, siginfo_t *info, void *context) {
-    struct sigaction oldact;
-    if (sigaction(SIGSEGV, 0, &oldact) == 0 &&
-        !(oldact.sa_flags & SA_UNSUPPORTED) &&
-        (oldact.sa_flags & SA_EXPOSE_TAGBITS)) {
-        _exit(0);
-    } else {
-        _exit(1);
-    }
-}
-
-int main(void) {
-    struct sigaction act = {0};
-    act.sa_flags = SA_SIGINFO | SA_UNSUPPORTED | SA_EXPOSE_TAGBITS;
-    act.sa_sigaction = handler;
-    if (sigaction(SIGSEGV, &act, 0) != 0) {
-        perror("sigaction");
-        return 1;
-    }
-
-    raise(SIGSEGV);
-}
-.EE
 .SH RETURN VALUE
 .BR sigaction ()
 returns 0 on success; on error, \-1 is returned, and
@@ -1174,6 +1141,49 @@ This bug was fixed in kernel 2.6.14.
 .SH EXAMPLES
 See
 .BR mprotect (2).
+.PP
+The following example program exits with status
+.B EXIT_SUCCESS
+if
+.B SA_EXPOSE_TAGBITS
+is determined to be supported, and
+.B EXIT_FAILURE
+otherwise.
+.PP
+.EX
+#include <signal.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
+
+void
+handler(int signo, siginfo_t *info, void *context)
+{
+    struct sigaction oldact;
+
+    if (sigaction(SIGSEGV, NULL, &oldact) != 0 ||
+        (oldact.sa_flags & SA_UNSUPPORTED) ||
+        !(oldact.sa_flags & SA_EXPOSE_TAGBITS)) {
+        _exit(EXIT_FAILURE);
+    }
+    _exit(EXIT_SUCCESS);
+}
+
+int
+main(void)
+{
+    struct sigaction act = {0};
+
+    act.sa_flags = SA_SIGINFO | SA_UNSUPPORTED | SA_EXPOSE_TAGBITS;
+    act.sa_sigaction = &handler;
+    if (sigaction(SIGSEGV, &act, NULL) != 0) {
+        perror("sigaction");
+        exit(EXIT_FAILURE);
+    }
+
+    raise(SIGSEGV);
+}
+.EE
 .SH SEE ALSO
 .BR kill (1),
 .BR kill (2),
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH 30/32] strlen.3, wcslen.3: Add recommendations for safer variants
  2021-07-28 20:19 [PATCH 00/32] Patches from others Alejandro Colomar
                   ` (28 preceding siblings ...)
  2021-07-28 20:20 ` [PATCH 29/32] sigaction.2: Apply minor tweaks to Peter's patch Alejandro Colomar
@ 2021-07-28 20:20 ` Alejandro Colomar
  2021-08-07 23:45   ` Michael Kerrisk (man-pages)
  2021-07-28 20:20 ` [PATCH 31/32] time.2: wfix regarding year-2038 Alejandro Colomar
                   ` (2 subsequent siblings)
  32 siblings, 1 reply; 92+ messages in thread
From: Alejandro Colomar @ 2021-07-28 20:20 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Alejandro Colomar, linux-man, Jonny Grant

Reported-by: Jonny Grant <jg@jguk.org>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man3/strlen.3 | 6 ++++++
 man3/wcslen.3 | 9 ++++++++-
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/man3/strlen.3 b/man3/strlen.3
index dea4c1050..78783c446 100644
--- a/man3/strlen.3
+++ b/man3/strlen.3
@@ -66,6 +66,12 @@ T}	Thread safety	MT-Safe
 .sp 1
 .SH CONFORMING TO
 POSIX.1-2001, POSIX.1-2008, C89, C99, C11, SVr4, 4.3BSD.
+.SH NOTES
+.SS strnlen(3)
+If the input buffer size is known,
+it is probably better to use
+.BR strnlen (3),
+which can prevent reading past the end of the array.
 .SH SEE ALSO
 .BR string (3),
 .BR strnlen (3),
diff --git a/man3/wcslen.3 b/man3/wcslen.3
index af3fcb9ca..fe1d6331b 100644
--- a/man3/wcslen.3
+++ b/man3/wcslen.3
@@ -58,5 +58,12 @@ T}	Thread safety	MT-Safe
 .sp 1
 .SH CONFORMING TO
 POSIX.1-2001, POSIX.1-2008, C99.
+.SH NOTES
+.SS wcsnlen(3)
+If the input buffer size is known,
+it is probably better to use
+.BR wcsnlen (3),
+which can prevent reading past the end of the array.
 .SH SEE ALSO
-.BR strlen (3)
+.BR strlen (3),
+.BR wcsnlen (3)
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH 31/32] time.2: wfix regarding year-2038
  2021-07-28 20:19 [PATCH 00/32] Patches from others Alejandro Colomar
                   ` (29 preceding siblings ...)
  2021-07-28 20:20 ` [PATCH 30/32] strlen.3, wcslen.3: Add recommendations for safer variants Alejandro Colomar
@ 2021-07-28 20:20 ` Alejandro Colomar
  2021-07-29 10:45   ` G. Branden Robinson
  2021-07-28 20:20 ` [PATCH 32/32] execve.2: Fix absolute/relative pathname Alejandro Colomar
  2021-08-08 21:34 ` [PATCH 00/32] Patches from others Michael Kerrisk (man-pages)
  32 siblings, 1 reply; 92+ messages in thread
From: Alejandro Colomar @ 2021-07-28 20:20 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Viet Than, linux-man, Jakub Wilk, Alejandro Colomar

From: Viet Than <thanhoangviet@gmail.com>

Cc: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Viet Than <thanhoangviet@gmail.com>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man2/time.2 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man2/time.2 b/man2/time.2
index 059222dcd..a7410bfc8 100644
--- a/man2/time.2
+++ b/man2/time.2
@@ -93,7 +93,7 @@ specified as NULL cannot fail with the error
 .BR EOVERFLOW ,
 even on ABIs where
 .I time_t
-is a signed 32-bit integer and the clock ticks past the time 2**31
+is a signed 32-bit integer and the clock reaches at or beyond the time 2**31
 (2038-01-19 03:14:08 UTC, ignoring leap seconds).
 (POSIX.1 permits, but does not require, the
 .B EOVERFLOW
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH 32/32] execve.2: Fix absolute/relative pathname
  2021-07-28 20:19 [PATCH 00/32] Patches from others Alejandro Colomar
                   ` (30 preceding siblings ...)
  2021-07-28 20:20 ` [PATCH 31/32] time.2: wfix regarding year-2038 Alejandro Colomar
@ 2021-07-28 20:20 ` Alejandro Colomar
  2021-08-08  2:02   ` Michael Kerrisk (man-pages)
  2021-08-08 21:34 ` [PATCH 00/32] Patches from others Michael Kerrisk (man-pages)
  32 siblings, 1 reply; 92+ messages in thread
From: Alejandro Colomar @ 2021-07-28 20:20 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Shawn Landden, linux-man, Nora Platiel, Alejandro Colomar

From: Shawn Landden <shawn@git.icu>

The absolute pathname is available in the Linux-specific
auxiliary-vector feature.

Reported-by: Nora Platiel <nplatiel@gmx.us>
Signed-off-by: Shawn Landden <shawn@git.icu>
Reviewed-by: Nora Platiel <nplatiel@gmx.us>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man2/execve.2 | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/man2/execve.2 b/man2/execve.2
index c18ca5412..7fe12ab42 100644
--- a/man2/execve.2
+++ b/man2/execve.2
@@ -346,7 +346,9 @@ will be invoked with the following arguments:
 .PP
 where
 .I pathname
-is the absolute pathname of the file specified as the first argument of
+is the absolute pathname of the file specified (may be relative to
+.BR getcwd (3)
+of the caller) as the first argument of
 .BR execve (),
 and
 .I arg...
@@ -356,6 +358,11 @@ argument of
 .BR execve (),
 starting at
 .IR argv[1] .
+The absolute pathname of the script is also available
+in the same auxiliary vector the environment and argument variables are in, as
+.BR AT_EXECFN .
+See
+.BR getauxval (3).
 Note that there is no way to get the
 .IR argv[0]
 that was passed to the
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* Re: [PATCH 10/32] futex.2: Document FUTEX_LOCK_PI2
  2021-07-28 20:19 ` [PATCH 10/32] futex.2: Document FUTEX_LOCK_PI2 Alejandro Colomar
@ 2021-07-29 10:18   ` Alejandro Colomar (man-pages)
  2021-08-07 21:38     ` Michael Kerrisk (man-pages)
  0 siblings, 1 reply; 92+ messages in thread
From: Alejandro Colomar (man-pages) @ 2021-07-29 10:18 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Kurt Kanzenbach, linux-man

Hi Michael,

On 7/28/21 10:19 PM, Alejandro Colomar wrote:
> From: Kurt Kanzenbach <kurt@linutronix.de>
> 
> FUTEX_LOCK_PI2 is a new futex operation which was recently introduced into the
> Linux kernel. It works exactly like FUTEX_LOCK_PI. However, it has support for
> selectable clocks for timeouts. By default CLOCK_MONOTONIC is used. If
> FUTEX_CLOCK_REALTIME is specified then the timeout is measured against
> CLOCK_REALTIME.
> 
> This new operation addresses an inconsistency in the futex interface:
> FUTEX_LOCK_PI only works with timeouts based on CLOCK_REALTIME in contrast to
> all the other PI operations.
> 
> Document the FUTEX_LOCK_PI2 command.
> 
> Signed-off-by: Kurt Kanzenbach <kurt@linutronix.de>

Please drop this one.  I just found a small typo, and will add a 
Reviewed-by line received today.

Thanks,

Alex

> ---
>   man2/futex.2 | 53 ++++++++++++++++++++++++++++++++++++++++++++++++----
>   1 file changed, 49 insertions(+), 4 deletions(-)
> 
> diff --git a/man2/futex.2 b/man2/futex.2
> index ada96c517..2f340e0e0 100644
> --- a/man2/futex.2
> +++ b/man2/futex.2
> @@ -241,10 +241,13 @@ and so on.
>   This option bit can be employed only with the
>   .BR FUTEX_WAIT_BITSET ,
>   .BR FUTEX_WAIT_REQUEUE_PI ,
> -and
>   (since Linux 4.5)
>   .\" commit 337f13046ff03717a9e99675284a817527440a49
> -.BR FUTEX_WAIT
> +.BR FUTEX_WAIT ,
> +and
> +(since Linux v5.14.0)
> +.\" commit bf22a6976897977b0a3f1aeba6823c959fc4fdae
> +.BR FUTEX_LOCK_PI2
>   operations.
>   .IP
>   If this option is set, the kernel measures the
> @@ -904,7 +907,9 @@ value to 0 if the previous value was the expected TID.
>   If a futex is already acquired (i.e., has a nonzero value),
>   waiters must employ the
>   .B FUTEX_LOCK_PI
> -operation to acquire the lock.
> +or
> +.B FUTEX_LOCK_PI2
> +operations to acquire the lock.
>   If other threads are waiting for the lock, then the
>   .B FUTEX_WAITERS
>   bit is set in the futex value;
> @@ -964,6 +969,8 @@ Note that the PI futex operations must be used as paired operations
>   and are subject to some additional requirements:
>   .IP * 3
>   .B FUTEX_LOCK_PI
> +,
> +.B FUTEX_LOCK_PI2
>   and
>   .B FUTEX_TRYLOCK_PI
>   pair with
> @@ -1122,6 +1129,27 @@ arguments are ignored.
>   .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
>   .\"
>   .TP
> +.BR FUTEX_LOCK_PI2 " (since Linux 5.14.0)"
> +.\" commit bf22a6976897977b0a3f1aeba6823c959fc4fdae
> +This operation works similar like
> +.BR FUTEX_LOCK_PI .
> +The only difference is the
> +timeout argument.
> +.BR FUTEX_LOCK_PI2
> +has support for selectable clocks.
> +.IP
> +If
> +.I timeout
> +is not NULL, the structure it points to specifies
> +an absolute timeout.
> +If
> +.I timeout
> +is NULL, the operation can block indefinitely.
> +.IP
> +.\"
> +.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
> +.\"
> +.TP
>   .BR FUTEX_TRYLOCK_PI " (since Linux 2.6.18)"
>   .\" commit c87e2837be82df479a6bae9f155c43516d2feebc
>   This operation tries to acquire the lock at
> @@ -1168,6 +1196,8 @@ arguments are ignored.
>   .\" commit c87e2837be82df479a6bae9f155c43516d2feebc
>   This operation wakes the top priority waiter that is waiting in
>   .B FUTEX_LOCK_PI
> +or
> +.B FUTEX_LOCK_PI2
>   on the futex address provided by the
>   .I uaddr
>   argument.
> @@ -1379,6 +1409,9 @@ Returns the number of waiters that were woken up.
>   .B FUTEX_LOCK_PI
>   Returns 0 if the futex was successfully locked.
>   .TP
> +.B FUTEX_LOCK_PI2
> +Returns 0 if the futex was successfully locked.
> +.TP
>   .B FUTEX_TRYLOCK_PI
>   Returns 0 if the futex was successfully locked.
>   .TP
> @@ -1435,6 +1468,7 @@ is not equal to the expected value
>   .TP
>   .BR EAGAIN
>   .RB ( FUTEX_LOCK_PI ,
> +.BR FUTEX_LOCK_PI2 ,
>   .BR FUTEX_TRYLOCK_PI ,
>   .BR FUTEX_CMP_REQUEUE_PI )
>   The futex owner thread ID of
> @@ -1448,6 +1482,7 @@ Try again.
>   .TP
>   .BR EDEADLK
>   .RB ( FUTEX_LOCK_PI ,
> +.BR FUTEX_LOCK_PI2 ,
>   .BR FUTEX_TRYLOCK_PI ,
>   .BR FUTEX_CMP_REQUEUE_PI )
>   The futex word at
> @@ -1536,11 +1571,14 @@ The kernel detected an inconsistency between the user-space state at
>   .I uaddr
>   and the kernel state\(emthat is, it detected a waiter which waits in
>   .BR FUTEX_LOCK_PI
> +or
> +.BR FUTEX_LOCK_PI2
>   on
>   .IR uaddr .
>   .TP
>   .B EINVAL
>   .RB ( FUTEX_LOCK_PI ,
> +.BR FUTEX_LOCK_PI2 ,
>   .BR FUTEX_TRYLOCK_PI ,
>   .BR FUTEX_UNLOCK_PI )
>   The kernel detected an inconsistency between the user-space state at
> @@ -1590,6 +1628,8 @@ that is, the kernel detected a waiter which waits on
>   .I uaddr
>   via
>   .BR FUTEX_LOCK_PI
> +or
> +.BR FUTEX_LOCK_PI2
>   (instead of
>   .BR FUTEX_WAIT_REQUEUE_PI ).
>   .TP
> @@ -1618,6 +1658,7 @@ The system-wide limit on the total number of open files has been reached.
>   .TP
>   .BR ENOMEM
>   .RB ( FUTEX_LOCK_PI ,
> +.BR FUTEX_LOCK_PI2 ,
>   .BR FUTEX_TRYLOCK_PI ,
>   .BR FUTEX_CMP_REQUEUE_PI )
>   The kernel could not allocate memory to hold state information.
> @@ -1634,11 +1675,13 @@ option was specified in
>   but the accompanying operation was neither
>   .BR FUTEX_WAIT ,
>   .BR FUTEX_WAIT_BITSET ,
> +.BR FUTEX_WAIT_REQUEUE_PI ,
>   nor
> -.BR FUTEX_WAIT_REQUEUE_PI .
> +.BR FUTEX_LOCK_PI2 .
>   .TP
>   .BR ENOSYS
>   .RB ( FUTEX_LOCK_PI ,
> +.BR FUTEX_LOCK_PI2 ,
>   .BR FUTEX_TRYLOCK_PI ,
>   .BR FUTEX_UNLOCK_PI ,
>   .BR FUTEX_CMP_REQUEUE_PI ,
> @@ -1649,6 +1692,7 @@ are not supported on some CPU variants.
>   .TP
>   .BR EPERM
>   .RB ( FUTEX_LOCK_PI ,
> +.BR FUTEX_LOCK_PI2 ,
>   .BR FUTEX_TRYLOCK_PI ,
>   .BR FUTEX_CMP_REQUEUE_PI )
>   The caller is not allowed to attach itself to the futex at
> @@ -1665,6 +1709,7 @@ The caller does not own the lock represented by the futex word.
>   .TP
>   .BR ESRCH
>   .RB ( FUTEX_LOCK_PI ,
> +.BR FUTEX_LOCK_PI2 ,
>   .BR FUTEX_TRYLOCK_PI ,
>   .BR FUTEX_CMP_REQUEUE_PI )
>   The thread ID in the futex word at
> 


-- 
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH 11/32] futex.2: Minor tweaks to Kurt's patch
  2021-07-28 20:19 ` [PATCH 11/32] futex.2: Minor tweaks to Kurt's patch Alejandro Colomar
@ 2021-07-29 10:24   ` Alejandro Colomar (man-pages)
  2021-08-07 21:38     ` Michael Kerrisk (man-pages)
  0 siblings, 1 reply; 92+ messages in thread
From: Alejandro Colomar (man-pages) @ 2021-07-29 10:24 UTC (permalink / raw)
  To: mtk.manpages; +Cc: linux-man

On 7/28/21 10:19 PM, Alejandro Colomar wrote:
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>

Drop this one too.

> ---
>   man2/futex.2 | 69 ++++++++++++++++++++++++++--------------------------
>   1 file changed, 34 insertions(+), 35 deletions(-)
> 
> diff --git a/man2/futex.2 b/man2/futex.2
> index 2f340e0e0..217b76734 100644
> --- a/man2/futex.2
> +++ b/man2/futex.2
> @@ -222,9 +222,9 @@ This allows the kernel to make some additional performance optimizations.
>   .\" taking reference counts on file backing store, and so on.
>   .IP
>   As a convenience,
> -.IR <linux/futex.h>
> +.I <linux/futex.h>
>   defines a set of constants with the suffix
> -.BR _PRIVATE
> +.B _PRIVATE
>   that are equivalents of all of the operations listed below,
>   .\" except the obsolete FUTEX_FD, for which the "private" flag was
>   .\" meaningless
> @@ -247,19 +247,19 @@ This option bit can be employed only with the
>   and
>   (since Linux v5.14.0)
>   .\" commit bf22a6976897977b0a3f1aeba6823c959fc4fdae
> -.BR FUTEX_LOCK_PI2
> +.B FUTEX_LOCK_PI2
>   operations.
>   .IP
>   If this option is set, the kernel measures the
>   .I timeout
>   against the
> -.BR CLOCK_REALTIME
> +.B CLOCK_REALTIME
>   clock.
>   .IP
>   If this option is not set, the kernel measures the
>   .I timeout
>   against the
> -.BR CLOCK_MONOTONIC
> +.B CLOCK_MONOTONIC
>   clock.
>   .PP
>   The operation specified in
> @@ -968,9 +968,8 @@ PI futexes are operated on by specifying one of the values listed below in
>   Note that the PI futex operations must be used as paired operations
>   and are subject to some additional requirements:
>   .IP * 3
> -.B FUTEX_LOCK_PI
> -,
> -.B FUTEX_LOCK_PI2
> +.BR FUTEX_LOCK_PI ,
> +.BR FUTEX_LOCK_PI2 ,
>   and
>   .B FUTEX_TRYLOCK_PI
>   pair with
> @@ -1123,7 +1122,7 @@ The
>   .IR uaddr2 ,
>   .IR val ,
>   and
> -.IR val3
> +.I val3
>   arguments are ignored.
>   .\"
>   .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
> @@ -1135,7 +1134,7 @@ This operation works similar like
>   .BR FUTEX_LOCK_PI .
>   The only difference is the
>   timeout argument.
> -.BR FUTEX_LOCK_PI2
> +.B FUTEX_LOCK_PI2
>   has support for selectable clocks.
>   .IP
>   If
> @@ -1466,7 +1465,7 @@ The value pointed to by
>   is not equal to the expected value
>   .IR val3 .
>   .TP
> -.BR EAGAIN
> +.B EAGAIN
>   .RB ( FUTEX_LOCK_PI ,
>   .BR FUTEX_LOCK_PI2 ,
>   .BR FUTEX_TRYLOCK_PI ,
> @@ -1480,7 +1479,7 @@ is about to exit,
>   but has not yet handled the internal state cleanup.
>   Try again.
>   .TP
> -.BR EDEADLK
> +.B EDEADLK
>   .RB ( FUTEX_LOCK_PI ,
>   .BR FUTEX_LOCK_PI2 ,
>   .BR FUTEX_TRYLOCK_PI ,
> @@ -1522,18 +1521,18 @@ a spurious wakeup; since Linux 2.6.22, this no longer happens.
>   .TP
>   .B EINVAL
>   The operation in
> -.IR futex_op
> +.I futex_op
>   is one of those that employs a timeout, but the supplied
>   .I timeout
>   argument was invalid
>   .RI ( tv_sec
>   was less than zero, or
> -.IR tv_nsec
> +.I tv_nsec
>   was not less than 1,000,000,000).
>   .TP
>   .B EINVAL
>   The operation specified in
> -.IR futex_op
> +.I futex_op
>   employs one or both of the pointers
>   .I uaddr
>   and
> @@ -1545,17 +1544,17 @@ the address is not four-byte-aligned.
>   .RB ( FUTEX_WAIT_BITSET ,
>   .BR FUTEX_WAKE_BITSET )
>   The bit mask supplied in
> -.IR val3
> +.I val3
>   is zero.
>   .TP
>   .B EINVAL
>   .RB ( FUTEX_CMP_REQUEUE_PI )
>   .I uaddr
>   equals
> -.IR uaddr2
> +.I uaddr2
>   (i.e., an attempt was made to requeue to the same futex).
>   .TP
> -.BR EINVAL
> +.B EINVAL
>   .RB ( FUTEX_FD )
>   The signal number supplied in
>   .I val
> @@ -1570,9 +1569,9 @@ is invalid.
>   The kernel detected an inconsistency between the user-space state at
>   .I uaddr
>   and the kernel state\(emthat is, it detected a waiter which waits in
> -.BR FUTEX_LOCK_PI
> +.B FUTEX_LOCK_PI
>   or
> -.BR FUTEX_LOCK_PI2
> +.B FUTEX_LOCK_PI2
>   on
>   .IR uaddr .
>   .TP
> @@ -1588,7 +1587,7 @@ This indicates either state corruption
>   or that the kernel found a waiter on
>   .I uaddr
>   which is waiting via
> -.BR FUTEX_WAIT
> +.B FUTEX_WAIT
>   or
>   .BR FUTEX_WAIT_BITSET .
>   .TP
> @@ -1601,9 +1600,9 @@ and the kernel state;
>   .\"	The kernel sees: I have non PI state for a futex you tried to
>   .\"     tell me was PI
>   that is, the kernel detected a waiter which waits via
> -.BR FUTEX_WAIT
> +.B FUTEX_WAIT
>   or
> -.BR FUTEX_WAIT_BITSET
> +.B FUTEX_WAIT_BITSET
>   on
>   .IR uaddr2 .
>   .TP
> @@ -1613,9 +1612,9 @@ The kernel detected an inconsistency between the user-space state at
>   .I uaddr
>   and the kernel state;
>   that is, the kernel detected a waiter which waits via
> -.BR FUTEX_WAIT
> +.B FUTEX_WAIT
>   or
> -.BR FUTEX_WAIT_BITSET
> +.B FUTEX_WAIT_BITSET
>   on
>   .IR uaddr .
>   .TP
> @@ -1627,9 +1626,9 @@ and the kernel state;
>   that is, the kernel detected a waiter which waits on
>   .I uaddr
>   via
> -.BR FUTEX_LOCK_PI
> +.B FUTEX_LOCK_PI
>   or
> -.BR FUTEX_LOCK_PI2
> +.B FUTEX_LOCK_PI2
>   (instead of
>   .BR FUTEX_WAIT_REQUEUE_PI ).
>   .TP
> @@ -1656,7 +1655,7 @@ Invalid argument.
>   .RB ( FUTEX_FD )
>   The system-wide limit on the total number of open files has been reached.
>   .TP
> -.BR ENOMEM
> +.B ENOMEM
>   .RB ( FUTEX_LOCK_PI ,
>   .BR FUTEX_LOCK_PI2 ,
>   .BR FUTEX_TRYLOCK_PI ,
> @@ -1669,7 +1668,7 @@ Invalid operation specified in
>   .TP
>   .B ENOSYS
>   The
> -.BR FUTEX_CLOCK_REALTIME
> +.B FUTEX_CLOCK_REALTIME
>   option was specified in
>   .IR futex_op ,
>   but the accompanying operation was neither
> @@ -1679,7 +1678,7 @@ but the accompanying operation was neither
>   nor
>   .BR FUTEX_LOCK_PI2 .
>   .TP
> -.BR ENOSYS
> +.B ENOSYS
>   .RB ( FUTEX_LOCK_PI ,
>   .BR FUTEX_LOCK_PI2 ,
>   .BR FUTEX_TRYLOCK_PI ,
> @@ -1690,7 +1689,7 @@ A run-time check determined that the operation is not available.
>   The PI-futex operations are not implemented on all architectures and
>   are not supported on some CPU variants.
>   .TP
> -.BR EPERM
> +.B EPERM
>   .RB ( FUTEX_LOCK_PI ,
>   .BR FUTEX_LOCK_PI2 ,
>   .BR FUTEX_TRYLOCK_PI ,
> @@ -1703,11 +1702,11 @@ the futex at
>   .IR uaddr2 ).
>   (This may be caused by a state corruption in user space.)
>   .TP
> -.BR EPERM
> +.B EPERM
>   .RB ( FUTEX_UNLOCK_PI )
>   The caller does not own the lock represented by the futex word.
>   .TP
> -.BR ESRCH
> +.B ESRCH
>   .RB ( FUTEX_LOCK_PI ,
>   .BR FUTEX_LOCK_PI2 ,
>   .BR FUTEX_TRYLOCK_PI ,
> @@ -1716,7 +1715,7 @@ The thread ID in the futex word at
>   .I uaddr
>   does not exist.
>   .TP
> -.BR ESRCH
> +.B ESRCH
>   .RB ( FUTEX_CMP_REQUEUE_PI )
>   The thread ID in the futex word at
>   .I uaddr2
> @@ -1724,7 +1723,7 @@ does not exist.
>   .TP
>   .B ETIMEDOUT
>   The operation in
> -.IR futex_op
> +.I futex_op
>   employed the timeout specified in
>   .IR timeout ,
>   and the timeout expired before the operation completed.
> 


-- 
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH 31/32] time.2: wfix regarding year-2038
  2021-07-28 20:20 ` [PATCH 31/32] time.2: wfix regarding year-2038 Alejandro Colomar
@ 2021-07-29 10:45   ` G. Branden Robinson
  2021-07-30  1:25     ` Viet Than
  0 siblings, 1 reply; 92+ messages in thread
From: G. Branden Robinson @ 2021-07-29 10:45 UTC (permalink / raw)
  To: mtk.manpages, Viet Than, linux-man

[-- Attachment #1: Type: text/plain, Size: 859 bytes --]

Hi Than,

At 2021-07-28T22:20:07+0200, Alejandro Colomar wrote:
> From: Viet Than <thanhoangviet@gmail.com>
> 
> Cc: Jakub Wilk <jwilk@jwilk.net>
> Signed-off-by: Viet Than <thanhoangviet@gmail.com>
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
> ---
>  man2/time.2 | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/man2/time.2 b/man2/time.2
> index 059222dcd..a7410bfc8 100644
> --- a/man2/time.2
> +++ b/man2/time.2
> @@ -93,7 +93,7 @@ specified as NULL cannot fail with the error
>  .BR EOVERFLOW ,
>  even on ABIs where
>  .I time_t
> -is a signed 32-bit integer and the clock ticks past the time 2**31
> +is a signed 32-bit integer and the clock reaches at or beyond the time 2**31

"[R]eaches at" is not standard English.  More idiomatic would be
"reaches or exceeds".

Regards,
Branden

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH 29/32] sigaction.2: Apply minor tweaks to Peter's patch
  2021-07-28 20:20 ` [PATCH 29/32] sigaction.2: Apply minor tweaks to Peter's patch Alejandro Colomar
@ 2021-07-29 11:14   ` Alejandro Colomar (man-pages)
  2021-08-08 21:32   ` Michael Kerrisk (man-pages)
  1 sibling, 0 replies; 92+ messages in thread
From: Alejandro Colomar (man-pages) @ 2021-07-29 11:14 UTC (permalink / raw)
  To: mtk.manpages; +Cc: linux-man, Peter Collingbourne

On 7/28/21 10:20 PM, Alejandro Colomar wrote:
> - Move example program to a new EXAMPLES section
> - Invert logic in the handler to have the failure in the conditional path,
>    and the success in out of any conditionals.
> - Use NULL, EXIT_SUCCESS, and EXIT_FAILURE instead of magic numbers
> - Separate declarations from code
> - Put function return type on its own line
> - Put function opening brace on its line
> 
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>

I forgot to CC Peter here.

> ---
>   man2/sigaction.2 | 76 +++++++++++++++++++++++++++---------------------
>   1 file changed, 43 insertions(+), 33 deletions(-)
> 
> diff --git a/man2/sigaction.2 b/man2/sigaction.2
> index 4bf6f095e..18404dde1 100644
> --- a/man2/sigaction.2
> +++ b/man2/sigaction.2
> @@ -936,39 +936,6 @@ because they were introduced before Linux 5.11.
>   However, in general, programs may assume that these flags are supported,
>   since they have all been supported since Linux 2.6,
>   which was released in the year 2003.
> -.PP
> -The following example program exits with status 0 if
> -.B SA_EXPOSE_TAGBITS
> -is determined to be supported, and 1 otherwise.
> -.PP
> -.EX
> -#include <signal.h>
> -#include <stdio.h>
> -#include <unistd.h>
> -
> -void handler(int signo, siginfo_t *info, void *context) {
> -    struct sigaction oldact;
> -    if (sigaction(SIGSEGV, 0, &oldact) == 0 &&
> -        !(oldact.sa_flags & SA_UNSUPPORTED) &&
> -        (oldact.sa_flags & SA_EXPOSE_TAGBITS)) {
> -        _exit(0);
> -    } else {
> -        _exit(1);
> -    }
> -}
> -
> -int main(void) {
> -    struct sigaction act = {0};
> -    act.sa_flags = SA_SIGINFO | SA_UNSUPPORTED | SA_EXPOSE_TAGBITS;
> -    act.sa_sigaction = handler;
> -    if (sigaction(SIGSEGV, &act, 0) != 0) {
> -        perror("sigaction");
> -        return 1;
> -    }
> -
> -    raise(SIGSEGV);
> -}
> -.EE
>   .SH RETURN VALUE
>   .BR sigaction ()
>   returns 0 on success; on error, \-1 is returned, and
> @@ -1174,6 +1141,49 @@ This bug was fixed in kernel 2.6.14.
>   .SH EXAMPLES
>   See
>   .BR mprotect (2).
> +.PP
> +The following example program exits with status
> +.B EXIT_SUCCESS
> +if
> +.B SA_EXPOSE_TAGBITS
> +is determined to be supported, and
> +.B EXIT_FAILURE
> +otherwise.
> +.PP
> +.EX
> +#include <signal.h>
> +#include <stdlib.h>
> +#include <stdio.h>
> +#include <unistd.h>
> +
> +void
> +handler(int signo, siginfo_t *info, void *context)
> +{
> +    struct sigaction oldact;
> +
> +    if (sigaction(SIGSEGV, NULL, &oldact) != 0 ||
> +        (oldact.sa_flags & SA_UNSUPPORTED) ||
> +        !(oldact.sa_flags & SA_EXPOSE_TAGBITS)) {
> +        _exit(EXIT_FAILURE);
> +    }
> +    _exit(EXIT_SUCCESS);
> +}
> +
> +int
> +main(void)
> +{
> +    struct sigaction act = {0};
> +
> +    act.sa_flags = SA_SIGINFO | SA_UNSUPPORTED | SA_EXPOSE_TAGBITS;
> +    act.sa_sigaction = &handler;
> +    if (sigaction(SIGSEGV, &act, NULL) != 0) {
> +        perror("sigaction");
> +        exit(EXIT_FAILURE);
> +    }
> +
> +    raise(SIGSEGV);
> +}
> +.EE
>   .SH SEE ALSO
>   .BR kill (1),
>   .BR kill (2),
> 


-- 
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH 17/32] seccomp_unotify.2: Minor tweaks to Rodrigo's patch
  2021-07-28 20:19 ` [PATCH 17/32] seccomp_unotify.2: Minor tweaks to Rodrigo's patch Alejandro Colomar
@ 2021-07-29 11:15   ` Alejandro Colomar (man-pages)
  2021-08-08  1:13   ` Michael Kerrisk (man-pages)
  1 sibling, 0 replies; 92+ messages in thread
From: Alejandro Colomar (man-pages) @ 2021-07-29 11:15 UTC (permalink / raw)
  To: mtk.manpages; +Cc: linux-man, Rodrigo Campos

On 7/28/21 10:19 PM, Alejandro Colomar wrote:
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>

I forgot to CC Rodrigo here.

> ---
>   man2/seccomp_unotify.2 | 32 +++++++++++++++++---------------
>   1 file changed, 17 insertions(+), 15 deletions(-)
> 
> diff --git a/man2/seccomp_unotify.2 b/man2/seccomp_unotify.2
> index 9bd27214f..ae449ae36 100644
> --- a/man2/seccomp_unotify.2
> +++ b/man2/seccomp_unotify.2
> @@ -740,16 +740,18 @@ use the file descriptor number specified in the
>   .I newfd
>   field.
>   .TP
> -.BR SECCOMP_ADDFD_FLAG_SEND
> -Available since Linux 5.14, combines the
> +.BR SECCOMP_ADDFD_FLAG_SEND " (since Linux 5.14)"
> +Combines the
>   .B SECCOMP_IOCTL_NOTIF_ADDFD
>   ioctl with
>   .B SECCOMP_IOCTL_NOTIF_SEND
> -into an atomic operation. On successful invocation, the target process's
> -errno will be 0 and the return value will be the file descriptor number that was
> -installed in the target. If allocating the file descriptor in the tatget fails,
> -the target's syscall continues to be blocked until a successful response is
> -sent.
> +into an atomic operation.
> +On successful invocation, the target process's errno will be 0
> +and the return value will be the file descriptor number
> +that was installed in the target.
> +If allocating the file descriptor in the tatget fails,
> +the target's syscall continues to be blocked
> +until a successful response is sent.
>   .RE
>   .TP
>   .I srcfd
> @@ -1149,14 +1151,6 @@ that would
>   normally be restarted by the
>   .BR SA_RESTART
>   flag.
> -.PP
> -Furthermore, if the supervisor response is a file descriptor
> -added with
> -.B SECCOMP_IOCTL_NOTIF_ADDFD,
> -then the flag
> -.B SECCOMP_ADDFD_FLAG_SEND
> -can be used to atomically add the file descriptor and return that value,
> -making sure no file descriptors are inadvertently leaked into the target.
>   .\" FIXME
>   .\" About the above, Kees Cook commented:
>   .\"
> @@ -1176,6 +1170,14 @@ making sure no file descriptors are inadvertently leaked into the target.
>   .\" calls because it's impossible for the kernel to restart the call
>   .\" with the right timeout value. I wonder what happens when those
>   .\" system calls are restarted in the scenario we're discussing.)
> +.PP
> +Furthermore, if the supervisor response is a file descriptor
> +added with
> +.B SECCOMP_IOCTL_NOTIF_ADDFD,
> +then the flag
> +.B SECCOMP_ADDFD_FLAG_SEND
> +can be used to atomically add the file descriptor and return that value,
> +making sure no file descriptors are inadvertently leaked into the target.
>   .SH BUGS
>   If a
>   .BR SECCOMP_IOCTL_NOTIF_RECV
> 


-- 
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH 15/32] capabilities.7: Minor tweaks to Kir's patch
  2021-07-28 20:19 ` [PATCH 15/32] capabilities.7: Minor tweaks to Kir's patch Alejandro Colomar
@ 2021-07-29 11:16   ` Alejandro Colomar (man-pages)
  2021-08-08  3:03   ` Michael Kerrisk (man-pages)
  1 sibling, 0 replies; 92+ messages in thread
From: Alejandro Colomar (man-pages) @ 2021-07-29 11:16 UTC (permalink / raw)
  To: mtk.manpages; +Cc: linux-man, Kir Kolyshkin

On 7/28/21 10:19 PM, Alejandro Colomar wrote:
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>

I forgot to CC Kir here.

> ---
>   man7/capabilities.7 | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/man7/capabilities.7 b/man7/capabilities.7
> index 2f9c9a61e..4d08545ed 100644
> --- a/man7/capabilities.7
> +++ b/man7/capabilities.7
> @@ -353,8 +353,9 @@ Set arbitrary capabilities on a file.
>   .\" commit db2e718a47984b9d71ed890eb2ea36ecf150de18
>   Since Linux 5.12, this capability is
>   also needed to map uid 0 (as in
> -.BR unshare\ -Ur ,
> -.RB see unshare (1).
> +.IR "unshare -Ur" ,
> +see
> +.BR unshare (1).
>   .TP
>   .B CAP_SETPCAP
>   If file capabilities are supported (i.e., since Linux 2.6.24):
> 


-- 
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH 31/32] time.2: wfix regarding year-2038
  2021-07-29 10:45   ` G. Branden Robinson
@ 2021-07-30  1:25     ` Viet Than
  2021-08-07 23:59       ` Michael Kerrisk (man-pages)
  0 siblings, 1 reply; 92+ messages in thread
From: Viet Than @ 2021-07-30  1:25 UTC (permalink / raw)
  To: G. Branden Robinson; +Cc: Michael Kerrisk, linux-man

> "[R]eaches at" is not standard English.  More idiomatic would be
> "reaches or exceeds".

Thanks Branden. Searching around on Google, you're right. Usage of
"reaches at or beyond" is way less (1,240 results on Google) than
"reaches or exceeds" (376,000 results). I've modified the patch
accordingly.

Signed-off-by: Viet Than <thanhoangviet@gmail.com>

---
man2/time.2 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man2/time.2 b/man2/time.2
index 059222dcd..ab3d3ecba 100644
--- a/man2/time.2
+++ b/man2/time.2
@@ -93,7 +93,7 @@ specified as NULL cannot fail with the error
.BR EOVERFLOW ,
even on ABIs where
.I time_t
-is a signed 32-bit integer and the clock ticks past the time 2**31
+is a signed 32-bit integer and the clock reaches or exceeds 2**31 seconds
(2038-01-19 03:14:08 UTC, ignoring leap seconds).
(POSIX.1 permits, but does not require, the
.B EOVERFLOW
-- 
2.32.0

^ permalink raw reply related	[flat|nested] 92+ messages in thread

* Re: [PATCH 07/32] printf.3: wfix
  2021-07-28 20:19 ` [PATCH 07/32] printf.3: wfix Alejandro Colomar
@ 2021-08-07 21:34   ` Michael Kerrisk (man-pages)
  2021-08-07 22:20     ` Alejandro Colomar (man-pages)
  0 siblings, 1 reply; 92+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-08-07 21:34 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, linux-man, Sergey Petrakov

Hello Alex and Sergey,

On 7/28/21 10:19 PM, Alejandro Colomar wrote:
> Reported-by: Sergey Petrakov <kr@spmail.info>
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
> ---
>  man3/printf.3 | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/man3/printf.3 b/man3/printf.3
> index fcc3bd6f3..1074626e1 100644
> --- a/man3/printf.3
> +++ b/man3/printf.3
> @@ -115,7 +115,7 @@ is the same as
>  except that it outputs to a file descriptor,
>  .IR fd ,
>  instead of to a
> -.I stdio
> +.I FILE
>  stream.
>  .PP
>  The functions

Why this change? What is wrong with the existing text?

Thanks,

Michael


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH 08/32] Various pages: Consistently use '*argv[]'
  2021-07-28 20:19 ` [PATCH 08/32] Various pages: Consistently use '*argv[]' Alejandro Colomar
@ 2021-08-07 21:35   ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 92+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-08-07 21:35 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, Thomas Voss, linux-man

Hi Alex, Thomas,

On 7/28/21 10:19 PM, Alejandro Colomar wrote:
> From: Thomas Voss <thomasavoss@protonmail.com>
> 
> Scripted change:
> 
> $ find man? -type f \
>   | sed -i 's/int argc, char \*\*argv/int argc, char \*argv\[\]/';
> 
> Signed-off-by: Thomas Voss <thomasavoss@protonmail.com>
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>

Thanks. Applied.

Cheers,

Michael

> ---
>  man2/bpf.2                | 2 +-
>  man2/copy_file_range.2    | 2 +-
>  man2/membarrier.2         | 4 ++--
>  man2/perf_event_open.2    | 2 +-
>  man2/seccomp.2            | 2 +-
>  man3/bsearch.3            | 2 +-
>  man3/getopt.3             | 2 +-
>  man3/getsubopt.3          | 2 +-
>  man3/pthread_setname_np.3 | 2 +-
>  man3/wordexp.3            | 2 +-
>  man7/fanotify.7           | 2 +-
>  11 files changed, 12 insertions(+), 12 deletions(-)
> 
> diff --git a/man2/bpf.2 b/man2/bpf.2
> index 6e1ffa198..246053201 100644
> --- a/man2/bpf.2
> +++ b/man2/bpf.2
> @@ -1212,7 +1212,7 @@ riscv (since Linux 5.1).
>   * 4. print number of received TCP/UDP packets every second
>   */
>  int
> -main(int argc, char **argv)
> +main(int argc, char *argv[])
>  {
>      int sock, map_fd, prog_fd, key;
>      long long value = 0, tcp_cnt, udp_cnt;
> diff --git a/man2/copy_file_range.2 b/man2/copy_file_range.2
> index 467a16300..03bafcffc 100644
> --- a/man2/copy_file_range.2
> +++ b/man2/copy_file_range.2
> @@ -236,7 +236,7 @@ or server-side-copy (in the case of NFS).
>  #include <unistd.h>
>  
>  int
> -main(int argc, char **argv)
> +main(int argc, char *argv[])
>  {
>      int fd_in, fd_out;
>      struct stat stat;
> diff --git a/man2/membarrier.2 b/man2/membarrier.2
> index fec82f228..2771ebdcb 100644
> --- a/man2/membarrier.2
> +++ b/man2/membarrier.2
> @@ -358,7 +358,7 @@ slow_path(int *read_a)
>  }
>  
>  int
> -main(int argc, char **argv)
> +main(int argc, char *argv[])
>  {
>      int read_a, read_b;
>  
> @@ -444,7 +444,7 @@ slow_path(int *read_a)
>  }
>  
>  int
> -main(int argc, char **argv)
> +main(int argc, char *argv[])
>  {
>      int read_a, read_b;
>  
> diff --git a/man2/perf_event_open.2 b/man2/perf_event_open.2
> index d2523dd3d..daf5edddf 100644
> --- a/man2/perf_event_open.2
> +++ b/man2/perf_event_open.2
> @@ -3762,7 +3762,7 @@ perf_event_open(struct perf_event_attr *hw_event, pid_t pid,
>  }
>  
>  int
> -main(int argc, char **argv)
> +main(int argc, char *argv[])
>  {
>      struct perf_event_attr pe;
>      long long count;
> diff --git a/man2/seccomp.2 b/man2/seccomp.2
> index a3421871f..8c80fb7bb 100644
> --- a/man2/seccomp.2
> +++ b/man2/seccomp.2
> @@ -1199,7 +1199,7 @@ install_filter(int syscall_nr, int t_arch, int f_errno)
>  }
>  
>  int
> -main(int argc, char **argv)
> +main(int argc, char *argv[])
>  {
>      if (argc < 5) {
>          fprintf(stderr, "Usage: "
> diff --git a/man3/bsearch.3 b/man3/bsearch.3
> index 25ab3e8de..43e8b9c57 100644
> --- a/man3/bsearch.3
> +++ b/man3/bsearch.3
> @@ -124,7 +124,7 @@ compmi(const void *m1, const void *m2)
>  }
>  
>  int
> -main(int argc, char **argv)
> +main(int argc, char *argv[])
>  {
>      qsort(months, nr_of_months, sizeof(months[0]), compmi);
>      for (int i = 1; i < argc; i++) {
> diff --git a/man3/getopt.3 b/man3/getopt.3
> index 0d6ad1c54..ce4c28088 100644
> --- a/man3/getopt.3
> +++ b/man3/getopt.3
> @@ -491,7 +491,7 @@ with most of its features.
>  #include <getopt.h>
>  
>  int
> -main(int argc, char **argv)
> +main(int argc, char *argv[])
>  {
>      int c;
>      int digit_optind = 0;
> diff --git a/man3/getsubopt.3 b/man3/getsubopt.3
> index 99d112e63..2649984bb 100644
> --- a/man3/getsubopt.3
> +++ b/man3/getsubopt.3
> @@ -160,7 +160,7 @@ The following program expects suboptions following a "\-o" option.
>  #include <stdio.h>
>  
>  int
> -main(int argc, char **argv)
> +main(int argc, char *argv[])
>  {
>      enum {
>          RO_OPT = 0,
> diff --git a/man3/pthread_setname_np.3 b/man3/pthread_setname_np.3
> index a1fb3fa21..77c18a3cf 100644
> --- a/man3/pthread_setname_np.3
> +++ b/man3/pthread_setname_np.3
> @@ -180,7 +180,7 @@ threadfunc(void *parm)
>  }
>  
>  int
> -main(int argc, char **argv)
> +main(int argc, char *argv[])
>  {
>      pthread_t thread;
>      int rc;
> diff --git a/man3/wordexp.3 b/man3/wordexp.3
> index c583d559e..0aef4cc68 100644
> --- a/man3/wordexp.3
> +++ b/man3/wordexp.3
> @@ -240,7 +240,7 @@ is approximately that of "ls [a-c]*.c".
>  #include <wordexp.h>
>  
>  int
> -main(int argc, char **argv)
> +main(int argc, char *argv[])
>  {
>      wordexp_t p;
>      char **w;
> diff --git a/man7/fanotify.7 b/man7/fanotify.7
> index 6a7e70d75..9c218fd06 100644
> --- a/man7/fanotify.7
> +++ b/man7/fanotify.7
> @@ -1069,7 +1069,7 @@ $ \fBmkdir \-p /home/user/testdir\fP          # In another terminal
>  #define BUF_SIZE 256
>  
>  int
> -main(int argc, char **argv)
> +main(int argc, char *argv[])
>  {
>      int fd, ret, event_fd, mount_fd;
>      ssize_t len, path_len;
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH 09/32] path_resolution.7: tfix
  2021-07-28 20:19 ` [PATCH 09/32] path_resolution.7: tfix Alejandro Colomar
@ 2021-08-07 21:37   ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 92+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-08-07 21:37 UTC (permalink / raw)
  To: Alejandro Colomar
  Cc: mtk.manpages, Štěpán Němec, linux-man

Hello Alex, Štěpán,

On 7/28/21 10:19 PM, Alejandro Colomar wrote:
> From: Štěpán Němec <stepnem@gmail.com>
> 
> Signed-off-by: Štěpán Němec <stepnem@gmail.com>
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>

Thanks. Patch applied.

Cheers,

Michael


> ---
>  man7/path_resolution.7 | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/man7/path_resolution.7 b/man7/path_resolution.7
> index 0901ed7c8..f24837ef9 100644
> --- a/man7/path_resolution.7
> +++ b/man7/path_resolution.7
> @@ -63,7 +63,7 @@ argument).
>  The current working directory is inherited from the parent, and can
>  be changed by use of the
>  .BR chdir (2)
> -system call.)
> +system call.
>  .PP
>  Pathnames starting with a \(aq/\(aq character are called absolute pathnames.
>  Pathnames not starting with a \(aq/\(aq are called relative pathnames.
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH 10/32] futex.2: Document FUTEX_LOCK_PI2
  2021-07-29 10:18   ` Alejandro Colomar (man-pages)
@ 2021-08-07 21:38     ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 92+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-08-07 21:38 UTC (permalink / raw)
  To: Alejandro Colomar (man-pages); +Cc: mtk.manpages, Kurt Kanzenbach, linux-man

On 7/29/21 12:18 PM, Alejandro Colomar (man-pages) wrote:
> Hi Michael,
> 
> On 7/28/21 10:19 PM, Alejandro Colomar wrote:
>> From: Kurt Kanzenbach <kurt@linutronix.de>
>>
>> FUTEX_LOCK_PI2 is a new futex operation which was recently introduced into the
>> Linux kernel. It works exactly like FUTEX_LOCK_PI. However, it has support for
>> selectable clocks for timeouts. By default CLOCK_MONOTONIC is used. If
>> FUTEX_CLOCK_REALTIME is specified then the timeout is measured against
>> CLOCK_REALTIME.
>>
>> This new operation addresses an inconsistency in the futex interface:
>> FUTEX_LOCK_PI only works with timeouts based on CLOCK_REALTIME in contrast to
>> all the other PI operations.
>>
>> Document the FUTEX_LOCK_PI2 command.
>>
>> Signed-off-by: Kurt Kanzenbach <kurt@linutronix.de>
> 
> Please drop this one.  I just found a small typo, and will add a 
> Reviewed-by line received today.
Dropped.

-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH 11/32] futex.2: Minor tweaks to Kurt's patch
  2021-07-29 10:24   ` Alejandro Colomar (man-pages)
@ 2021-08-07 21:38     ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 92+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-08-07 21:38 UTC (permalink / raw)
  To: Alejandro Colomar (man-pages); +Cc: mtk.manpages, linux-man

On 7/29/21 12:24 PM, Alejandro Colomar (man-pages) wrote:
> On 7/28/21 10:19 PM, Alejandro Colomar wrote:
>> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
> 
> Drop this one too.

Dropped.

Thanks,

Michael

> 
>> ---
>>   man2/futex.2 | 69 ++++++++++++++++++++++++++--------------------------
>>   1 file changed, 34 insertions(+), 35 deletions(-)
>>
>> diff --git a/man2/futex.2 b/man2/futex.2
>> index 2f340e0e0..217b76734 100644
>> --- a/man2/futex.2
>> +++ b/man2/futex.2
>> @@ -222,9 +222,9 @@ This allows the kernel to make some additional performance optimizations.
>>   .\" taking reference counts on file backing store, and so on.
>>   .IP
>>   As a convenience,
>> -.IR <linux/futex.h>
>> +.I <linux/futex.h>
>>   defines a set of constants with the suffix
>> -.BR _PRIVATE
>> +.B _PRIVATE
>>   that are equivalents of all of the operations listed below,
>>   .\" except the obsolete FUTEX_FD, for which the "private" flag was
>>   .\" meaningless
>> @@ -247,19 +247,19 @@ This option bit can be employed only with the
>>   and
>>   (since Linux v5.14.0)
>>   .\" commit bf22a6976897977b0a3f1aeba6823c959fc4fdae
>> -.BR FUTEX_LOCK_PI2
>> +.B FUTEX_LOCK_PI2
>>   operations.
>>   .IP
>>   If this option is set, the kernel measures the
>>   .I timeout
>>   against the
>> -.BR CLOCK_REALTIME
>> +.B CLOCK_REALTIME
>>   clock.
>>   .IP
>>   If this option is not set, the kernel measures the
>>   .I timeout
>>   against the
>> -.BR CLOCK_MONOTONIC
>> +.B CLOCK_MONOTONIC
>>   clock.
>>   .PP
>>   The operation specified in
>> @@ -968,9 +968,8 @@ PI futexes are operated on by specifying one of the values listed below in
>>   Note that the PI futex operations must be used as paired operations
>>   and are subject to some additional requirements:
>>   .IP * 3
>> -.B FUTEX_LOCK_PI
>> -,
>> -.B FUTEX_LOCK_PI2
>> +.BR FUTEX_LOCK_PI ,
>> +.BR FUTEX_LOCK_PI2 ,
>>   and
>>   .B FUTEX_TRYLOCK_PI
>>   pair with
>> @@ -1123,7 +1122,7 @@ The
>>   .IR uaddr2 ,
>>   .IR val ,
>>   and
>> -.IR val3
>> +.I val3
>>   arguments are ignored.
>>   .\"
>>   .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
>> @@ -1135,7 +1134,7 @@ This operation works similar like
>>   .BR FUTEX_LOCK_PI .
>>   The only difference is the
>>   timeout argument.
>> -.BR FUTEX_LOCK_PI2
>> +.B FUTEX_LOCK_PI2
>>   has support for selectable clocks.
>>   .IP
>>   If
>> @@ -1466,7 +1465,7 @@ The value pointed to by
>>   is not equal to the expected value
>>   .IR val3 .
>>   .TP
>> -.BR EAGAIN
>> +.B EAGAIN
>>   .RB ( FUTEX_LOCK_PI ,
>>   .BR FUTEX_LOCK_PI2 ,
>>   .BR FUTEX_TRYLOCK_PI ,
>> @@ -1480,7 +1479,7 @@ is about to exit,
>>   but has not yet handled the internal state cleanup.
>>   Try again.
>>   .TP
>> -.BR EDEADLK
>> +.B EDEADLK
>>   .RB ( FUTEX_LOCK_PI ,
>>   .BR FUTEX_LOCK_PI2 ,
>>   .BR FUTEX_TRYLOCK_PI ,
>> @@ -1522,18 +1521,18 @@ a spurious wakeup; since Linux 2.6.22, this no longer happens.
>>   .TP
>>   .B EINVAL
>>   The operation in
>> -.IR futex_op
>> +.I futex_op
>>   is one of those that employs a timeout, but the supplied
>>   .I timeout
>>   argument was invalid
>>   .RI ( tv_sec
>>   was less than zero, or
>> -.IR tv_nsec
>> +.I tv_nsec
>>   was not less than 1,000,000,000).
>>   .TP
>>   .B EINVAL
>>   The operation specified in
>> -.IR futex_op
>> +.I futex_op
>>   employs one or both of the pointers
>>   .I uaddr
>>   and
>> @@ -1545,17 +1544,17 @@ the address is not four-byte-aligned.
>>   .RB ( FUTEX_WAIT_BITSET ,
>>   .BR FUTEX_WAKE_BITSET )
>>   The bit mask supplied in
>> -.IR val3
>> +.I val3
>>   is zero.
>>   .TP
>>   .B EINVAL
>>   .RB ( FUTEX_CMP_REQUEUE_PI )
>>   .I uaddr
>>   equals
>> -.IR uaddr2
>> +.I uaddr2
>>   (i.e., an attempt was made to requeue to the same futex).
>>   .TP
>> -.BR EINVAL
>> +.B EINVAL
>>   .RB ( FUTEX_FD )
>>   The signal number supplied in
>>   .I val
>> @@ -1570,9 +1569,9 @@ is invalid.
>>   The kernel detected an inconsistency between the user-space state at
>>   .I uaddr
>>   and the kernel state\(emthat is, it detected a waiter which waits in
>> -.BR FUTEX_LOCK_PI
>> +.B FUTEX_LOCK_PI
>>   or
>> -.BR FUTEX_LOCK_PI2
>> +.B FUTEX_LOCK_PI2
>>   on
>>   .IR uaddr .
>>   .TP
>> @@ -1588,7 +1587,7 @@ This indicates either state corruption
>>   or that the kernel found a waiter on
>>   .I uaddr
>>   which is waiting via
>> -.BR FUTEX_WAIT
>> +.B FUTEX_WAIT
>>   or
>>   .BR FUTEX_WAIT_BITSET .
>>   .TP
>> @@ -1601,9 +1600,9 @@ and the kernel state;
>>   .\"	The kernel sees: I have non PI state for a futex you tried to
>>   .\"     tell me was PI
>>   that is, the kernel detected a waiter which waits via
>> -.BR FUTEX_WAIT
>> +.B FUTEX_WAIT
>>   or
>> -.BR FUTEX_WAIT_BITSET
>> +.B FUTEX_WAIT_BITSET
>>   on
>>   .IR uaddr2 .
>>   .TP
>> @@ -1613,9 +1612,9 @@ The kernel detected an inconsistency between the user-space state at
>>   .I uaddr
>>   and the kernel state;
>>   that is, the kernel detected a waiter which waits via
>> -.BR FUTEX_WAIT
>> +.B FUTEX_WAIT
>>   or
>> -.BR FUTEX_WAIT_BITSET
>> +.B FUTEX_WAIT_BITSET
>>   on
>>   .IR uaddr .
>>   .TP
>> @@ -1627,9 +1626,9 @@ and the kernel state;
>>   that is, the kernel detected a waiter which waits on
>>   .I uaddr
>>   via
>> -.BR FUTEX_LOCK_PI
>> +.B FUTEX_LOCK_PI
>>   or
>> -.BR FUTEX_LOCK_PI2
>> +.B FUTEX_LOCK_PI2
>>   (instead of
>>   .BR FUTEX_WAIT_REQUEUE_PI ).
>>   .TP
>> @@ -1656,7 +1655,7 @@ Invalid argument.
>>   .RB ( FUTEX_FD )
>>   The system-wide limit on the total number of open files has been reached.
>>   .TP
>> -.BR ENOMEM
>> +.B ENOMEM
>>   .RB ( FUTEX_LOCK_PI ,
>>   .BR FUTEX_LOCK_PI2 ,
>>   .BR FUTEX_TRYLOCK_PI ,
>> @@ -1669,7 +1668,7 @@ Invalid operation specified in
>>   .TP
>>   .B ENOSYS
>>   The
>> -.BR FUTEX_CLOCK_REALTIME
>> +.B FUTEX_CLOCK_REALTIME
>>   option was specified in
>>   .IR futex_op ,
>>   but the accompanying operation was neither
>> @@ -1679,7 +1678,7 @@ but the accompanying operation was neither
>>   nor
>>   .BR FUTEX_LOCK_PI2 .
>>   .TP
>> -.BR ENOSYS
>> +.B ENOSYS
>>   .RB ( FUTEX_LOCK_PI ,
>>   .BR FUTEX_LOCK_PI2 ,
>>   .BR FUTEX_TRYLOCK_PI ,
>> @@ -1690,7 +1689,7 @@ A run-time check determined that the operation is not available.
>>   The PI-futex operations are not implemented on all architectures and
>>   are not supported on some CPU variants.
>>   .TP
>> -.BR EPERM
>> +.B EPERM
>>   .RB ( FUTEX_LOCK_PI ,
>>   .BR FUTEX_LOCK_PI2 ,
>>   .BR FUTEX_TRYLOCK_PI ,
>> @@ -1703,11 +1702,11 @@ the futex at
>>   .IR uaddr2 ).
>>   (This may be caused by a state corruption in user space.)
>>   .TP
>> -.BR EPERM
>> +.B EPERM
>>   .RB ( FUTEX_UNLOCK_PI )
>>   The caller does not own the lock represented by the futex word.
>>   .TP
>> -.BR ESRCH
>> +.B ESRCH
>>   .RB ( FUTEX_LOCK_PI ,
>>   .BR FUTEX_LOCK_PI2 ,
>>   .BR FUTEX_TRYLOCK_PI ,
>> @@ -1716,7 +1715,7 @@ The thread ID in the futex word at
>>   .I uaddr
>>   does not exist.
>>   .TP
>> -.BR ESRCH
>> +.B ESRCH
>>   .RB ( FUTEX_CMP_REQUEUE_PI )
>>   The thread ID in the futex word at
>>   .I uaddr2
>> @@ -1724,7 +1723,7 @@ does not exist.
>>   .TP
>>   .B ETIMEDOUT
>>   The operation in
>> -.IR futex_op
>> +.I futex_op
>>   employed the timeout specified in
>>   .IR timeout ,
>>   and the timeout expired before the operation completed.
>>
> 
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH 12/32] capabilities.7: tfix
  2021-07-28 20:19 ` [PATCH 12/32] capabilities.7: tfix Alejandro Colomar
@ 2021-08-07 21:39   ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 92+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-08-07 21:39 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, Kir Kolyshkin, linux-man

Hello Alex, Kir,

On 7/28/21 10:19 PM, Alejandro Colomar wrote:
> From: Kir Kolyshkin <kolyshkin@gmail.com>
> 
> Add a missing comma.
>
> Fixes: 3dcdef9437fafb
> Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>

Applied. Thanks!

Cheers,

Michael

> ---
>  man7/capabilities.7 | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/man7/capabilities.7 b/man7/capabilities.7
> index cf9dc190f..9f8f0087f 100644
> --- a/man7/capabilities.7
> +++ b/man7/capabilities.7
> @@ -215,7 +215,7 @@ Lock memory
>  .BR shmctl (2));
>  .IP *
>  Allocate memory using huge pages
> -.RB ( memfd_create (2)
> +.RB ( memfd_create (2),
>  .BR mmap (2),
>  .BR shmctl (2)).
>  .PD 0
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH 13/32] user_namespaces.7: fix a ref
  2021-07-28 20:19 ` [PATCH 13/32] user_namespaces.7: fix a ref Alejandro Colomar
@ 2021-08-07 21:40   ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 92+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-08-07 21:40 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, Kir Kolyshkin, linux-man

Hello Kir, Alex,

On 7/28/21 10:19 PM, Alejandro Colomar wrote:
> From: Kir Kolyshkin <kolyshkin@gmail.com>
> 
> The file being referred to no longer exists, as it was moved to
> *.rst first (commit 20a78ae9ed297f2) and then to under
> admin-guide (commit bf6b7a742e3f82b). Both those commits
> are from 2019 (Linux 5.3).
> 
> Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>

Applied.

Thanks,

Michael

> ---
>  man7/user_namespaces.7 | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/man7/user_namespaces.7 b/man7/user_namespaces.7
> index f2e02c978..518e7a3bb 100644
> --- a/man7/user_namespaces.7
> +++ b/man7/user_namespaces.7
> @@ -1383,4 +1383,4 @@ main(int argc, char *argv[])
>  .BR pid_namespaces (7)
>  .PP
>  The kernel source file
> -.IR Documentation/namespaces/resource\-control.txt .
> +.IR Documentation/admin\-guide/namespaces/resource\-control.rst .
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH 18/32] recv.2: tfix
  2021-07-28 20:19 ` [PATCH 18/32] recv.2: tfix Alejandro Colomar
@ 2021-08-07 21:43   ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 92+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-08-07 21:43 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, kXuan, linux-man

Hello Alex, kXuan,

On 7/28/21 10:19 PM, Alejandro Colomar wrote:
> From: kXuan <kxuanobj@gmail.com>
> 
> The recv.2 misspelled `SO_EE_OFFENDER` to `SOCK_EE_OFFENDER`.
> 
> This patch fix this typo.
> 
> Signed-off-by: kXuan <kxuanobj@gmail.com>
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>

Thanks. Patch applied.

Cheers,

Michael

> ---
>  man2/recv.2 | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/man2/recv.2 b/man2/recv.2
> index 2659957a6..884c86355 100644
> --- a/man2/recv.2
> +++ b/man2/recv.2
> @@ -196,7 +196,7 @@ number of the queued error.
>  is the origin code of where the error originated.
>  The other fields are protocol-specific.
>  The macro
> -.B SOCK_EE_OFFENDER
> +.B SO_EE_OFFENDER
>  returns a pointer to the address of the network object
>  where the error originated from given a pointer to the ancillary message.
>  If this address is not known, the
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH 07/32] printf.3: wfix
  2021-08-07 21:34   ` Michael Kerrisk (man-pages)
@ 2021-08-07 22:20     ` Alejandro Colomar (man-pages)
  2021-08-07 22:32       ` Alejandro Colomar (man-pages)
  0 siblings, 1 reply; 92+ messages in thread
From: Alejandro Colomar (man-pages) @ 2021-08-07 22:20 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages); +Cc: linux-man, Sergey Petrakov

Hi Michael,


On 8/7/21 11:34 PM, Michael Kerrisk (man-pages) wrote:
> Hello Alex and Sergey,
> 
> On 7/28/21 10:19 PM, Alejandro Colomar wrote:
>> Reported-by: Sergey Petrakov <kr@spmail.info>
>> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
>> ---
>>  man3/printf.3 | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/man3/printf.3 b/man3/printf.3
>> index fcc3bd6f3..1074626e1 100644
>> --- a/man3/printf.3
>> +++ b/man3/printf.3
>> @@ -115,7 +115,7 @@ is the same as
>>  except that it outputs to a file descriptor,
>>  .IR fd ,
>>  instead of to a
>> -.I stdio
>> +.I FILE
>>  stream.
>>  .PP
>>  The functions
> 
> Why this change? What is wrong with the existing text?

I seem to remember that my thoughts when I saw the report were:

stdio is marked in italics, which usually would mean a type (by the
context), but it's not a type, so probably the author meant FILE and
wrote stdio as a typo.  But it could also be that the author meant '.BR
stdio (7)', and it's only a ffix.

What do you think?

Thanks,

Alex

-- 
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH 07/32] printf.3: wfix
  2021-08-07 22:20     ` Alejandro Colomar (man-pages)
@ 2021-08-07 22:32       ` Alejandro Colomar (man-pages)
  2021-08-07 23:10         ` Michael Kerrisk (man-pages)
  0 siblings, 1 reply; 92+ messages in thread
From: Alejandro Colomar (man-pages) @ 2021-08-07 22:32 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages); +Cc: linux-man, Sergey Petrakov



On 8/8/21 12:20 AM, Alejandro Colomar (man-pages) wrote:
> stdio (7)', and it's only a ffix.

s/7/3/

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH 19/32] ascii.7: add vertical rule to separate the two columns
  2021-07-28 20:19 ` [PATCH 19/32] ascii.7: add vertical rule to separate the two columns Alejandro Colomar
@ 2021-08-07 22:46   ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 92+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-08-07 22:46 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, наб, linux-man

Hello наб and Alex,

On 7/28/21 10:19 PM, Alejandro Colomar wrote:
> From: наб <nabijaczleweli@nabijaczleweli.xyz>
> 
> I regularly get mildly lost in this table (and, indeed, didn't realise
> it had two columns the first few times I used it to look at something
> from the left column) ‒ separating the two columns improves clarity,
> and makes which soup of numbers belongs to which character
> much more obvious
> 
> Other encodings don't need this as they don't use double-columnated
> tables
> 
> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>

Thanks. Patch applied.

Cheers,

Michael

> ---
>  man7/ascii.7 | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/man7/ascii.7 b/man7/ascii.7
> index f1c0c8d74..053b13809 100644
> --- a/man7/ascii.7
> +++ b/man7/ascii.7
> @@ -48,7 +48,7 @@ C program \f(CW\(aq\eX\(aq\fP escapes are noted.
>  .ft CW
>  \}
>  .TS
> -l l l l l l l l.
> +l l l l | l l l l.
>  Oct	Dec	Hex	Char	Oct	Dec	Hex	Char
>  _
>  000	0	00	NUL \(aq\e0\(aq (null character)	100	64	40	@
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH 23/32] scripts/bash_aliases: tfix
  2021-07-28 20:19 ` [PATCH 23/32] scripts/bash_aliases: tfix Alejandro Colomar
@ 2021-08-07 22:47   ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 92+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-08-07 22:47 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, Jakub Wilk, linux-man

Hi Laex, Jakub,

On 7/28/21 10:19 PM, Alejandro Colomar wrote:
> From: Jakub Wilk <jwilk@jwilk.net>
> 
> Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>

Thanks. Patch applied.

Cheers,

Michael

> ---
>  scripts/bash_aliases | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/bash_aliases b/scripts/bash_aliases
> index 102c458d7..ecac0029d 100644
> --- a/scripts/bash_aliases
> +++ b/scripts/bash_aliases
> @@ -24,7 +24,7 @@ EX_USAGE=64;
>  #	C
>  
>  #  sed_rm_ccomments()  removes C comments.
> -# It can't handle multiple comments in a sinlge line correctly,
> +# It can't handle multiple comments in a single line correctly,
>  # nor mixed or embedded //... and /*...*/ comments.
>  # Use as a filter (see man_lsfunc() in this file).
>  
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH 26/32] tkill.2: tfix
  2021-07-28 20:20 ` [PATCH 26/32] tkill.2: tfix Alejandro Colomar
@ 2021-08-07 22:48   ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 92+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-08-07 22:48 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, Sagar Patel, linux-man

Hello Sagar and Alex,

On 7/28/21 10:20 PM, Alejandro Colomar wrote:
> From: Sagar Patel <sagarmp@cs.unc.edu>
> 
> Correct function signature by adding missing parenthesis.
> 
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>

Thanks. Patch applied.

Cheers,

Michael

> ---
>  man2/tkill.2 | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/man2/tkill.2 b/man2/tkill.2
> index 6ff930e17..6e1afcd36 100644
> --- a/man2/tkill.2
> +++ b/man2/tkill.2
> @@ -39,7 +39,7 @@ tkill, tgkill \- send a signal to a thread
>  .PP
>  .B #include <signal.h>
>  .PP
> -.BI "int tgkill, pid_t " tgid ", pid_t " tid ", int " sig );
> +.BI "int tgkill(pid_t " tgid ", pid_t " tid ", int " sig );
>  .fi
>  .PP
>  .IR Note :
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH 22/32] proc.5: tfix
  2021-07-28 20:19 ` [PATCH 22/32] proc.5: tfix Alejandro Colomar
@ 2021-08-07 22:55   ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 92+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-08-07 22:55 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, Jakub Wilk, linux-man

Hello Jakub and Alex,

On 7/28/21 10:19 PM, Alejandro Colomar wrote:
> From: Jakub Wilk <jwilk@jwilk.net>
> 
> Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>

Thanks. Patch applied.

Cheers,

Michael

> ---
>  man5/proc.5 | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/man5/proc.5 b/man5/proc.5
> index 69f6e15dd..416bbb5fc 100644
> --- a/man5/proc.5
> +++ b/man5/proc.5
> @@ -5606,7 +5606,7 @@ first.
>  .IR  /proc/sys/vm/sysctl_hugetlb_shm_group " (since Linux 2.6.7)"
>  This writable file contains a group ID that is allowed
>  to allocate memory using huge pages.
> -If a process has a filesystem group ID or any supplememtary group ID that
> +If a process has a filesystem group ID or any supplementary group ID that
>  matches this group ID,
>  then it can make huge-page allocations without holding the
>  .BR CAP_IPC_LOCK
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH 20/32] wait.2: Add ESRCH for when pid == INT_MIN
  2021-07-28 20:19 ` [PATCH 20/32] wait.2: Add ESRCH for when pid == INT_MIN Alejandro Colomar
@ 2021-08-07 23:05   ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 92+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-08-07 23:05 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, Richard Palethorpe, linux-man

Hello Richard and Alex,

On 7/28/21 10:19 PM, Alejandro Colomar wrote:
> From: Richard Palethorpe <rpalethorpe@suse.com>
> 
> Please see upstream commit:
> 
>  commit dd83c161fbcc5d8be637ab159c0de015cbff5ba4
>  Author: zhongjiang <zhongjiang@huawei.com>
>  Date:   Mon Jul 10 15:53:01 2017 -0700
> 
>      kernel/exit.c: avoid undefined behaviour when calling wait4()
> 
> It avoids negating INT_MIN by returning early with ESRCH.
> 
> Signed-off-by: Richard Palethorpe <rpalethorpe@suse.com>
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>> ---
>  man2/wait.2 | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/man2/wait.2 b/man2/wait.2
> index 5ae955b3f..63d872ee6 100644
> --- a/man2/wait.2
> +++ b/man2/wait.2
> @@ -455,6 +455,15 @@ was caught; see
>  The
>  .I options
>  argument was invalid.
> +.TP
> +.B ESRCH
> +(for
> +.BR wait ()
> +or
> +.BR waitpid ())
> +.I pid
> +is equal to
> +.I INT_MIN
>  .SH CONFORMING TO
>  SVr4, 4.3BSD, POSIX.1-2001.
>  .SH NOTES

Thanks. Patch applied, and added the follow-up patch below.

Thanks,

Michael



diff --git a/man2/wait.2 b/man2/wait.2
index 63d872ee6..b6cb326c0 100644
--- a/man2/wait.2
+++ b/man2/wait.2
@@ -463,7 +463,7 @@ or
 .BR waitpid ())
 .I pid
 is equal to
-.I INT_MIN
+.BR INT_MIN .
 .SH CONFORMING TO
 SVr4, 4.3BSD, POSIX.1-2001.
 .SH NOTES

-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply related	[flat|nested] 92+ messages in thread

* Re: [PATCH 07/32] printf.3: wfix
  2021-08-07 22:32       ` Alejandro Colomar (man-pages)
@ 2021-08-07 23:10         ` Michael Kerrisk (man-pages)
  2021-08-11 20:55           ` Sergey Petrakov
  0 siblings, 1 reply; 92+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-08-07 23:10 UTC (permalink / raw)
  To: Alejandro Colomar (man-pages); +Cc: mtk.manpages, linux-man, Sergey Petrakov

Hello Alex,

On 8/8/21 12:32 AM, Alejandro Colomar (man-pages) wrote:
> 
> 
> On 8/8/21 12:20 AM, Alejandro Colomar (man-pages) wrote:
>> stdio (7)', and it's only a ffix.
> 
> s/7/3/

I dropped the original patch, and made ir

.BR stdio (3)

This is a case where it would have been good to ask the 
proposer for a commit message explaining the motivation for
the original patch (when that patch was submitted).

Cheers,

Michael

-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH 30/32] strlen.3, wcslen.3: Add recommendations for safer variants
  2021-07-28 20:20 ` [PATCH 30/32] strlen.3, wcslen.3: Add recommendations for safer variants Alejandro Colomar
@ 2021-08-07 23:45   ` Michael Kerrisk (man-pages)
  2021-08-08  0:04     ` Alejandro Colomar (man-pages)
  2021-08-08  0:16     ` Alejandro Colomar (man-pages)
  0 siblings, 2 replies; 92+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-08-07 23:45 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, linux-man, Jonny Grant

Hello Alex,

I see there was a rather long mail thread that led
to this patch. The patch definitely deserves a commit
message.

See also below.
On 7/28/21 10:20 PM, Alejandro Colomar wrote:
> Reported-by: Jonny Grant <jg@jguk.org>
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
> ---
>  man3/strlen.3 | 6 ++++++
>  man3/wcslen.3 | 9 ++++++++-
>  2 files changed, 14 insertions(+), 1 deletion(-)
> 
> diff --git a/man3/strlen.3 b/man3/strlen.3
> index dea4c1050..78783c446 100644
> --- a/man3/strlen.3
> +++ b/man3/strlen.3
> @@ -66,6 +66,12 @@ T}	Thread safety	MT-Safe
>  .sp 1
>  .SH CONFORMING TO
>  POSIX.1-2001, POSIX.1-2008, C89, C99, C11, SVr4, 4.3BSD.
> +.SH NOTES
> +.SS strnlen(3)
> +If the input buffer size is known,
> +it is probably better to use
> +.BR strnlen (3),
> +which can prevent reading past the end of the array.

I hesitate slightly about this. strlen() is in the C standard, but
strnlen() is not. What do you think; do we need to care?


Thanks,

Michael

>  .SH SEE ALSO
>  .BR string (3),
>  .BR strnlen (3),
> diff --git a/man3/wcslen.3 b/man3/wcslen.3
> index af3fcb9ca..fe1d6331b 100644
> --- a/man3/wcslen.3
> +++ b/man3/wcslen.3
> @@ -58,5 +58,12 @@ T}	Thread safety	MT-Safe
>  .sp 1
>  .SH CONFORMING TO
>  POSIX.1-2001, POSIX.1-2008, C99.
> +.SH NOTES
> +.SS wcsnlen(3)
> +If the input buffer size is known,
> +it is probably better to use
> +.BR wcsnlen (3),
> +which can prevent reading past the end of the array.
>  .SH SEE ALSO
> -.BR strlen (3)
> +.BR strlen (3),
> +.BR wcsnlen (3)
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH 24/32] namespaces.7: fix confusion caused by text reorganization
  2021-07-28 20:20 ` [PATCH 24/32] namespaces.7: fix confusion caused by text reorganization Alejandro Colomar
@ 2021-08-07 23:48   ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 92+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-08-07 23:48 UTC (permalink / raw)
  To: Alejandro Colomar
  Cc: mtk.manpages, Štěpán Němec, linux-man

Hello Štěpán, Alex,

@Štěpán Thanks for spotting this!

On 7/28/21 10:20 PM, Alejandro Colomar wrote:
> From: Štěpán Němec <stepnem@gmail.com>
> 
> Since commit ee81d7e41852, the flags list has been (only) above, not
> below, these references.
> 
> (The flags table was added even before that, in commit
> 0b497138b908 ("namespaces.7: Add table of namespaces to top of page"))
> 
> Fixes: ee81d7e41852 ("namespaces.7: Include manual page references in the summary table of namespace types")
> Signed-off-by: Štěpán Němec <stepnem@gmail.com>
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>

Patch applied.

Cheers,

Michael

> ---
>  man7/namespaces.7 | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/man7/namespaces.7 b/man7/namespaces.7
> index d35c2d383..0ac32c77e 100644
> --- a/man7/namespaces.7
> +++ b/man7/namespaces.7
> @@ -97,7 +97,7 @@ If the
>  .I flags
>  argument of the call specifies one or more of the
>  .B CLONE_NEW*
> -flags listed below, then new namespaces are created for each flag,
> +flags listed above, then new namespaces are created for each flag,
>  and the child process is made a member of those namespaces.
>  (This system call also implements a number of features
>  unrelated to namespaces.)
> @@ -119,7 +119,7 @@ If the
>  .I flags
>  argument of the call specifies one or more of the
>  .B CLONE_NEW*
> -flags listed below, then new namespaces are created for each flag,
> +flags listed above, then new namespaces are created for each flag,
>  and the calling process is made a member of those namespaces.
>  (This system call also implements a number of features
>  unrelated to namespaces.)
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH 27/32] strstr.3: Add special case for empty needle
  2021-07-28 20:20 ` [PATCH 27/32] strstr.3: Add special case for empty needle Alejandro Colomar
@ 2021-08-07 23:53   ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 92+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-08-07 23:53 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, linux-man, Stefan Kanthak

Hello Stefan and Alex,

On 7/28/21 10:20 PM, Alejandro Colomar wrote:
> Reported-by: Stefan Kanthak <stefan.kanthak@nexgo.de>
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>

Thanks. Patch applied.

Cheers,

Michael

> ---
>  man3/strstr.3 | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/man3/strstr.3 b/man3/strstr.3
> index e085409c2..41ee87489 100644
> --- a/man3/strstr.3
> +++ b/man3/strstr.3
> @@ -61,6 +61,14 @@ but ignores the case of both arguments.
>  .SH RETURN VALUE
>  These functions return a pointer to the beginning of the
>  located substring, or NULL if the substring is not found.
> +.PP
> +Note the special case:
> +If
> +.I needle
> +is the empty string,
> +the return value is always
> +.I haystack
> +itself.
>  .SH ATTRIBUTES
>  For an explanation of the terms used in this section, see
>  .BR attributes (7).
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH 31/32] time.2: wfix regarding year-2038
  2021-07-30  1:25     ` Viet Than
@ 2021-08-07 23:59       ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 92+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-08-07 23:59 UTC (permalink / raw)
  To: Viet Than, G. Branden Robinson; +Cc: mtk.manpages, linux-man, Alejandro Colomar

On 7/30/21 3:25 AM, Viet Than wrote:
>> "[R]eaches at" is not standard English.  More idiomatic would be
>> "reaches or exceeds".
> 
> Thanks Branden. Searching around on Google, you're right. Usage of
> "reaches at or beyond" is way less (1,240 results on Google) than
> "reaches or exceeds" (376,000 results). I've modified the patch
> accordingly.
> 
> Signed-off-by: Viet Than <thanhoangviet@gmail.com>

Thanks, Viet Than. Patch Applied.

Cheers,

Michael

> 
> ---
> man2/time.2 | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/man2/time.2 b/man2/time.2
> index 059222dcd..ab3d3ecba 100644
> --- a/man2/time.2
> +++ b/man2/time.2
> @@ -93,7 +93,7 @@ specified as NULL cannot fail with the error
> .BR EOVERFLOW ,
> even on ABIs where
> .I time_t
> -is a signed 32-bit integer and the clock ticks past the time 2**31
> +is a signed 32-bit integer and the clock reaches or exceeds 2**31 seconds
> (2038-01-19 03:14:08 UTC, ignoring leap seconds).
> (POSIX.1 permits, but does not require, the
> .B EOVERFLOW
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH 30/32] strlen.3, wcslen.3: Add recommendations for safer variants
  2021-08-07 23:45   ` Michael Kerrisk (man-pages)
@ 2021-08-08  0:04     ` Alejandro Colomar (man-pages)
  2021-08-08  0:16     ` Alejandro Colomar (man-pages)
  1 sibling, 0 replies; 92+ messages in thread
From: Alejandro Colomar (man-pages) @ 2021-08-08  0:04 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages); +Cc: linux-man, Jonny Grant

Hi, Michael!

On 8/8/21 1:45 AM, Michael Kerrisk (man-pages) wrote:
> Hello Alex,
> 
> I see there was a rather long mail thread that led
> to this patch. The patch definitely deserves a commit
> message.

Maybe this:

[
strlen() is normally used as a first step
in a series involving usage of strings.

However, if the input string can possibly not include a terminating null
byte '\0', it's safer to use strnlen().

Since there's not much overhead,
and the compiler might already optimize some cases
where it knows it can use strlen(),
it's probably wise to recommend strnlen() over strlen(),
and be on the safe side, to avoid bugs.

Code coud even be safe in the present,
but in the future start using non-terminated strings
and then introduce a bug, if strlen() is used.
]


> 
> See also below.
> On 7/28/21 10:20 PM, Alejandro Colomar wrote:
>> Reported-by: Jonny Grant <jg@jguk.org>
>> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
>> ---
>>  man3/strlen.3 | 6 ++++++
>>  man3/wcslen.3 | 9 ++++++++-
>>  2 files changed, 14 insertions(+), 1 deletion(-)
>>
>> diff --git a/man3/strlen.3 b/man3/strlen.3
>> index dea4c1050..78783c446 100644
>> --- a/man3/strlen.3
>> +++ b/man3/strlen.3
>> @@ -66,6 +66,12 @@ T}	Thread safety	MT-Safe
>>  .sp 1
>>  .SH CONFORMING TO
>>  POSIX.1-2001, POSIX.1-2008, C89, C99, C11, SVr4, 4.3BSD.
>> +.SH NOTES
>> +.SS strnlen(3)
>> +If the input buffer size is known,
>> +it is probably better to use
>> +.BR strnlen (3),
>> +which can prevent reading past the end of the array.
> 
> I hesitate slightly about this. strlen() is in the C standard, but
> strnlen() is not. What do you think; do we need to care?

I think POSIX.1-2008 is enough of a standard.  Don't you?


Cheers,

Alex
> 
>>  .SH SEE ALSO
>>  .BR string (3),
>>  .BR strnlen (3),
>> diff --git a/man3/wcslen.3 b/man3/wcslen.3
>> index af3fcb9ca..fe1d6331b 100644
>> --- a/man3/wcslen.3
>> +++ b/man3/wcslen.3
>> @@ -58,5 +58,12 @@ T}	Thread safety	MT-Safe
>>  .sp 1
>>  .SH CONFORMING TO
>>  POSIX.1-2001, POSIX.1-2008, C99.
>> +.SH NOTES
>> +.SS wcsnlen(3)
>> +If the input buffer size is known,
>> +it is probably better to use
>> +.BR wcsnlen (3),
>> +which can prevent reading past the end of the array.
>>  .SH SEE ALSO
>> -.BR strlen (3)
>> +.BR strlen (3),
>> +.BR wcsnlen (3)
>>
> 
> 

-- 
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH 30/32] strlen.3, wcslen.3: Add recommendations for safer variants
  2021-08-07 23:45   ` Michael Kerrisk (man-pages)
  2021-08-08  0:04     ` Alejandro Colomar (man-pages)
@ 2021-08-08  0:16     ` Alejandro Colomar (man-pages)
  2021-08-08  1:20       ` Michael Kerrisk (man-pages)
  2021-08-08 19:44       ` Jonny Grant
  1 sibling, 2 replies; 92+ messages in thread
From: Alejandro Colomar (man-pages) @ 2021-08-08  0:16 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages); +Cc: linux-man, Jonny Grant

Hi, Michael!

On 8/8/21 1:45 AM, Michael Kerrisk (man-pages) wrote:
> Hello Alex,
> 
> I see there was a rather long mail thread that led
> to this patch. The patch definitely deserves a commit
> message.
> 
> See also below.
> On 7/28/21 10:20 PM, Alejandro Colomar wrote:
>> Reported-by: Jonny Grant <jg@jguk.org>
>> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
>> ---
>>  man3/strlen.3 | 6 ++++++
>>  man3/wcslen.3 | 9 ++++++++-
>>  2 files changed, 14 insertions(+), 1 deletion(-)
>>
>> diff --git a/man3/strlen.3 b/man3/strlen.3
>> index dea4c1050..78783c446 100644
>> --- a/man3/strlen.3
>> +++ b/man3/strlen.3
>> @@ -66,6 +66,12 @@ T}	Thread safety	MT-Safe
>>  .sp 1
>>  .SH CONFORMING TO
>>  POSIX.1-2001, POSIX.1-2008, C89, C99, C11, SVr4, 4.3BSD.
>> +.SH NOTES
>> +.SS strnlen(3)
>> +If the input buffer size is known,
>> +it is probably better to use
>> +.BR strnlen (3),
>> +which can prevent reading past the end of the array.
> 
> I hesitate slightly about this. strlen() is in the C standard, but
> strnlen() is not. What do you think; do we need to care?

I have some doubts about this patch, but in a completely different sense:

I don't know if I'm being a bit paranoid in treating user input.  I've
always been taught that I should program deffensively, but as time
passes by, I realize myself that I was programming too much
deffensively, and even introducing bugs in the error handling code.  And
in many cases, strings will always be NUL-terminated, so maybe I'm just
passing around a wrong recommendation.

What do you think about this?

Thanks,

Alex


Related: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1967.htm
(about the deprecation of Annex K from the C Standard)


> 
> 
> Thanks,
> 
> Michael
> 
>>  .SH SEE ALSO
>>  .BR string (3),
>>  .BR strnlen (3),
>> diff --git a/man3/wcslen.3 b/man3/wcslen.3
>> index af3fcb9ca..fe1d6331b 100644
>> --- a/man3/wcslen.3
>> +++ b/man3/wcslen.3
>> @@ -58,5 +58,12 @@ T}	Thread safety	MT-Safe
>>  .sp 1
>>  .SH CONFORMING TO
>>  POSIX.1-2001, POSIX.1-2008, C99.
>> +.SH NOTES
>> +.SS wcsnlen(3)
>> +If the input buffer size is known,
>> +it is probably better to use
>> +.BR wcsnlen (3),
>> +which can prevent reading past the end of the array.
>>  .SH SEE ALSO
>> -.BR strlen (3)
>> +.BR strlen (3),
>> +.BR wcsnlen (3)
>>
> 
> 

-- 
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH 03/32] vdso.7: Remove outdated limitation for powerpc
  2021-07-28 20:19 ` [PATCH 03/32] vdso.7: Remove outdated limitation for powerpc Alejandro Colomar
@ 2021-08-08  0:17   ` Michael Kerrisk (man-pages)
  2021-08-08  0:21     ` Alejandro Colomar (man-pages)
  0 siblings, 1 reply; 92+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-08-08  0:17 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, linux-man, Christophe Leroy

Hello Alex,

On 7/28/21 10:19 PM, Alejandro Colomar wrote:
> Christophe Leroy via Bugzilla:

For the commit message, it would be good to have a URL for 
the bug. (I could not find the bug.)

> [
> https://man7.org/linux/man-pages/man7/vdso.7.html
> (as of today, flagged 2021-03-22)
> 
> ppc/32 and ppc/64 sections both have the following note:
> 
>        The CLOCK_REALTIME_COARSE and CLOCK_MONOTONIC_COARSE clocks
>        are not supported by the __kernel_clock_getres and
>        __kernel_clock_gettime interfaces; the kernel falls back to
>        the real system call
> 
> This note has been wrong from quite some time now,
> since commit 654abc69ef2e
> ("powerpc/vdso32: Add support for CLOCK_{REALTIME/MONOTONIC}_COARSE")
> and commit 5c929885f1bb
> ("powerpc/vdso64: Add support for CLOCK_{REALTIME/MONOTONIC}_COARSE")
> ]
> 
> Reported-by: Christophe Leroy <christophe.leroy@csgroup.eu>
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>

In cases such as this, I prefer not to drop the historical info.
See below.

> ---
>  man7/vdso.7 | 26 --------------------------
>  1 file changed, 26 deletions(-)
> 
> diff --git a/man7/vdso.7 b/man7/vdso.7
> index ef6bef5bd..1d527c38e 100644
> --- a/man7/vdso.7
> +++ b/man7/vdso.7
> @@ -385,19 +385,6 @@ __kernel_sync_dicache_p5	LINUX_2.6.15
>  .in
>  .ft P
>  \}
> -.PP
> -The
> -.B CLOCK_REALTIME_COARSE
> -and
> -.B CLOCK_MONOTONIC_COARSE
> -clocks are
> -.I not
> -supported by the
> -.I __kernel_clock_getres
> -and
> -.I __kernel_clock_gettime
> -interfaces;
> -the kernel falls back to the real system call.
>  .SS ppc/64 functions
>  .\" See linux/arch/powerpc/kernel/vdso64/vdso64.lds.S
>  The table below lists the symbols exported by the vDSO.
> @@ -423,19 +410,6 @@ __kernel_sync_dicache_p5	LINUX_2.6.15
>  .in
>  .ft P
>  \}
> -.PP
> -The
> -.B CLOCK_REALTIME_COARSE
> -and
> -.B CLOCK_MONOTONIC_COARSE
> -clocks are
> -.I not
> -supported by the
> -.I __kernel_clock_getres
> -and
> -.I __kernel_clock_gettime
> -interfaces;
> -the kernel falls back to the real system call.
>  .SS riscv functions
>  .\" See linux/arch/riscv/kernel/vdso/vdso.lds.S
>  The table below lists the symbols exported by the vDSO.

I instead applied the patch below.

Cheers,

Michael


diff --git a/man7/vdso.7 b/man7/vdso.7
index ef6bef5bd..39d6dc4ad 100644
--- a/man7/vdso.7
+++ b/man7/vdso.7
@@ -386,7 +386,9 @@ __kernel_sync_dicache_p5    LINUX_2.6.15
 .ft P
 \}
 .PP
-The
+In kernel versions before Linux 5.6,
+.\" commit 654abc69ef2e69712e6d4e8a6cb9292b97a4aa39
+the
 .B CLOCK_REALTIME_COARSE
 and
 .B CLOCK_MONOTONIC_COARSE
@@ -424,7 +426,9 @@ __kernel_sync_dicache_p5    LINUX_2.6.15
 .ft P
 \}
 .PP
-The
+In kernel versions before Linux 4.16,
+.\" commit 5c929885f1bb4b77f85b1769c49405a0e0f154a1
+the
 .B CLOCK_REALTIME_COARSE
 and
 .B CLOCK_MONOTONIC_COARSE



-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply related	[flat|nested] 92+ messages in thread

* Re: [PATCH 03/32] vdso.7: Remove outdated limitation for powerpc
  2021-08-08  0:17   ` Michael Kerrisk (man-pages)
@ 2021-08-08  0:21     ` Alejandro Colomar (man-pages)
  0 siblings, 0 replies; 92+ messages in thread
From: Alejandro Colomar (man-pages) @ 2021-08-08  0:21 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages); +Cc: linux-man, Christophe Leroy

Hello Michael,

On 8/8/21 2:17 AM, Michael Kerrisk (man-pages) wrote:
> Hello Alex,
> 
> On 7/28/21 10:19 PM, Alejandro Colomar wrote:
>> Christophe Leroy via Bugzilla:
> 
> For the commit message, it would be good to have a URL for 
> the bug. (I could not find the bug.)

That's right.  <https://bugzilla.kernel.org/show_bug.cgi?id=213419>

> 
>> [
>> https://man7.org/linux/man-pages/man7/vdso.7.html
>> (as of today, flagged 2021-03-22)
>>
>> ppc/32 and ppc/64 sections both have the following note:
>>
>>        The CLOCK_REALTIME_COARSE and CLOCK_MONOTONIC_COARSE clocks
>>        are not supported by the __kernel_clock_getres and
>>        __kernel_clock_gettime interfaces; the kernel falls back to
>>        the real system call
>>
>> This note has been wrong from quite some time now,
>> since commit 654abc69ef2e
>> ("powerpc/vdso32: Add support for CLOCK_{REALTIME/MONOTONIC}_COARSE")
>> and commit 5c929885f1bb
>> ("powerpc/vdso64: Add support for CLOCK_{REALTIME/MONOTONIC}_COARSE")
>> ]
>>
>> Reported-by: Christophe Leroy <christophe.leroy@csgroup.eu>
>> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
> 
> In cases such as this, I prefer not to drop the historical info.
> See below.

And also right.

> 
>> ---
>>  man7/vdso.7 | 26 --------------------------
>>  1 file changed, 26 deletions(-)
>>
>> diff --git a/man7/vdso.7 b/man7/vdso.7
>> index ef6bef5bd..1d527c38e 100644
>> --- a/man7/vdso.7
>> +++ b/man7/vdso.7
>> @@ -385,19 +385,6 @@ __kernel_sync_dicache_p5	LINUX_2.6.15
>>  .in
>>  .ft P
>>  \}
>> -.PP
>> -The
>> -.B CLOCK_REALTIME_COARSE
>> -and
>> -.B CLOCK_MONOTONIC_COARSE
>> -clocks are
>> -.I not
>> -supported by the
>> -.I __kernel_clock_getres
>> -and
>> -.I __kernel_clock_gettime
>> -interfaces;
>> -the kernel falls back to the real system call.
>>  .SS ppc/64 functions
>>  .\" See linux/arch/powerpc/kernel/vdso64/vdso64.lds.S
>>  The table below lists the symbols exported by the vDSO.
>> @@ -423,19 +410,6 @@ __kernel_sync_dicache_p5	LINUX_2.6.15
>>  .in
>>  .ft P
>>  \}
>> -.PP
>> -The
>> -.B CLOCK_REALTIME_COARSE
>> -and
>> -.B CLOCK_MONOTONIC_COARSE
>> -clocks are
>> -.I not
>> -supported by the
>> -.I __kernel_clock_getres
>> -and
>> -.I __kernel_clock_gettime
>> -interfaces;
>> -the kernel falls back to the real system call.
>>  .SS riscv functions
>>  .\" See linux/arch/riscv/kernel/vdso/vdso.lds.S
>>  The table below lists the symbols exported by the vDSO.
> 
> I instead applied the patch below.
> 
> Cheers,
> 
> Michael
> 
> 
> diff --git a/man7/vdso.7 b/man7/vdso.7
> index ef6bef5bd..39d6dc4ad 100644
> --- a/man7/vdso.7
> +++ b/man7/vdso.7
> @@ -386,7 +386,9 @@ __kernel_sync_dicache_p5    LINUX_2.6.15
>  .ft P
>  \}
>  .PP
> -The
> +In kernel versions before Linux 5.6,
> +.\" commit 654abc69ef2e69712e6d4e8a6cb9292b97a4aa39
> +the
>  .B CLOCK_REALTIME_COARSE
>  and
>  .B CLOCK_MONOTONIC_COARSE
> @@ -424,7 +426,9 @@ __kernel_sync_dicache_p5    LINUX_2.6.15
>  .ft P
>  \}
>  .PP
> -The
> +In kernel versions before Linux 4.16,
> +.\" commit 5c929885f1bb4b77f85b1769c49405a0e0f154a1
> +the

Much better!

Thanks,

Alex

>  .B CLOCK_REALTIME_COARSE
>  and
>  .B CLOCK_MONOTONIC_COARSE
> 
> 
> 

-- 
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH 04/32] vdso.7: Add y2038 compliant gettime for ppc/32
  2021-07-28 20:19 ` [PATCH 04/32] vdso.7: Add y2038 compliant gettime for ppc/32 Alejandro Colomar
@ 2021-08-08  0:48   ` Michael Kerrisk (man-pages)
  2021-08-08  1:01     ` Alejandro Colomar (man-pages)
  2021-08-08  2:22   ` Michael Kerrisk (man-pages)
  1 sibling, 1 reply; 92+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-08-08  0:48 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, linux-man, Christophe Leroy

Hello Alex

Again, let us add the bug in the commit message:

https://bugzilla.kernel.org/show_bug.cgi?id=213421

I have not yet applied this. See below.

On 7/28/21 10:19 PM, Alejandro Colomar wrote:
> Christophe Leroy via Bugzilla:
> 
> [
> https://man7.org/linux/man-pages/man7/vdso.7.html (2021-03-22)
> 
> In ppc32 functions section, the Y2038 compliant function
> __kernel_clock_gettime64() is missing.
> 
> It was added by commit d0e3fc69d00d
> ("powerpc/vdso: Provide __kernel_clock_gettime64() on vdso32")
> ]
> 
> .../linux$ git describe d0e3fc69d00d
> v5.10-rc2-76-gd0e3fc69d00d
> 
> Reported-by: Christophe Leroy <christophe.leroy@csgroup.eu>
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
> ---
>  man7/vdso.7 | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/man7/vdso.7 b/man7/vdso.7
> index 1d527c38e..5fb22ab5e 100644
> --- a/man7/vdso.7
> +++ b/man7/vdso.7
> @@ -371,6 +371,7 @@ symbol	version
>  _
>  __kernel_clock_getres	LINUX_2.6.15
>  __kernel_clock_gettime	LINUX_2.6.15
> +__kernel_clock_gettime64	LINUX_5.10

Is it really 5.10? By contrast, I see

$ git describe --contains d0e3fc69d00d
v5.11-rc1~76^2~251

And indeed the symbol __kernel_clock_gettime64
does not seem to be present in the Linux 5.10 sources.

Cheers,

Michael


>  __kernel_datapage_offset	LINUX_2.6.15
>  __kernel_get_syscall_map	LINUX_2.6.15
>  __kernel_get_tbfreq	LINUX_2.6.15
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH 06/32] man2/fallocate.2: tfix documentation of shared blocks
  2021-07-28 20:19 ` [PATCH 06/32] man2/fallocate.2: tfix documentation of shared blocks Alejandro Colomar
@ 2021-08-08  0:54   ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 92+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-08-08  0:54 UTC (permalink / raw)
  To: Alejandro Colomar
  Cc: mtk.manpages, Dan Robertson, linux-man, Darrick J . Wong

Hello Dan, Alex,

On 7/28/21 10:19 PM, Alejandro Colomar wrote:
> From: Dan Robertson <dan@dlrobertson.com>
> 
> Fix a typo in the documentation of using fallocate to allocate shared
> blocks. The flag FALLOC_FL_UNSHARE should instead be documented as
> FALLOC_FL_UNSHARE_RANGE.
> 
> Fixes: 63a599c657d8 ("man2/fallocate.2: Document behavior with shared blocks")
> Signed-off-by: Dan Robertson <dan@dlrobertson.com>
> Reviewed-by: Darrick J. Wong <djwong@kernel.org>
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>

Thanks. Patch applied.

Cheers,

Michael

> ---
>  man2/fallocate.2 | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/man2/fallocate.2 b/man2/fallocate.2
> index a62706193..b4cb3516f 100644
> --- a/man2/fallocate.2
> +++ b/man2/fallocate.2
> @@ -81,7 +81,7 @@ Preallocating zeroed blocks beyond the end of the file in this manner
>  is useful for optimizing append workloads.
>  .PP
>  If the
> -.B FALLOC_FL_UNSHARE
> +.B FALLOC_FL_UNSHARE_RANGE
>  flag is specified in
>  .IR mode ,
>  shared file data extents will be made private to the file to guarantee
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH 05/32] posixoptions.7: Fix legacy functions list (s/getcwd/getwd/)
  2021-07-28 20:19 ` [PATCH 05/32] posixoptions.7: Fix legacy functions list (s/getcwd/getwd/) Alejandro Colomar
@ 2021-08-08  0:55   ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 92+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-08-08  0:55 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, linux-man, Alan Peakall

Hello Alan, Alex,

On 7/28/21 10:19 PM, Alejandro Colomar wrote:
> Alan:
> 
> [
> The on-line copy of the manual page "posixoptions(7)" dated
> 2018-04-30 has an entry for "getcwd()" in the section headed
> "XSI - _XOPEN_LEGACY - _SC_XOPEN_LEGACY".
> I believe that entry should be "getwd()" as that is the API call
> which was present in X/Open-6 but withdrawn in X/Open-7.
> ]
> 
> Reported-by: Alan Peakall <Alan.Peakall@helpsystems.com>
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>

Thanks. Patch applied.

Cheers,

Michael

> ---
>  man7/posixoptions.7 | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/man7/posixoptions.7 b/man7/posixoptions.7
> index d2ee10302..d6882fe05 100644
> --- a/man7/posixoptions.7
> +++ b/man7/posixoptions.7
> @@ -968,7 +968,7 @@ The following functions are present:
>  .IR fcvt ()
>  .IR ftime ()
>  .IR gcvt ()
> -.IR getcwd ()
> +.IR getwd ()
>  .IR index ()
>  .IR mktemp ()
>  .IR rindex ()
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH 16/32] seccomp_unotify.2: Add doc for SECCOMP_ADDFD_FLAG_SEND
  2021-07-28 20:19 ` [PATCH 16/32] seccomp_unotify.2: Add doc for SECCOMP_ADDFD_FLAG_SEND Alejandro Colomar
@ 2021-08-08  1:01   ` Michael Kerrisk (man-pages)
  2021-08-09  9:42     ` Rodrigo Campos
  0 siblings, 1 reply; 92+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-08-08  1:01 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, Rodrigo Campos, linux-man

Hello Rodrigo, Alex,

On 7/28/21 10:19 PM, Alejandro Colomar wrote:
> From: Rodrigo Campos <rodrigo@kinvolk.io>
> 
> This flag was recently added to Linux 5.14 by a patch I wrote:
> 	https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0ae71c7720e3ae3aabd2e8a072d27f7bd173d25c
> 
> This patch adds documentation for the flag, the error code that the flag
> added and explains in the caveat when it is useful.

Thanks for taking the time to write this patch!

Patch applied.

Cheers,

Michael

> Signed-off-by: Rodrigo Campos <rodrigo@kinvolk.io>> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
> ---
>  man2/seccomp_unotify.2 | 26 ++++++++++++++++++++++++++
>  1 file changed, 26 insertions(+)
> 
> diff --git a/man2/seccomp_unotify.2 b/man2/seccomp_unotify.2
> index 2673d9bc7..9bd27214f 100644
> --- a/man2/seccomp_unotify.2
> +++ b/man2/seccomp_unotify.2
> @@ -739,6 +739,17 @@ When allocating the file descriptor in the target,
>  use the file descriptor number specified in the
>  .I newfd
>  field.
> +.TP
> +.BR SECCOMP_ADDFD_FLAG_SEND
> +Available since Linux 5.14, combines the
> +.B SECCOMP_IOCTL_NOTIF_ADDFD
> +ioctl with
> +.B SECCOMP_IOCTL_NOTIF_SEND
> +into an atomic operation. On successful invocation, the target process's
> +errno will be 0 and the return value will be the file descriptor number that was
> +installed in the target. If allocating the file descriptor in the tatget fails,
> +the target's syscall continues to be blocked until a successful response is
> +sent.
>  .RE
>  .TP
>  .I srcfd
> @@ -801,6 +812,13 @@ Allocating the file descriptor in the target would cause the target's
>  limit to be exceeded (see
>  .BR getrlimit (2)).
>  .TP
> +.B EBUSY
> +If the flag
> +.B SECCOMP_IOCTL_NOTIF_SEND
> +is used, this means the operation can't proceed until other
> +.B SECCOMP_IOCTL_NOTIF_ADDFD
> +requests are processed.
> +.TP
>  .B EINPROGRESS
>  The user-space notification specified in the
>  .I id
> @@ -1131,6 +1149,14 @@ that would
>  normally be restarted by the
>  .BR SA_RESTART
>  flag.
> +.PP
> +Furthermore, if the supervisor response is a file descriptor
> +added with
> +.B SECCOMP_IOCTL_NOTIF_ADDFD,
> +then the flag
> +.B SECCOMP_ADDFD_FLAG_SEND
> +can be used to atomically add the file descriptor and return that value,
> +making sure no file descriptors are inadvertently leaked into the target.
>  .\" FIXME
>  .\" About the above, Kees Cook commented:
>  .\"
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH 04/32] vdso.7: Add y2038 compliant gettime for ppc/32
  2021-08-08  0:48   ` Michael Kerrisk (man-pages)
@ 2021-08-08  1:01     ` Alejandro Colomar (man-pages)
  2021-08-08  2:25       ` Michael Kerrisk (man-pages)
  0 siblings, 1 reply; 92+ messages in thread
From: Alejandro Colomar (man-pages) @ 2021-08-08  1:01 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages); +Cc: linux-man, Christophe Leroy

Hello Michael,

On 8/8/21 2:48 AM, Michael Kerrisk (man-pages) wrote:
> Hello Alex
> 
> Again, let us add the bug in the commit message:
> 
> https://bugzilla.kernel.org/show_bug.cgi?id=213421

Sure.

> 
> I have not yet applied this. See below.
> 
> On 7/28/21 10:19 PM, Alejandro Colomar wrote:
>> Christophe Leroy via Bugzilla:
>>
>> [
>> https://man7.org/linux/man-pages/man7/vdso.7.html (2021-03-22)
>>
>> In ppc32 functions section, the Y2038 compliant function
>> __kernel_clock_gettime64() is missing.
>>
>> It was added by commit d0e3fc69d00d
>> ("powerpc/vdso: Provide __kernel_clock_gettime64() on vdso32")
>> ]
>>
>> .../linux$ git describe d0e3fc69d00d
>> v5.10-rc2-76-gd0e3fc69d00d
>>
>> Reported-by: Christophe Leroy <christophe.leroy@csgroup.eu>
>> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
>> ---
>>   man7/vdso.7 | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/man7/vdso.7 b/man7/vdso.7
>> index 1d527c38e..5fb22ab5e 100644
>> --- a/man7/vdso.7
>> +++ b/man7/vdso.7
>> @@ -371,6 +371,7 @@ symbol	version
>>   _
>>   __kernel_clock_getres	LINUX_2.6.15
>>   __kernel_clock_gettime	LINUX_2.6.15
>> +__kernel_clock_gettime64	LINUX_5.10
> 
> Is it really 5.10? By contrast, I see
> 
> $ git describe --contains d0e3fc69d00d
> v5.11-rc1~76^2~251
> 
> And indeed the symbol __kernel_clock_gettime64
> does not seem to be present in the Linux 5.10 sources.

It seems I was wrong.  I forgot --contains!
It is 5.11.

Thanks,

Alex

> 
> Cheers,
> 
> Michael
> 
> 
>>   __kernel_datapage_offset	LINUX_2.6.15
>>   __kernel_get_syscall_map	LINUX_2.6.15
>>   __kernel_get_tbfreq	LINUX_2.6.15
>>
> 
> 


-- 
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH 17/32] seccomp_unotify.2: Minor tweaks to Rodrigo's patch
  2021-07-28 20:19 ` [PATCH 17/32] seccomp_unotify.2: Minor tweaks to Rodrigo's patch Alejandro Colomar
  2021-07-29 11:15   ` Alejandro Colomar (man-pages)
@ 2021-08-08  1:13   ` Michael Kerrisk (man-pages)
  2021-08-08  1:22     ` Alejandro Colomar (man-pages)
  1 sibling, 1 reply; 92+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-08-08  1:13 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, linux-man, Rodrigo Campos

[CC += Rodrigo]

Hi Alex,

On 7/28/21 10:19 PM, Alejandro Colomar wrote:
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
> ---
>  man2/seccomp_unotify.2 | 32 +++++++++++++++++---------------
>  1 file changed, 17 insertions(+), 15 deletions(-)
> 
> diff --git a/man2/seccomp_unotify.2 b/man2/seccomp_unotify.2
> index 9bd27214f..ae449ae36 100644
> --- a/man2/seccomp_unotify.2
> +++ b/man2/seccomp_unotify.2
> @@ -740,16 +740,18 @@ use the file descriptor number specified in the
>  .I newfd
>  field.
>  .TP
> -.BR SECCOMP_ADDFD_FLAG_SEND
> -Available since Linux 5.14, combines the
> +.BR SECCOMP_ADDFD_FLAG_SEND " (since Linux 5.14)"
> +Combines the
>  .B SECCOMP_IOCTL_NOTIF_ADDFD
>  ioctl with
>  .B SECCOMP_IOCTL_NOTIF_SEND
> -into an atomic operation. On successful invocation, the target process's
> -errno will be 0 and the return value will be the file descriptor number that was
> -installed in the target. If allocating the file descriptor in the tatget fails,
> -the target's syscall continues to be blocked until a successful response is
> -sent.
> +into an atomic operation.
> +On successful invocation, the target process's errno will be 0
> +and the return value will be the file descriptor number
> +that was installed in the target.
> +If allocating the file descriptor in the tatget fails,
> +the target's syscall continues to be blocked
> +until a successful response is sent.
>  .RE
>  .TP
>  .I srcfd
> @@ -1149,14 +1151,6 @@ that would
>  normally be restarted by the
>  .BR SA_RESTART
>  flag.
> -.PP
> -Furthermore, if the supervisor response is a file descriptor
> -added with
> -.B SECCOMP_IOCTL_NOTIF_ADDFD,
> -then the flag
> -.B SECCOMP_ADDFD_FLAG_SEND
> -can be used to atomically add the file descriptor and return that value,
> -making sure no file descriptors are inadvertently leaked into the target.
>  .\" FIXME
>  .\" About the above, Kees Cook commented:
>  .\"
> @@ -1176,6 +1170,14 @@ making sure no file descriptors are inadvertently leaked into the target.
>  .\" calls because it's impossible for the kernel to restart the call
>  .\" with the right timeout value. I wonder what happens when those
>  .\" system calls are restarted in the scenario we're discussing.)
> +.PP
> +Furthermore, if the supervisor response is a file descriptor
> +added with
> +.B SECCOMP_IOCTL_NOTIF_ADDFD,
> +then the flag
> +.B SECCOMP_ADDFD_FLAG_SEND
> +can be used to atomically add the file descriptor and return that value,
> +making sure no file descriptors are inadvertently leaked into the target.
>  .SH BUGS
>  If a
>  .BR SECCOMP_IOCTL_NOTIF_RECV

Good clean-ups, but still I added some fixes, as below. (The first change
is just some slightly smoother wording, IMO.)

Thanks,

Michael

diff --git a/man2/seccomp_unotify.2 b/man2/seccomp_unotify.2
index ae449ae36..b92203721 100644
--- a/man2/seccomp_unotify.2
+++ b/man2/seccomp_unotify.2
@@ -741,16 +741,19 @@ use the file descriptor number specified in the
 field.
 .TP
 .BR SECCOMP_ADDFD_FLAG_SEND " (since Linux 5.14)"
-Combines the
+.\" commit 0ae71c7720e3ae3aabd2e8a072d27f7bd173d25c
+Perform the equivalent of
 .B SECCOMP_IOCTL_NOTIF_ADDFD
-ioctl with
+plus
 .B SECCOMP_IOCTL_NOTIF_SEND
-into an atomic operation.
-On successful invocation, the target process's errno will be 0
+as an atomic operation.
+On successful invocation, the target process's
+.I errno
+will be 0
 and the return value will be the file descriptor number
-that was installed in the target.
-If allocating the file descriptor in the tatget fails,
-the target's syscall continues to be blocked
+that was allocated in the target.
+If allocating the file descriptor in the target fails,
+the target's system call continues to be blocked
 until a successful response is sent.
 .RE
 .TP
@@ -1173,7 +1176,7 @@ flag.
 .PP
 Furthermore, if the supervisor response is a file descriptor
 added with
-.B SECCOMP_IOCTL_NOTIF_ADDFD,
+.BR SECCOMP_IOCTL_NOTIF_ADDFD ,
 then the flag
 .B SECCOMP_ADDFD_FLAG_SEND
 can be used to atomically add the file descriptor and return that value,

-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply related	[flat|nested] 92+ messages in thread

* Re: [PATCH 21/32] seccomp_unotify.2: tfix
  2021-07-28 20:19 ` [PATCH 21/32] seccomp_unotify.2: tfix Alejandro Colomar
@ 2021-08-08  1:13   ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 92+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-08-08  1:13 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, Jakub Wilk, linux-man

Hi Jakub, Alex,

On 7/28/21 10:19 PM, Alejandro Colomar wrote:
> From: Jakub Wilk <jwilk@jwilk.net>
> 
> Remove duplicated word.
> 
> Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>

Thanks. Patch applied.

Cheers,

Michael

> ---
>  man2/seccomp_unotify.2 | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/man2/seccomp_unotify.2 b/man2/seccomp_unotify.2
> index ae449ae36..2605be9fb 100644
> --- a/man2/seccomp_unotify.2
> +++ b/man2/seccomp_unotify.2
> @@ -1105,7 +1105,7 @@ Alternatively, in the
>  example, the supervisor might use
>  .BR poll (2)
>  to monitor both the notification file descriptor
> -(so as as to discover when the target's
> +(so as to discover when the target's
>  .BR accept (2)
>  call has been interrupted) and the listening file descriptor
>  (so as to know when a connection is available).
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH 30/32] strlen.3, wcslen.3: Add recommendations for safer variants
  2021-08-08  0:16     ` Alejandro Colomar (man-pages)
@ 2021-08-08  1:20       ` Michael Kerrisk (man-pages)
  2021-08-08  1:24         ` Alejandro Colomar (man-pages)
  2021-08-08 19:44       ` Jonny Grant
  1 sibling, 1 reply; 92+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-08-08  1:20 UTC (permalink / raw)
  To: Alejandro Colomar (man-pages); +Cc: mtk.manpages, linux-man, Jonny Grant

Hi Alex,

On 8/8/21 2:16 AM, Alejandro Colomar (man-pages) wrote:
> Hi, Michael!
> 
> On 8/8/21 1:45 AM, Michael Kerrisk (man-pages) wrote:
>> Hello Alex,
>>
>> I see there was a rather long mail thread that led
>> to this patch. The patch definitely deserves a commit
>> message.
>>
>> See also below.
>> On 7/28/21 10:20 PM, Alejandro Colomar wrote:
>>> Reported-by: Jonny Grant <jg@jguk.org>
>>> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
>>> ---
>>>  man3/strlen.3 | 6 ++++++
>>>  man3/wcslen.3 | 9 ++++++++-
>>>  2 files changed, 14 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/man3/strlen.3 b/man3/strlen.3
>>> index dea4c1050..78783c446 100644
>>> --- a/man3/strlen.3
>>> +++ b/man3/strlen.3
>>> @@ -66,6 +66,12 @@ T}	Thread safety	MT-Safe
>>>  .sp 1
>>>  .SH CONFORMING TO
>>>  POSIX.1-2001, POSIX.1-2008, C89, C99, C11, SVr4, 4.3BSD.
>>> +.SH NOTES
>>> +.SS strnlen(3)
>>> +If the input buffer size is known,
>>> +it is probably better to use
>>> +.BR strnlen (3),
>>> +which can prevent reading past the end of the array.
>>
>> I hesitate slightly about this. strlen() is in the C standard, but
>> strnlen() is not. What do you think; do we need to care?
> 
> I have some doubts about this patch, but in a completely different sense:
> 
> I don't know if I'm being a bit paranoid in treating user input.  I've
> always been taught that I should program deffensively, but as time
> passes by, I realize myself that I was programming too much
> deffensively, and even introducing bugs in the error handling code.  And
> in many cases, strings will always be NUL-terminated, so maybe I'm just
> passing around a wrong recommendation.
> 
> What do you think about this?

How about a sentence something like:

[[
In cases where the input buffer may not contain a terminating null byte,
.BR strnlen (3)
should be used instead.
]]

What do you think?

Thanks,

Michael

-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH 17/32] seccomp_unotify.2: Minor tweaks to Rodrigo's patch
  2021-08-08  1:13   ` Michael Kerrisk (man-pages)
@ 2021-08-08  1:22     ` Alejandro Colomar (man-pages)
  0 siblings, 0 replies; 92+ messages in thread
From: Alejandro Colomar (man-pages) @ 2021-08-08  1:22 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages); +Cc: linux-man, Rodrigo Campos

Hi Alex,

On 8/8/21 3:13 AM, Michael Kerrisk (man-pages) wrote:

> 
> Good clean-ups, but still I added some fixes, as below. (The first change
> is just some slightly smoother wording, IMO.)
> 

Yes, it reads better!  Thanks!

Alex


-- 
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH 30/32] strlen.3, wcslen.3: Add recommendations for safer variants
  2021-08-08  1:20       ` Michael Kerrisk (man-pages)
@ 2021-08-08  1:24         ` Alejandro Colomar (man-pages)
  2021-08-08  2:18           ` Michael Kerrisk (man-pages)
  0 siblings, 1 reply; 92+ messages in thread
From: Alejandro Colomar (man-pages) @ 2021-08-08  1:24 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages); +Cc: linux-man, Jonny Grant

Hi Michael,

On 8/8/21 3:20 AM, Michael Kerrisk (man-pages) wrote:
>> I have some doubts about this patch, but in a completely different sense:
>>
>> I don't know if I'm being a bit paranoid in treating user input.  I've
>> always been taught that I should program deffensively, but as time
>> passes by, I realize myself that I was programming too much
>> deffensively, and even introducing bugs in the error handling code.  And
>> in many cases, strings will always be NUL-terminated, so maybe I'm just
>> passing around a wrong recommendation.
>>
>> What do you think about this?
> 
> How about a sentence something like:
> 
> [[
> In cases where the input buffer may not contain a terminating null byte,
> .BR strnlen (3)
> should be used instead.
> ]]
> 
> What do you think?

Yes, that's much better.  Thanks!

Alex

> 
> Thanks,
> 
> Michael
> 


-- 
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH 32/32] execve.2: Fix absolute/relative pathname
  2021-07-28 20:20 ` [PATCH 32/32] execve.2: Fix absolute/relative pathname Alejandro Colomar
@ 2021-08-08  2:02   ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 92+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-08-08  2:02 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, Shawn Landden, linux-man, Nora Platiel

Hello Alex, Shawn, and Nora,

@Nora, thanks for the bug report.

On 7/28/21 10:20 PM, Alejandro Colomar wrote:
> From: Shawn Landden <shawn@git.icu>
> 
> The absolute pathname is available in the Linux-specific
> auxiliary-vector feature.

@Shawn
But this isn't true, as far as I can see. See the following:

[[
$ cat auxv.c 
#include <link.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

extern char **environ;

int
main(int argc, char *argv[])
{
    char **p;

    /* Walk through the array of pointers in environ */

    for (p = environ; *p != NULL; p++)
        continue;

    /* The auxiliary vector sits just above environ */

    p++;        /* Step past NULL pointer at end of 'environ' */

    printf("auxvec                        %12p\n", (void *) p);

    ElfW(auxv_t) *auxv = (ElfW(auxv_t) *) p;

    while (auxv->a_type != 0) {

        switch (auxv->a_type) {
        case AT_PLATFORM:
                        /* String identifying hardware platform */
            printf("AT_PLATFORM:      0x%llx (string: %s)\n",
                    (long long) auxv->a_un.a_val, (char *) auxv->a_un.a_val);
            break;
        case AT_SECURE: /* Was secure-execution mode triggered for dynamic
                           linker? See ld.so(8). */
            printf("AT_SECURE:        %lld\n", (long long) auxv->a_un.a_val);
            break;
        case AT_EXECFN: /* Pathname used to execute program */
            printf("AT_EXECFN:        0x%llx (string: %s)\n",
                    (long long) auxv->a_un.a_val, (char *) auxv->a_un.a_val);
            break;
        default:
            /* We ignore other types of entries in auxiliary vector */
            break;
        }

        auxv++;
    }

    exit(EXIT_SUCCESS);
}
$ ./auxv
auxvec                        0x7ffd5c6eb708
AT_SECURE:        0
AT_EXECFN:        0x7ffd5c6ecff1 (string: ./auxv)
AT_PLATFORM:      0x7ffd5c6eb859 (string: x86_64)
]]

> 
> Reported-by: Nora Platiel <nplatiel@gmx.us>
> Signed-off-by: Shawn Landden <shawn@git.icu>
> Reviewed-by: Nora Platiel <nplatiel@gmx.us>
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
> ---
>  man2/execve.2 | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/man2/execve.2 b/man2/execve.2
> index c18ca5412..7fe12ab42 100644
> --- a/man2/execve.2
> +++ b/man2/execve.2
> @@ -346,7 +346,9 @@ will be invoked with the following arguments:
>  .PP
>  where
>  .I pathname
> -is the absolute pathname of the file specified as the first argument of
> +is the absolute pathname of the file specified (may be relative to
> +.BR getcwd (3)
> +of the caller) as the first argument of
>  .BR execve (),

I find the "(may be relative...)" piece confusing.

It's simpler just to s/absolute pathname/pathname/, and that's the
change I made.

>  and
>  .I arg...
> @@ -356,6 +358,11 @@ argument of
>  .BR execve (),
>  starting at
>  .IR argv[1] .
> +The absolute pathname of the script is also available
> +in the same auxiliary vector the environment and argument variables are in, as
> +.BR AT_EXECFN .
> +See
> +.BR getauxval (3).
>  Note that there is no way to get the
>  .IR argv[0]
>  that was passed to the

I applied the patch below.

Cheers,

Michael

diff --git a/man2/execve.2 b/man2/execve.2
index 435a6b363..4eaf1967e 100644
--- a/man2/execve.2
+++ b/man2/execve.2
@@ -346,7 +346,7 @@ will be invoked with the following arguments:
 .PP
 where
 .I pathname
-is the absolute pathname of the file specified as the first argument of
+is the pathname of the file specified as the first argument of
 .BR execve (),
 and
 .I arg...


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply related	[flat|nested] 92+ messages in thread

* Re: [PATCH 30/32] strlen.3, wcslen.3: Add recommendations for safer variants
  2021-08-08  1:24         ` Alejandro Colomar (man-pages)
@ 2021-08-08  2:18           ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 92+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-08-08  2:18 UTC (permalink / raw)
  To: Alejandro Colomar (man-pages); +Cc: mtk.manpages, linux-man, Jonny Grant

Hi Alex,

On 8/8/21 3:24 AM, Alejandro Colomar (man-pages) wrote:
> Hi Michael,
> 
> On 8/8/21 3:20 AM, Michael Kerrisk (man-pages) wrote:
>>> I have some doubts about this patch, but in a completely different sense:
>>>
>>> I don't know if I'm being a bit paranoid in treating user input.  I've
>>> always been taught that I should program deffensively, but as time
>>> passes by, I realize myself that I was programming too much
>>> deffensively, and even introducing bugs in the error handling code.  And
>>> in many cases, strings will always be NUL-terminated, so maybe I'm just
>>> passing around a wrong recommendation.
>>>
>>> What do you think about this?
>>
>> How about a sentence something like:
>>
>> [[
>> In cases where the input buffer may not contain a terminating null byte,
>> .BR strnlen (3)
>> should be used instead.
>> ]]
>>
>> What do you think?
> 
> Yes, that's much better.  Thanks!

Okay. I applied the patch below.

Thanks,

Michael

diff --git a/man3/strlen.3 b/man3/strlen.3
index dea4c1050..ca7a7d188 100644
--- a/man3/strlen.3
+++ b/man3/strlen.3
@@ -64,6 +64,11 @@ T}   Thread safety   MT-Safe
 .hy
 .ad
 .sp 1
+.SH NOTES
+In cases where the input buffer may not contain
+a terminating null byte,
+.BR strnlen (3)
+should be used instead.
 .SH CONFORMING TO
 POSIX.1-2001, POSIX.1-2008, C89, C99, C11, SVr4, 4.3BSD.
 .SH SEE ALSO
diff --git a/man3/wcslen.3 b/man3/wcslen.3
index af3fcb9ca..24dca8e55 100644
--- a/man3/wcslen.3
+++ b/man3/wcslen.3
@@ -56,6 +56,11 @@ T}   Thread safety   MT-Safe
 .hy
 .ad
 .sp 1
+.SH NOTES
+In cases where the input buffer may not contain
+a terminating null wide character,
+.BR wcsnlen (3)
+should be used instead.
 .SH CONFORMING TO
 POSIX.1-2001, POSIX.1-2008, C99.
 .SH SEE ALSO



-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply related	[flat|nested] 92+ messages in thread

* Re: [PATCH 04/32] vdso.7: Add y2038 compliant gettime for ppc/32
  2021-07-28 20:19 ` [PATCH 04/32] vdso.7: Add y2038 compliant gettime for ppc/32 Alejandro Colomar
  2021-08-08  0:48   ` Michael Kerrisk (man-pages)
@ 2021-08-08  2:22   ` Michael Kerrisk (man-pages)
  1 sibling, 0 replies; 92+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-08-08  2:22 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, linux-man, Christophe Leroy

Hi Alex,

On 7/28/21 10:19 PM, Alejandro Colomar wrote:
> Christophe Leroy via Bugzilla:
> 
> [
> https://man7.org/linux/man-pages/man7/vdso.7.html (2021-03-22)
> 
> In ppc32 functions section, the Y2038 compliant function
> __kernel_clock_gettime64() is missing.
> 
> It was added by commit d0e3fc69d00d
> ("powerpc/vdso: Provide __kernel_clock_gettime64() on vdso32")
> ]
> 
> .../linux$ git describe d0e3fc69d00d
> v5.10-rc2-76-gd0e3fc69d00d
> 
> Reported-by: Christophe Leroy <christophe.leroy@csgroup.eu>
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>

Patch applied. But see the follow-up mail.

Thanks,

Michael

> ---
>  man7/vdso.7 | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/man7/vdso.7 b/man7/vdso.7
> index 1d527c38e..5fb22ab5e 100644
> --- a/man7/vdso.7
> +++ b/man7/vdso.7
> @@ -371,6 +371,7 @@ symbol	version
>  _
>  __kernel_clock_getres	LINUX_2.6.15
>  __kernel_clock_gettime	LINUX_2.6.15
> +__kernel_clock_gettime64	LINUX_5.10
>  __kernel_datapage_offset	LINUX_2.6.15
>  __kernel_get_syscall_map	LINUX_2.6.15
>  __kernel_get_tbfreq	LINUX_2.6.15
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH 04/32] vdso.7: Add y2038 compliant gettime for ppc/32
  2021-08-08  1:01     ` Alejandro Colomar (man-pages)
@ 2021-08-08  2:25       ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 92+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-08-08  2:25 UTC (permalink / raw)
  To: Alejandro Colomar (man-pages); +Cc: mtk.manpages, linux-man, Christophe Leroy

Hi Alex,

On 8/8/21 3:01 AM, Alejandro Colomar (man-pages) wrote:
> Hello Michael,
> 
> On 8/8/21 2:48 AM, Michael Kerrisk (man-pages) wrote:
>> Hello Alex
>>
>> Again, let us add the bug in the commit message:
>>
>> https://bugzilla.kernel.org/show_bug.cgi?id=213421
> 
> Sure.
> 
>>
>> I have not yet applied this. See below.
>>
>> On 7/28/21 10:19 PM, Alejandro Colomar wrote:
>>> Christophe Leroy via Bugzilla:
>>>
>>> [
>>> https://man7.org/linux/man-pages/man7/vdso.7.html (2021-03-22)
>>>
>>> In ppc32 functions section, the Y2038 compliant function
>>> __kernel_clock_gettime64() is missing.
>>>
>>> It was added by commit d0e3fc69d00d
>>> ("powerpc/vdso: Provide __kernel_clock_gettime64() on vdso32")
>>> ]
>>>
>>> .../linux$ git describe d0e3fc69d00d
>>> v5.10-rc2-76-gd0e3fc69d00d
>>>
>>> Reported-by: Christophe Leroy <christophe.leroy@csgroup.eu>
>>> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
>>> ---
>>>   man7/vdso.7 | 1 +
>>>   1 file changed, 1 insertion(+)
>>>
>>> diff --git a/man7/vdso.7 b/man7/vdso.7
>>> index 1d527c38e..5fb22ab5e 100644
>>> --- a/man7/vdso.7
>>> +++ b/man7/vdso.7
>>> @@ -371,6 +371,7 @@ symbol	version
>>>   _
>>>   __kernel_clock_getres	LINUX_2.6.15
>>>   __kernel_clock_gettime	LINUX_2.6.15
>>> +__kernel_clock_gettime64	LINUX_5.10
>>
>> Is it really 5.10? By contrast, I see
>>
>> $ git describe --contains d0e3fc69d00d
>> v5.11-rc1~76^2~251
>>
>> And indeed the symbol __kernel_clock_gettime64
>> does not seem to be present in the Linux 5.10 sources.
> 
> It seems I was wrong.  I forgot --contains!
> It is 5.11.

Okay. I applied the patch below.

Cheers,

Michael

commit ae5cc0dc572116c9f4125a1de52e6c613e6659f3 (HEAD -> master)
Author: Michael Kerrisk <mtk.manpages@gmail.com>
Date:   Sun Aug 8 04:22:49 2021 +0200

    vdso.7: Minor tweak to Alejandro Colomar's patch
    
    The correct kernel version seems to 5.11, not 5.10:
    
    $ git describe --contains d0e3fc69d00d
    v5.11-rc1~76^2~251
    
    Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>

diff --git a/man7/vdso.7 b/man7/vdso.7
index 4a7ab3111..e706701f0 100644
--- a/man7/vdso.7
+++ b/man7/vdso.7
@@ -370,7 +370,7 @@ symbol      version
 _
 __kernel_clock_getres  LINUX_2.6.15
 __kernel_clock_gettime LINUX_2.6.15
-__kernel_clock_gettime64       LINUX_5.10
+__kernel_clock_gettime64       LINUX_5.11
 __kernel_datapage_offset       LINUX_2.6.15
 __kernel_get_syscall_map       LINUX_2.6.15
 __kernel_get_tbfreq    LINUX_2.6.15


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply related	[flat|nested] 92+ messages in thread

* Re: [PATCH 01/32] readv2: Note preadv2(..., RWF_NOWAIT) bug in BUGS section
  2021-07-28 20:19 ` [PATCH 01/32] readv2: Note preadv2(..., RWF_NOWAIT) bug in BUGS section Alejandro Colomar
@ 2021-08-08  2:29   ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 92+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-08-08  2:29 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, Will Manley, linux-man

Hello Will and Alex,

On 7/28/21 10:19 PM, Alejandro Colomar wrote:
> From: Will Manley <will@williammanley.net>
> 
> To save the next person before they fall foul of it.  See
> <https://lore.kernel.org/linux-fsdevel/fea8b16d-5a69-40f9-b123-e84dcd6e8f2e@www.fastmail.com/T/#u>
> and <https://github.com/tokio-rs/tokio/issues/3803> for more information.
> 
> Signed-off-by: Will Manley <will@williammanley.net>
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>

Patch applied, but see my follow-up mail.

Thanks,

Michael

> ---
>  man2/readv.2 | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/man2/readv.2 b/man2/readv.2
> index df42cf830..3355fa9d7 100644
> --- a/man2/readv.2
> +++ b/man2/readv.2
> @@ -243,7 +243,9 @@ If some data was successfully read, it will return the number of bytes read.
>  If no bytes were read, it will return \-1 and set
>  .IR errno
>  to
> -.BR EAGAIN .
> +.BR EAGAIN
> +(but see
> +.BR BUGS ")."
>  Currently, this flag is meaningful only for
>  .BR preadv2 ().
>  .TP
> @@ -425,6 +427,13 @@ iov[1].iov_len = strlen(str1);
>  nwritten = writev(STDOUT_FILENO, iov, 2);
>  .EE
>  .in
> +.SH BUGS
> +Linux v5.9 and v5.10 have a bug where
> +.BR preadv2()
> +with the
> +.BR RWF_NOWAIT
> +flag may return 0 even when not at end of file.  See
> +https://lore.kernel.org/linux-fsdevel/fea8b16d-5a69-40f9-b123-e84dcd6e8f2e@www.fastmail.com/T/#u
>  .SH SEE ALSO
>  .BR pread (2),
>  .BR read (2),
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH 02/32] readv.2: Minor tweaks to Will's patch
  2021-07-28 20:19 ` [PATCH 02/32] readv.2: Minor tweaks to Will's patch Alejandro Colomar
@ 2021-08-08  2:30   ` Michael Kerrisk (man-pages)
  2021-08-08  2:42     ` Michael Kerrisk (man-pages)
  0 siblings, 1 reply; 92+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-08-08  2:30 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, linux-man, Will Manley

Hello Alex,

On 7/28/21 10:19 PM, Alejandro Colomar wrote:
> Cc: Will Manley <will@williammanley.net>
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>

Patch applied, but see my follow-up mail.

Thanks,

Michael

> ---
>  man2/readv.2 | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/man2/readv.2 b/man2/readv.2
> index 3355fa9d7..0debc2d57 100644
> --- a/man2/readv.2
> +++ b/man2/readv.2
> @@ -245,7 +245,7 @@ If no bytes were read, it will return \-1 and set
>  to
>  .BR EAGAIN
>  (but see
> -.BR BUGS ")."
> +.BR BUGS ).
>  Currently, this flag is meaningful only for
>  .BR preadv2 ().
>  .TP
> @@ -433,7 +433,7 @@ Linux v5.9 and v5.10 have a bug where
>  with the
>  .BR RWF_NOWAIT
>  flag may return 0 even when not at end of file.  See
> -https://lore.kernel.org/linux-fsdevel/fea8b16d-5a69-40f9-b123-e84dcd6e8f2e@www.fastmail.com/T/#u
> +https://lore.kernel.org\:/linux-fsdevel\:/fea8b16d-5a69-40f9-b123-e84dcd6e8f2e@www.fastmail.com\:/T\:/#u
>  .SH SEE ALSO
>  .BR pread (2),
>  .BR read (2),
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH 02/32] readv.2: Minor tweaks to Will's patch
  2021-08-08  2:30   ` Michael Kerrisk (man-pages)
@ 2021-08-08  2:42     ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 92+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-08-08  2:42 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, linux-man, Will Manley

Hi Alex and Will

Will, thanks for taking time to write up the patch!

On 8/8/21 4:30 AM, Michael Kerrisk (man-pages) wrote:
> Hello Alex,
> 
> On 7/28/21 10:19 PM, Alejandro Colomar wrote:
>> Cc: Will Manley <will@williammanley.net>
>> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
> 
> Patch applied, but see my follow-up mail.

Alex, see the follow-up patch that I applied, below.

Cheers,

Michael

commit 76dec7bbd4e8761249a339db5f13f7e63a37aac3 (HEAD -> master)
Author: Michael Kerrisk <mtk.manpages@gmail.com>
Date:   Sun Aug 8 04:34:37 2021 +0200

    readv.2: Minor fixes (part 2) to Will Manley's patch
    
    Mainly: I generally don't want us to be including URLs to mailing
    list discussions in a manual page. Either, the issue in the
    discussion is worth writing up in the manual page (so that
    the reader doesn't have to look elsewhere), or the details
    are less important, in which case it is sufficient to note the
    existence of the bug. I think this is an example of the latter.
    
    Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>

diff --git a/man2/readv.2 b/man2/readv.2
index 0debc2d57..bd0a6cd2f 100644
--- a/man2/readv.2
+++ b/man2/readv.2
@@ -428,12 +428,17 @@ nwritten = writev(STDOUT_FILENO, iov, 2);
 .EE
 .in
 .SH BUGS
-Linux v5.9 and v5.10 have a bug where
+Linux 5.9 and 5.10 have a bug where
 .BR preadv2()
 with the
 .BR RWF_NOWAIT
-flag may return 0 even when not at end of file.  See
-https://lore.kernel.org\:/linux-fsdevel\:/fea8b16d-5a69-40f9-b123-e84dcd6e8f2e@www.fastmail.com\:/T\:/#u
+flag may return 0 even when not at end of file.
+.\" See
+.\" <https://lore.kernel.org/linux-fsdevel/fea8b16d-5a69-40f9-b123-e84dcd6e8f2e@www.fastmail.com/T/#u>
+.\" The bug was introduced in
+.\"    efa8480a831 fs: RWF_NOWAIT should imply IOCB_NOIO
+.\"and fixed in
+.\"    06c0444290 mm/filemap.c: generic_file_buffered_read() now uses find_get_pages_contig
 .SH SEE ALSO
 .BR pread (2),
 .BR read (2),

-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply related	[flat|nested] 92+ messages in thread

* Re: [PATCH 14/32] capabilities.7, user_namespaces.7: describe CAP_SETFCAP
  2021-07-28 20:19 ` [PATCH 14/32] capabilities.7, user_namespaces.7: describe CAP_SETFCAP Alejandro Colomar
@ 2021-08-08  2:54   ` Michael Kerrisk (man-pages)
  2021-08-08  9:09   ` Michael Kerrisk (man-pages)
  1 sibling, 0 replies; 92+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-08-08  2:54 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, Kir Kolyshkin, linux-man

Hello Kir, Alex,

On 7/28/21 10:19 PM, Alejandro Colomar wrote:
> From: Kir Kolyshkin <kolyshkin@gmail.com>
> 
> Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
> ---
>  man7/capabilities.7    | 6 ++++++
>  man7/user_namespaces.7 | 6 ++++++
>  2 files changed, 12 insertions(+)
> 
> diff --git a/man7/capabilities.7 b/man7/capabilities.7
> index 9f8f0087f..2f9c9a61e 100644
> --- a/man7/capabilities.7
> +++ b/man7/capabilities.7
> @@ -349,6 +349,12 @@ write a group ID mapping in a user namespace (see
>  .TP
>  .BR CAP_SETFCAP " (since Linux 2.6.24)"
>  Set arbitrary capabilities on a file.
> +.IP
> +.\" commit db2e718a47984b9d71ed890eb2ea36ecf150de18

Thank you for including the commit; that's always really helpful!

> +Since Linux 5.12, this capability is
> +also needed to map uid 0 (as in
> +.BR unshare\ -Ur ,
> +.RB see unshare (1).
>  .TP
>  .B CAP_SETPCAP
>  If file capabilities are supported (i.e., since Linux 2.6.24):
> diff --git a/man7/user_namespaces.7 b/man7/user_namespaces.7
> index 518e7a3bb..3378b6057 100644
> --- a/man7/user_namespaces.7
> +++ b/man7/user_namespaces.7
> @@ -577,6 +577,12 @@ or be in the parent user namespace of the process
>  The mapped user IDs (group IDs) must in turn have a mapping
>  in the parent user namespace.
>  .IP 4.
> +.\" commit db2e718a47984b9d71ed890eb2ea36ecf150de18
> +If a writing process is root (i.e. UID 0) trying to map host user ID 0,
> +it must have
> +.B CAP_SETFCAP
> +capability (since Linux 5.12).
> +.IP 5.
>  One of the following two cases applies:
>  .RS
>  .IP * 3

Thanks for the patch. I've applied.

Cheers,

Michael



-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH 15/32] capabilities.7: Minor tweaks to Kir's patch
  2021-07-28 20:19 ` [PATCH 15/32] capabilities.7: Minor tweaks to Kir's patch Alejandro Colomar
  2021-07-29 11:16   ` Alejandro Colomar (man-pages)
@ 2021-08-08  3:03   ` Michael Kerrisk (man-pages)
  1 sibling, 0 replies; 92+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-08-08  3:03 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, linux-man, Kir Kolyshkin

[CC += Kir]

Hi Alex,

On 7/28/21 10:19 PM, Alejandro Colomar wrote:
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
> ---
>  man7/capabilities.7 | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/man7/capabilities.7 b/man7/capabilities.7
> index 2f9c9a61e..4d08545ed 100644
> --- a/man7/capabilities.7
> +++ b/man7/capabilities.7
> @@ -353,8 +353,9 @@ Set arbitrary capabilities on a file.
>  .\" commit db2e718a47984b9d71ed890eb2ea36ecf150de18
>  Since Linux 5.12, this capability is
>  also needed to map uid 0 (as in
> -.BR unshare\ -Ur ,
> -.RB see unshare (1).
> +.IR "unshare -Ur" ,
> +see
> +.BR unshare (1).
>  .TP
>  .B CAP_SETPCAP
>  If file capabilities are supported (i.e., since Linux 2.6.24):

Good. But still a few other things to fix. See my patch below.

Thanks,

Michael

diff --git a/man7/capabilities.7 b/man7/capabilities.7
index 4d08545ed..88dc61e29 100644
--- a/man7/capabilities.7
+++ b/man7/capabilities.7
@@ -352,10 +352,10 @@ Set arbitrary capabilities on a file.
 .IP
 .\" commit db2e718a47984b9d71ed890eb2ea36ecf150de18
 Since Linux 5.12, this capability is
-also needed to map uid 0 (as in
-.IR "unshare -Ur" ,
+also needed to map UID 0 (as in
+.IR "unshare \-Ur" ;
 see
-.BR unshare (1).
+.BR unshare (1)).
 .TP
 .B CAP_SETPCAP
 If file capabilities are supported (i.e., since Linux 2.6.24):
diff --git a/man7/user_namespaces.7 b/man7/user_namespaces.7
index 3378b6057..e35c950ca 100644
--- a/man7/user_namespaces.7
+++ b/man7/user_namespaces.7
@@ -578,8 +578,8 @@ The mapped user IDs (group IDs) must in turn have a mapping
 in the parent user namespace.
 .IP 4.
 .\" commit db2e718a47984b9d71ed890eb2ea36ecf150de18
-If a writing process is root (i.e. UID 0) trying to map host user ID 0,
-it must have
+If a writing process is root (i.e., UID 0) trying to map host user ID 0,
+it must have the
 .B CAP_SETFCAP
 capability (since Linux 5.12).
 .IP 5.




-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply related	[flat|nested] 92+ messages in thread

* Re: [PATCH 14/32] capabilities.7, user_namespaces.7: describe CAP_SETFCAP
  2021-07-28 20:19 ` [PATCH 14/32] capabilities.7, user_namespaces.7: describe CAP_SETFCAP Alejandro Colomar
  2021-08-08  2:54   ` Michael Kerrisk (man-pages)
@ 2021-08-08  9:09   ` Michael Kerrisk (man-pages)
  1 sibling, 0 replies; 92+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-08-08  9:09 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, Kir Kolyshkin, linux-man

Hello Kir,

> --- a/man7/user_namespaces.7
> +++ b/man7/user_namespaces.7
> @@ -577,6 +577,12 @@ or be in the parent user namespace of the process
>  The mapped user IDs (group IDs) must in turn have a mapping
>  in the parent user namespace.
>  .IP 4.
> +.\" commit db2e718a47984b9d71ed890eb2ea36ecf150de18
> +If a writing process is root (i.e. UID 0) trying to map host user ID 0,
> +it must have
> +.B CAP_SETFCAP
> +capability (since Linux 5.12).
> +.IP 5.
>  One of the following two cases applies:
>  .RS
>  .IP * 3

So, reflecting on this, I think much more should be said. See my mail
"Documenting the requirement of CAP_SETFCAP to map UID 0" in a moment.
Perhaps you may also have some review comments there.

Cheers,

Michael


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH 25/32] pipe.7: also mention writev(2) in atomicity sexion
  2021-07-28 20:20 ` [PATCH 25/32] pipe.7: also mention writev(2) in atomicity sexion Alejandro Colomar
@ 2021-08-08  9:30   ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 92+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-08-08  9:30 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, наб, linux-man

Hello наб and Alex,

On 7/28/21 10:20 PM, Alejandro Colomar wrote:
> From: наб <nabijaczleweli@nabijaczleweli.xyz>
> 
> writev(2) notes that buffers don't interleave with other process'
> (a reasonable question to ask), but points to pipe(7) for an exception.
> pipe(7) did /not/ mention "writev", "iov", "scat", or "gath", which are,
> in order, reasonable search terms: this was confusing at best and
> alarming at worst
> 
> By mentioning writev(2) in the heading, we clearly note that this sort
> of interleaving behaviour matches write(2)'s and isn't a concern
> 
> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
> ---
>  man7/pipe.7 | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/man7/pipe.7 b/man7/pipe.7
> index c3210320c..29f6cf6cb 100644
> --- a/man7/pipe.7
> +++ b/man7/pipe.7
> @@ -246,6 +246,8 @@ limits; see BUGS.
>  .SS PIPE_BUF
>  POSIX.1 says that
>  .BR write (2)s
> +and
> +.BR writev (2)s
>  of less than
>  .B PIPE_BUF
>  bytes must be atomic: the output data is written to the pipe as a

I think a different fix is required. On reflection, I don't think the
reference to pipe(7) is needed in writev(2) (mea culpa; I added that
text), and I think the text in pipe(7) could be written to be closer
to the POSIX spec, which doesn't talk about "write() calls", but
simply about "writes". See below.

Cheers,

Michael

commit 0602a20452d7abde429bc46215b203160ab70ec0 (HEAD -> master)
Author: Michael Kerrisk <mtk.manpages@gmail.com>
Date:   Sun Aug 8 11:24:16 2021 +0200

    readv.2, pipe.7: Make text on pipe writes more general to avoid a confusion in writev(2)
    
    After a patch proposal from наб triggered by concerns that, when
    talking about PIPE_BUF, pipe(7) explicitly mentions write(2) but
    not writev(2), I've concluded that the reference in writev(2) to
    pipe(7) is not needed (mea culpa; I added that text), and I think
    the text in pipe(7) could be written to be closer to the POSIX
    spec, which doesn't talk about "write() calls", but simply about
    "writes".
    
    Reported-by: наб <nabijaczleweli@nabijaczleweli.xyz>
    Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>

diff --git a/man2/readv.2 b/man2/readv.2
index bd0a6cd2f..c066c73a5 100644
--- a/man2/readv.2
+++ b/man2/readv.2
@@ -141,9 +141,7 @@ are atomic: the data written by
 .\" Regarding atomicity, see https://bugzilla.kernel.org/show_bug.cgi?id=10596
 .BR writev ()
 is written as a single block that is not intermingled with output
-from writes in other processes (but see
-.BR pipe (7)
-for an exception);
+from writes in other processes;
 analogously,
 .BR readv ()
 is guaranteed to read a contiguous block of data from the file,
diff --git a/man7/pipe.7 b/man7/pipe.7
index c3210320c..d79768fb6 100644
--- a/man7/pipe.7
+++ b/man7/pipe.7
@@ -244,9 +244,7 @@ and
 limits; see BUGS.
 .\"
 .SS PIPE_BUF
-POSIX.1 says that
-.BR write (2)s
-of less than
+POSIX.1 says that writes of less than
 .B PIPE_BUF
 bytes must be atomic: the output data is written to the pipe as a
 contiguous sequence.


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply related	[flat|nested] 92+ messages in thread

* Re: [PATCH 30/32] strlen.3, wcslen.3: Add recommendations for safer variants
  2021-08-08  0:16     ` Alejandro Colomar (man-pages)
  2021-08-08  1:20       ` Michael Kerrisk (man-pages)
@ 2021-08-08 19:44       ` Jonny Grant
  1 sibling, 0 replies; 92+ messages in thread
From: Jonny Grant @ 2021-08-08 19:44 UTC (permalink / raw)
  To: Alejandro Colomar (man-pages), Michael Kerrisk (man-pages); +Cc: linux-man



On 08/08/2021 01:16, Alejandro Colomar (man-pages) wrote:
> Hi, Michael!
> 
> On 8/8/21 1:45 AM, Michael Kerrisk (man-pages) wrote:
>> Hello Alex,
>>
>> I see there was a rather long mail thread that led
>> to this patch. The patch definitely deserves a commit
>> message.
>>
>> See also below.
>> On 7/28/21 10:20 PM, Alejandro Colomar wrote:
>>> Reported-by: Jonny Grant <jg@jguk.org>
>>> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
>>> ---
>>>  man3/strlen.3 | 6 ++++++
>>>  man3/wcslen.3 | 9 ++++++++-
>>>  2 files changed, 14 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/man3/strlen.3 b/man3/strlen.3
>>> index dea4c1050..78783c446 100644
>>> --- a/man3/strlen.3
>>> +++ b/man3/strlen.3
>>> @@ -66,6 +66,12 @@ T}	Thread safety	MT-Safe
>>>  .sp 1
>>>  .SH CONFORMING TO
>>>  POSIX.1-2001, POSIX.1-2008, C89, C99, C11, SVr4, 4.3BSD.
>>> +.SH NOTES
>>> +.SS strnlen(3)
>>> +If the input buffer size is known,
>>> +it is probably better to use
>>> +.BR strnlen (3),
>>> +which can prevent reading past the end of the array.
>>
>> I hesitate slightly about this. strlen() is in the C standard, but
>> strnlen() is not. What do you think; do we need to care?
> 
> I have some doubts about this patch, but in a completely different sense:
> 
> I don't know if I'm being a bit paranoid in treating user input.  I've
> always been taught that I should program deffensively, but as time
> passes by, I realize myself that I was programming too much
> deffensively, and even introducing bugs in the error handling code.  And
> in many cases, strings will always be NUL-terminated, so maybe I'm just
> passing around a wrong recommendation.

Seems very important to check.. there are lots of standards that require checking such things. eg ISO 26262 Functional Safety Standard

I know we all know already that many bugs are caused by overruns. A NULL ptr dereference would crash the software. That's a kind of DoS.

Just imagine someone connects a USB device (or any other different) which has a badly formed string, that is not NUL terminated. Or even gets a pointer from HW that is NULL. Unless we check the pointer, the string, we won't know. Typically it will be fine, until it isn't. Users don't want a core dump, they don't want to file a bug report. It's easy enough just to check it is what we expect.  We also check numbers are not zero when dividing by a number to avoid SIGFPE when that number came from an external place outside our module.

Cheers, Jonny



^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH 28/32] sigaction.2: Document SA_EXPOSE_TAGBITS and the flag support detection protocol
  2021-07-28 20:20 ` [PATCH 28/32] sigaction.2: Document SA_EXPOSE_TAGBITS and the flag support detection protocol Alejandro Colomar
@ 2021-08-08 21:32   ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 92+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-08-08 21:32 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, Peter Collingbourne, linux-man

Dropped, because reposted in a later series from Alex.


On 7/28/21 10:20 PM, Alejandro Colomar wrote:
> From: Peter Collingbourne <pcc@google.com>
> 
> Signed-off-by: Peter Collingbourne <pcc@google.com>
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
> ---
>  man2/sigaction.2 | 123 +++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 123 insertions(+)
> 
> diff --git a/man2/sigaction.2 b/man2/sigaction.2
> index 57ad6418c..4bf6f095e 100644
> --- a/man2/sigaction.2
> +++ b/man2/sigaction.2
> @@ -261,6 +261,44 @@ This flag is meaningful only when establishing a signal handler.
>  .\" .I sa_sigaction
>  .\" field was added in Linux 2.1.86.)
>  .\"
> +.TP
> +.B SA_UNSUPPORTED
> +Used to dynamically probe for flag bit support.
> +.IP
> +If an attempt to register a handler succeeds with this flag set in
> +.I act->sa_flags
> +alongside other flags that are potentially unsupported by the kernel,
> +and an immediately subsequent
> +.BR sigaction ()
> +call specifying the same signal number n and with non-NULL
> +.I oldact
> +yields
> +.B SA_UNSUPPORTED
> +.I clear
> +in
> +.IR oldact->sa_flags ,
> +then
> +.I oldact->sa_flags
> +may be used as a bitmask
> +describing which of the potentially unsupported flags are,
> +in fact, supported.
> +See the section "Dynamically probing for flag bit support"
> +below for more details.
> +.TP
> +.BR SA_EXPOSE_TAGBITS " (since Linux 5.11)"
> +Normally, when delivering a signal,
> +an architecture-specific set of tag bits are cleared from the
> +.I si_addr
> +field of
> +.IR siginfo_t .
> +If this flag is set,
> +an architecture-specific subset of the tag bits will be preserved in
> +.IR si_addr .
> +.IP
> +Programs that need to be compatible with Linux versions older than 5.11
> +must use
> +.B SA_UNSUPPORTED
> +to probe for support.
>  .SS The siginfo_t argument to a SA_SIGINFO handler
>  When the
>  .B SA_SIGINFO
> @@ -846,6 +884,91 @@ Triggered by a
>  .BR seccomp (2)
>  filter rule.
>  .RE
> +.SS Dynamically probing for flag bit support
> +The
> +.BR sigaction ()
> +call on Linux accepts unknown bits set in
> +.I act->sa_flags
> +without error.
> +The behavior of the kernel starting with Linux 5.11 is that a second
> +.BR sigaction ()
> +will clear unknown bits from
> +.IR oldact->sa_flags .
> +However, historically, a second
> +.BR sigaction ()
> +call would typically leave those bits set in
> +.IR oldact->sa_flags .
> +.PP
> +This means that support for new flags cannot be detected
> +simply by testing for a flag in
> +.IR sa_flags ,
> +and a program must test that
> +.B SA_UNSUPPORTED
> +has been cleared before relying on the contents of
> +.IR sa_flags .
> +.PP
> +Since the behavior of the signal handler cannot be guaranteed
> +unless the check passes,
> +it is wise to either block the affected signal
> +while registering the handler and performing the check in this case,
> +or where this is not possible,
> +for example if the signal is synchronous, to issue the second
> +.BR sigaction ()
> +in the signal handler itself.
> +.PP
> +In kernels that do not support a specific flag,
> +the kernel's behavior is as if the flag was not set,
> +even if the flag was set in
> +.IR act->sa_flags .
> +.PP
> +The flags
> +.BR SA_NOCLDSTOP ,
> +.BR SA_NOCLDWAIT ,
> +.BR SA_SIGINFO ,
> +.BR SA_ONSTACK ,
> +.BR SA_RESTART ,
> +.BR SA_NODEFER ,
> +.BR SA_RESETHAND ,
> +and, if defined by the architecture,
> +.B SA_RESTORER
> +may not be reliably probed for using this mechanism,
> +because they were introduced before Linux 5.11.
> +However, in general, programs may assume that these flags are supported,
> +since they have all been supported since Linux 2.6,
> +which was released in the year 2003.
> +.PP
> +The following example program exits with status 0 if
> +.B SA_EXPOSE_TAGBITS
> +is determined to be supported, and 1 otherwise.
> +.PP
> +.EX
> +#include <signal.h>
> +#include <stdio.h>
> +#include <unistd.h>
> +
> +void handler(int signo, siginfo_t *info, void *context) {
> +    struct sigaction oldact;
> +    if (sigaction(SIGSEGV, 0, &oldact) == 0 &&
> +        !(oldact.sa_flags & SA_UNSUPPORTED) &&
> +        (oldact.sa_flags & SA_EXPOSE_TAGBITS)) {
> +        _exit(0);
> +    } else {
> +        _exit(1);
> +    }
> +}
> +
> +int main(void) {
> +    struct sigaction act = {0};
> +    act.sa_flags = SA_SIGINFO | SA_UNSUPPORTED | SA_EXPOSE_TAGBITS;
> +    act.sa_sigaction = handler;
> +    if (sigaction(SIGSEGV, &act, 0) != 0) {
> +        perror("sigaction");
> +        return 1;
> +    }
> +
> +    raise(SIGSEGV);
> +}
> +.EE
>  .SH RETURN VALUE
>  .BR sigaction ()
>  returns 0 on success; on error, \-1 is returned, and
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH 29/32] sigaction.2: Apply minor tweaks to Peter's patch
  2021-07-28 20:20 ` [PATCH 29/32] sigaction.2: Apply minor tweaks to Peter's patch Alejandro Colomar
  2021-07-29 11:14   ` Alejandro Colomar (man-pages)
@ 2021-08-08 21:32   ` Michael Kerrisk (man-pages)
  1 sibling, 0 replies; 92+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-08-08 21:32 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, linux-man

Dropped, because reposted in a later series from Alex.

On 7/28/21 10:20 PM, Alejandro Colomar wrote:
> - Move example program to a new EXAMPLES section
> - Invert logic in the handler to have the failure in the conditional path,
>   and the success in out of any conditionals.
> - Use NULL, EXIT_SUCCESS, and EXIT_FAILURE instead of magic numbers
> - Separate declarations from code
> - Put function return type on its own line
> - Put function opening brace on its line
> 
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
> ---
>  man2/sigaction.2 | 76 +++++++++++++++++++++++++++---------------------
>  1 file changed, 43 insertions(+), 33 deletions(-)
> 
> diff --git a/man2/sigaction.2 b/man2/sigaction.2
> index 4bf6f095e..18404dde1 100644
> --- a/man2/sigaction.2
> +++ b/man2/sigaction.2
> @@ -936,39 +936,6 @@ because they were introduced before Linux 5.11.
>  However, in general, programs may assume that these flags are supported,
>  since they have all been supported since Linux 2.6,
>  which was released in the year 2003.
> -.PP
> -The following example program exits with status 0 if
> -.B SA_EXPOSE_TAGBITS
> -is determined to be supported, and 1 otherwise.
> -.PP
> -.EX
> -#include <signal.h>
> -#include <stdio.h>
> -#include <unistd.h>
> -
> -void handler(int signo, siginfo_t *info, void *context) {
> -    struct sigaction oldact;
> -    if (sigaction(SIGSEGV, 0, &oldact) == 0 &&
> -        !(oldact.sa_flags & SA_UNSUPPORTED) &&
> -        (oldact.sa_flags & SA_EXPOSE_TAGBITS)) {
> -        _exit(0);
> -    } else {
> -        _exit(1);
> -    }
> -}
> -
> -int main(void) {
> -    struct sigaction act = {0};
> -    act.sa_flags = SA_SIGINFO | SA_UNSUPPORTED | SA_EXPOSE_TAGBITS;
> -    act.sa_sigaction = handler;
> -    if (sigaction(SIGSEGV, &act, 0) != 0) {
> -        perror("sigaction");
> -        return 1;
> -    }
> -
> -    raise(SIGSEGV);
> -}
> -.EE
>  .SH RETURN VALUE
>  .BR sigaction ()
>  returns 0 on success; on error, \-1 is returned, and
> @@ -1174,6 +1141,49 @@ This bug was fixed in kernel 2.6.14.
>  .SH EXAMPLES
>  See
>  .BR mprotect (2).
> +.PP
> +The following example program exits with status
> +.B EXIT_SUCCESS
> +if
> +.B SA_EXPOSE_TAGBITS
> +is determined to be supported, and
> +.B EXIT_FAILURE
> +otherwise.
> +.PP
> +.EX
> +#include <signal.h>
> +#include <stdlib.h>
> +#include <stdio.h>
> +#include <unistd.h>
> +
> +void
> +handler(int signo, siginfo_t *info, void *context)
> +{
> +    struct sigaction oldact;
> +
> +    if (sigaction(SIGSEGV, NULL, &oldact) != 0 ||
> +        (oldact.sa_flags & SA_UNSUPPORTED) ||
> +        !(oldact.sa_flags & SA_EXPOSE_TAGBITS)) {
> +        _exit(EXIT_FAILURE);
> +    }
> +    _exit(EXIT_SUCCESS);
> +}
> +
> +int
> +main(void)
> +{
> +    struct sigaction act = {0};
> +
> +    act.sa_flags = SA_SIGINFO | SA_UNSUPPORTED | SA_EXPOSE_TAGBITS;
> +    act.sa_sigaction = &handler;
> +    if (sigaction(SIGSEGV, &act, NULL) != 0) {
> +        perror("sigaction");
> +        exit(EXIT_FAILURE);
> +    }
> +
> +    raise(SIGSEGV);
> +}
> +.EE
>  .SH SEE ALSO
>  .BR kill (1),
>  .BR kill (2),
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH 00/32] Patches from others
  2021-07-28 20:19 [PATCH 00/32] Patches from others Alejandro Colomar
                   ` (31 preceding siblings ...)
  2021-07-28 20:20 ` [PATCH 32/32] execve.2: Fix absolute/relative pathname Alejandro Colomar
@ 2021-08-08 21:34 ` Michael Kerrisk (man-pages)
  32 siblings, 0 replies; 92+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-08-08 21:34 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, linux-man

On 7/28/21 10:19 PM, Alejandro Colomar wrote:
> Hi Michael,
> 
> Here is a patch set including patches from others, patches of mine fixing
> bug reports of others, tweaks to others' patches, and small patches of mine.
> 
> I resent in this patch set all the patches that I sent a few weeks ago,
> so you can ignore any older threads of mine.

Hi Alex,

I think I've now dealt with all of tese, except for two 
that you reposted in a following series.

Thanks for taking care of all of these patches!

Cheers,

Michael

> --
> 
> 
> Alejandro Colomar (11):
>   readv.2: Minor tweaks to Will's patch
>   vdso.7: Remove outdated limitation for powerpc
>   vdso.7: Add y2038 compliant gettime for ppc/32
>   posixoptions.7: Fix legacy functions list (s/getcwd/getwd/)
>   printf.3: wfix
>   futex.2: Minor tweaks to Kurt's patch
>   capabilities.7: Minor tweaks to Kir's patch
>   seccomp_unotify.2: Minor tweaks to Rodrigo's patch
>   strstr.3: Add special case for empty needle
>   sigaction.2: Apply minor tweaks to Peter's patch
>   strlen.3, wcslen.3: Add recommendations for safer variants
> 
> Dan Robertson (1):
>   man2/fallocate.2: tfix documentation of shared blocks
> 
> Jakub Wilk (3):
>   seccomp_unotify.2: tfix
>   proc.5: tfix
>   scripts/bash_aliases: tfix
> 
> Kir Kolyshkin (3):
>   capabilities.7: tfix
>   user_namespaces.7: fix a ref
>   capabilities.7, user_namespaces.7: describe CAP_SETFCAP
> 
> Kurt Kanzenbach (1):
>   futex.2: Document FUTEX_LOCK_PI2
> 
> Peter Collingbourne (1):
>   sigaction.2: Document SA_EXPOSE_TAGBITS and the flag support detection
>     protocol
> 
> Richard Palethorpe (1):
>   wait.2: Add ESRCH for when pid == INT_MIN
> 
> Rodrigo Campos (1):
>   seccomp_unotify.2: Add doc for SECCOMP_ADDFD_FLAG_SEND
> 
> Sagar Patel (1):
>   tkill.2: tfix
> 
> Shawn Landden (1):
>   execve.2: Fix absolute/relative pathname
> 
> Thomas Voss (1):
>   Various pages: Consistently use '*argv[]'
> 
> Viet Than (1):
>   time.2: wfix regarding year-2038
> 
> Will Manley (1):
>   readv2: Note preadv2(..., RWF_NOWAIT) bug in BUGS section
> 
> kXuan (1):
>   recv.2: tfix
> 
> Štěpán Němec (2):
>   path_resolution.7: tfix
>   namespaces.7: fix confusion caused by text reorganization
> 
> наб (2):
>   ascii.7: add vertical rule to separate the two columns
>   pipe.7: also mention writev(2) in atomicity sexion
> 
>  man2/bpf.2                |   2 +-
>  man2/copy_file_range.2    |   2 +-
>  man2/execve.2             |   9 ++-
>  man2/fallocate.2          |   2 +-
>  man2/futex.2              | 110 +++++++++++++++++++++----------
>  man2/membarrier.2         |   4 +-
>  man2/perf_event_open.2    |   2 +-
>  man2/readv.2              |  11 +++-
>  man2/recv.2               |   2 +-
>  man2/seccomp.2            |   2 +-
>  man2/seccomp_unotify.2    |  30 ++++++++-
>  man2/sigaction.2          | 133 ++++++++++++++++++++++++++++++++++++++
>  man2/time.2               |   2 +-
>  man2/tkill.2              |   2 +-
>  man2/wait.2               |   9 +++
>  man3/bsearch.3            |   2 +-
>  man3/getopt.3             |   2 +-
>  man3/getsubopt.3          |   2 +-
>  man3/printf.3             |   2 +-
>  man3/pthread_setname_np.3 |   2 +-
>  man3/strlen.3             |   6 ++
>  man3/strstr.3             |   8 +++
>  man3/wcslen.3             |   9 ++-
>  man3/wordexp.3            |   2 +-
>  man5/proc.5               |   2 +-
>  man7/ascii.7              |   2 +-
>  man7/capabilities.7       |   9 ++-
>  man7/fanotify.7           |   2 +-
>  man7/namespaces.7         |   4 +-
>  man7/path_resolution.7    |   2 +-
>  man7/pipe.7               |   2 +
>  man7/posixoptions.7       |   2 +-
>  man7/user_namespaces.7    |   8 ++-
>  man7/vdso.7               |  27 +-------
>  scripts/bash_aliases      |   2 +-
>  35 files changed, 330 insertions(+), 89 deletions(-)
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH 16/32] seccomp_unotify.2: Add doc for SECCOMP_ADDFD_FLAG_SEND
  2021-08-08  1:01   ` Michael Kerrisk (man-pages)
@ 2021-08-09  9:42     ` Rodrigo Campos
  0 siblings, 0 replies; 92+ messages in thread
From: Rodrigo Campos @ 2021-08-09  9:42 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages); +Cc: Alejandro Colomar, linux-man

On Sun, Aug 8, 2021 at 3:01 AM Michael Kerrisk (man-pages)
<mtk.manpages@gmail.com> wrote:
>
> Hello Rodrigo, Alex,
>
> On 7/28/21 10:19 PM, Alejandro Colomar wrote:
> > From: Rodrigo Campos <rodrigo@kinvolk.io>
> >
> > This flag was recently added to Linux 5.14 by a patch I wrote:
> >       https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0ae71c7720e3ae3aabd2e8a072d27f7bd173d25c
> >
> > This patch adds documentation for the flag, the error code that the flag
> > added and explains in the caveat when it is useful.
>
> Thanks for taking the time to write this patch!
>
> Patch applied.

Thanks! It is great to verify that the explanation is indeed clear to
others too! :)

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH 07/32] printf.3: wfix
  2021-08-07 23:10         ` Michael Kerrisk (man-pages)
@ 2021-08-11 20:55           ` Sergey Petrakov
  2021-08-11 22:33             ` Michael Kerrisk (man-pages)
  0 siblings, 1 reply; 92+ messages in thread
From: Sergey Petrakov @ 2021-08-11 20:55 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages); +Cc: Alejandro Colomar (man-pages), linux-man

Hello Michael and Alex,

On Sunday, August 8th, 2021 at 02:10, Michael Kerrisk (man-pages) <mtk.manpages@gmail.com> wrote:
> Hello Alex,
>
> On 8/8/21 12:32 AM, Alejandro Colomar (man-pages) wrote:
>
> > On 8/8/21 12:20 AM, Alejandro Colomar (man-pages) wrote:
> >
> > > stdio (7)', and it's only a ffix.
> >
> > s/7/3/
>
> I dropped the original patch, and made ir
>
> .BR stdio (3)
>
> This is a case where it would have been good to ask the
> proposer for a commit message explaining the motivation for
> the original patch (when that patch was submitted).

A few paragraphs at the beginning of the description section
of printf(3) briefly describe the functions in the printf()
family. In these paragraphs, a word in italics almost always
represents a token of C source code:
1) the identifier (format, stream, str, fd, size, ap) or the
   type (va_list) of a parameter in the function declarations
   at the top of the man page;
2) the identifier (va_end, va_arg) for a function-like macro;
3) the identifier (stdout) for the standard output stream.

There is one exception to this rule - stdio. This word
represents a library, not a token. It's not a big problem,
of course, but I think that similar formatting of different
things may be confusing.

The original patch was an attempt to fix this issue. The final
one (by Michael Kerrisk):

-.I stdio
+.BR stdio (3)

is a more suitable solution.

I'm sorry that I didn't include this explanation in the
initial email.

--

Regards,
Sergey Petrakov

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH 07/32] printf.3: wfix
  2021-08-11 20:55           ` Sergey Petrakov
@ 2021-08-11 22:33             ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 92+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-08-11 22:33 UTC (permalink / raw)
  To: Sergey Petrakov; +Cc: Alejandro Colomar (man-pages), linux-man

Hello Sergey,

[...]

> I'm sorry that I didn't include this explanation in the
> initial email.

No problem. We're all learning...

Cheers,

Michael

-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 92+ messages in thread

end of thread, other threads:[~2021-08-11 22:34 UTC | newest]

Thread overview: 92+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-28 20:19 [PATCH 00/32] Patches from others Alejandro Colomar
2021-07-28 20:19 ` [PATCH 01/32] readv2: Note preadv2(..., RWF_NOWAIT) bug in BUGS section Alejandro Colomar
2021-08-08  2:29   ` Michael Kerrisk (man-pages)
2021-07-28 20:19 ` [PATCH 02/32] readv.2: Minor tweaks to Will's patch Alejandro Colomar
2021-08-08  2:30   ` Michael Kerrisk (man-pages)
2021-08-08  2:42     ` Michael Kerrisk (man-pages)
2021-07-28 20:19 ` [PATCH 03/32] vdso.7: Remove outdated limitation for powerpc Alejandro Colomar
2021-08-08  0:17   ` Michael Kerrisk (man-pages)
2021-08-08  0:21     ` Alejandro Colomar (man-pages)
2021-07-28 20:19 ` [PATCH 04/32] vdso.7: Add y2038 compliant gettime for ppc/32 Alejandro Colomar
2021-08-08  0:48   ` Michael Kerrisk (man-pages)
2021-08-08  1:01     ` Alejandro Colomar (man-pages)
2021-08-08  2:25       ` Michael Kerrisk (man-pages)
2021-08-08  2:22   ` Michael Kerrisk (man-pages)
2021-07-28 20:19 ` [PATCH 05/32] posixoptions.7: Fix legacy functions list (s/getcwd/getwd/) Alejandro Colomar
2021-08-08  0:55   ` Michael Kerrisk (man-pages)
2021-07-28 20:19 ` [PATCH 06/32] man2/fallocate.2: tfix documentation of shared blocks Alejandro Colomar
2021-08-08  0:54   ` Michael Kerrisk (man-pages)
2021-07-28 20:19 ` [PATCH 07/32] printf.3: wfix Alejandro Colomar
2021-08-07 21:34   ` Michael Kerrisk (man-pages)
2021-08-07 22:20     ` Alejandro Colomar (man-pages)
2021-08-07 22:32       ` Alejandro Colomar (man-pages)
2021-08-07 23:10         ` Michael Kerrisk (man-pages)
2021-08-11 20:55           ` Sergey Petrakov
2021-08-11 22:33             ` Michael Kerrisk (man-pages)
2021-07-28 20:19 ` [PATCH 08/32] Various pages: Consistently use '*argv[]' Alejandro Colomar
2021-08-07 21:35   ` Michael Kerrisk (man-pages)
2021-07-28 20:19 ` [PATCH 09/32] path_resolution.7: tfix Alejandro Colomar
2021-08-07 21:37   ` Michael Kerrisk (man-pages)
2021-07-28 20:19 ` [PATCH 10/32] futex.2: Document FUTEX_LOCK_PI2 Alejandro Colomar
2021-07-29 10:18   ` Alejandro Colomar (man-pages)
2021-08-07 21:38     ` Michael Kerrisk (man-pages)
2021-07-28 20:19 ` [PATCH 11/32] futex.2: Minor tweaks to Kurt's patch Alejandro Colomar
2021-07-29 10:24   ` Alejandro Colomar (man-pages)
2021-08-07 21:38     ` Michael Kerrisk (man-pages)
2021-07-28 20:19 ` [PATCH 12/32] capabilities.7: tfix Alejandro Colomar
2021-08-07 21:39   ` Michael Kerrisk (man-pages)
2021-07-28 20:19 ` [PATCH 13/32] user_namespaces.7: fix a ref Alejandro Colomar
2021-08-07 21:40   ` Michael Kerrisk (man-pages)
2021-07-28 20:19 ` [PATCH 14/32] capabilities.7, user_namespaces.7: describe CAP_SETFCAP Alejandro Colomar
2021-08-08  2:54   ` Michael Kerrisk (man-pages)
2021-08-08  9:09   ` Michael Kerrisk (man-pages)
2021-07-28 20:19 ` [PATCH 15/32] capabilities.7: Minor tweaks to Kir's patch Alejandro Colomar
2021-07-29 11:16   ` Alejandro Colomar (man-pages)
2021-08-08  3:03   ` Michael Kerrisk (man-pages)
2021-07-28 20:19 ` [PATCH 16/32] seccomp_unotify.2: Add doc for SECCOMP_ADDFD_FLAG_SEND Alejandro Colomar
2021-08-08  1:01   ` Michael Kerrisk (man-pages)
2021-08-09  9:42     ` Rodrigo Campos
2021-07-28 20:19 ` [PATCH 17/32] seccomp_unotify.2: Minor tweaks to Rodrigo's patch Alejandro Colomar
2021-07-29 11:15   ` Alejandro Colomar (man-pages)
2021-08-08  1:13   ` Michael Kerrisk (man-pages)
2021-08-08  1:22     ` Alejandro Colomar (man-pages)
2021-07-28 20:19 ` [PATCH 18/32] recv.2: tfix Alejandro Colomar
2021-08-07 21:43   ` Michael Kerrisk (man-pages)
2021-07-28 20:19 ` [PATCH 19/32] ascii.7: add vertical rule to separate the two columns Alejandro Colomar
2021-08-07 22:46   ` Michael Kerrisk (man-pages)
2021-07-28 20:19 ` [PATCH 20/32] wait.2: Add ESRCH for when pid == INT_MIN Alejandro Colomar
2021-08-07 23:05   ` Michael Kerrisk (man-pages)
2021-07-28 20:19 ` [PATCH 21/32] seccomp_unotify.2: tfix Alejandro Colomar
2021-08-08  1:13   ` Michael Kerrisk (man-pages)
2021-07-28 20:19 ` [PATCH 22/32] proc.5: tfix Alejandro Colomar
2021-08-07 22:55   ` Michael Kerrisk (man-pages)
2021-07-28 20:19 ` [PATCH 23/32] scripts/bash_aliases: tfix Alejandro Colomar
2021-08-07 22:47   ` Michael Kerrisk (man-pages)
2021-07-28 20:20 ` [PATCH 24/32] namespaces.7: fix confusion caused by text reorganization Alejandro Colomar
2021-08-07 23:48   ` Michael Kerrisk (man-pages)
2021-07-28 20:20 ` [PATCH 25/32] pipe.7: also mention writev(2) in atomicity sexion Alejandro Colomar
2021-08-08  9:30   ` Michael Kerrisk (man-pages)
2021-07-28 20:20 ` [PATCH 26/32] tkill.2: tfix Alejandro Colomar
2021-08-07 22:48   ` Michael Kerrisk (man-pages)
2021-07-28 20:20 ` [PATCH 27/32] strstr.3: Add special case for empty needle Alejandro Colomar
2021-08-07 23:53   ` Michael Kerrisk (man-pages)
2021-07-28 20:20 ` [PATCH 28/32] sigaction.2: Document SA_EXPOSE_TAGBITS and the flag support detection protocol Alejandro Colomar
2021-08-08 21:32   ` Michael Kerrisk (man-pages)
2021-07-28 20:20 ` [PATCH 29/32] sigaction.2: Apply minor tweaks to Peter's patch Alejandro Colomar
2021-07-29 11:14   ` Alejandro Colomar (man-pages)
2021-08-08 21:32   ` Michael Kerrisk (man-pages)
2021-07-28 20:20 ` [PATCH 30/32] strlen.3, wcslen.3: Add recommendations for safer variants Alejandro Colomar
2021-08-07 23:45   ` Michael Kerrisk (man-pages)
2021-08-08  0:04     ` Alejandro Colomar (man-pages)
2021-08-08  0:16     ` Alejandro Colomar (man-pages)
2021-08-08  1:20       ` Michael Kerrisk (man-pages)
2021-08-08  1:24         ` Alejandro Colomar (man-pages)
2021-08-08  2:18           ` Michael Kerrisk (man-pages)
2021-08-08 19:44       ` Jonny Grant
2021-07-28 20:20 ` [PATCH 31/32] time.2: wfix regarding year-2038 Alejandro Colomar
2021-07-29 10:45   ` G. Branden Robinson
2021-07-30  1:25     ` Viet Than
2021-08-07 23:59       ` Michael Kerrisk (man-pages)
2021-07-28 20:20 ` [PATCH 32/32] execve.2: Fix absolute/relative pathname Alejandro Colomar
2021-08-08  2:02   ` Michael Kerrisk (man-pages)
2021-08-08 21:34 ` [PATCH 00/32] Patches from others Michael Kerrisk (man-pages)

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.