]> git.ipfire.org Git - thirdparty/man-pages.git/log
thirdparty/man-pages.git
4 years agoposixoptions.7: Fix legacy functions list (s/getcwd/getwd/)
Alejandro Colomar [Wed, 28 Jul 2021 20:19:41 +0000 (22:19 +0200)] 
posixoptions.7: Fix legacy functions list (s/getcwd/getwd/)

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.
]

mtk: confirmed by reviewing the table ("Removed Functions and
Symbols in Issue 7") at the end of Section B.1.1 on page
3564 of IEEE Std 1003.1, 2016 Edition.

Reported-by: Alan Peakall <Alan.Peakall@helpsystems.com>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agovdso.7: srcfix
Michael Kerrisk [Sun, 8 Aug 2021 00:16:30 +0000 (02:16 +0200)] 
vdso.7: srcfix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agovdso.7: Update CLOCK_REALTIME_COARSE and CLOCK_MONOTONIC_COARSE info for powerpc
Michael Kerrisk [Sun, 8 Aug 2021 00:13:49 +0000 (02:13 +0200)] 
vdso.7: Update CLOCK_REALTIME_COARSE and CLOCK_MONOTONIC_COARSE info for powerpc

See https://bugzilla.kernel.org/show_bug.cgi?id=213419
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: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agotime.2: wfix regarding year-2038
Viet Than [Sat, 7 Aug 2021 23:58:24 +0000 (01:58 +0200)] 
time.2: wfix regarding year-2038

Signed-off-by: Viet Than <thanhoangviet@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agostrstr.3: wfix
Michael Kerrisk [Sat, 7 Aug 2021 23:52:08 +0000 (01:52 +0200)] 
strstr.3: wfix

Remove text that is probably redundant.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agostrstr.3: Document special case for empty needle
Alejandro Colomar [Wed, 28 Jul 2021 20:20:03 +0000 (22:20 +0200)] 
strstr.3: Document special case for empty needle

Reported-by: Stefan Kanthak <stefan.kanthak@nexgo.de>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agonamespaces.7: Fix confusion caused by text reorganization
Štěpán Němec [Wed, 28 Jul 2021 20:20:00 +0000 (22:20 +0200)] 
namespaces.7: Fix confusion caused by text reorganization

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>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoprintf.3: tfix
Michael Kerrisk [Sat, 7 Aug 2021 23:08:01 +0000 (01:08 +0200)] 
printf.3: tfix

Reported-by: Sergey Petrakov <kr@spmail.info>
Reported-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agowait.2: Minor fixes to Richard Palethorpe's patch
Michael Kerrisk [Sat, 7 Aug 2021 23:04:04 +0000 (01:04 +0200)] 
wait.2: Minor fixes to Richard Palethorpe's patch

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agowait.2: Add ESRCH for when pid == INT_MIN
Richard Palethorpe [Wed, 28 Jul 2021 20:19:56 +0000 (22:19 +0200)] 
wait.2: Add ESRCH for when pid == INT_MIN

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>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoproc.5: tfix
Jakub Wilk [Wed, 28 Jul 2021 20:19:58 +0000 (22:19 +0200)] 
proc.5: tfix

Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agotkill.2: tfix
Sagar Patel [Wed, 28 Jul 2021 20:20:02 +0000 (22:20 +0200)] 
tkill.2: tfix

Correct function signature by adding missing parenthesis.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoscripts/bash_aliases: tfix
Jakub Wilk [Wed, 28 Jul 2021 20:19:59 +0000 (22:19 +0200)] 
scripts/bash_aliases: tfix

Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoascii.7: ffix: add vertical rule to separate the two columns
наб [Wed, 28 Jul 2021 20:19:55 +0000 (22:19 +0200)] 
ascii.7: ffix: add vertical rule to separate the two columns

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>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agorecv.2: tfix
kXuan [Wed, 28 Jul 2021 20:19:54 +0000 (22:19 +0200)] 
recv.2: tfix

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>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agouser_namespaces.7: Fix a reference to a kernel document
Kir Kolyshkin [Wed, 28 Jul 2021 20:19:49 +0000 (22:19 +0200)] 
user_namespaces.7: Fix a reference to a kernel document

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>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agocapabilities.7: tfix
Kir Kolyshkin [Wed, 28 Jul 2021 20:19:48 +0000 (22:19 +0200)] 
capabilities.7: tfix

Add a missing comma.

Fixes: 3dcdef9437fafb
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agopath_resolution.7: tfix
Štěpán Němec [Wed, 28 Jul 2021 20:19:45 +0000 (22:19 +0200)] 
path_resolution.7: tfix

Signed-off-by: Štěpán Němec <stepnem@gmail.com>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoVarious pages: Consistently use '*argv[]'
Thomas Voss [Wed, 28 Jul 2021 20:19:44 +0000 (22:19 +0200)] 
Various pages: Consistently use '*argv[]'

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>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoioctl_tty.2: wfix
Michael Kerrisk [Sun, 25 Jul 2021 23:19:09 +0000 (01:19 +0200)] 
ioctl_tty.2: wfix

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoioctl_tty.2: wfix
Michael Kerrisk [Sun, 25 Jul 2021 23:18:02 +0000 (01:18 +0200)] 
ioctl_tty.2: wfix

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoioctl_tty.2: ffix
Michael Kerrisk [Sun, 25 Jul 2021 23:16:29 +0000 (01:16 +0200)] 
ioctl_tty.2: ffix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoioctl_tty.2: srcfix
Michael Kerrisk [Sun, 25 Jul 2021 23:12:37 +0000 (01:12 +0200)] 
ioctl_tty.2: srcfix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoioctl_tty.2: tfix
Michael Kerrisk [Sun, 25 Jul 2021 23:12:03 +0000 (01:12 +0200)] 
ioctl_tty.2: tfix

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agommap.2: wfix
Michael Kerrisk [Sun, 25 Jul 2021 23:05:53 +0000 (01:05 +0200)] 
mmap.2: wfix

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agormdir.2: tfix
Michael Kerrisk [Sun, 25 Jul 2021 23:02:36 +0000 (01:02 +0200)] 
rmdir.2: tfix

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoshmop.2: wfix
Michael Kerrisk [Sun, 25 Jul 2021 22:59:55 +0000 (00:59 +0200)] 
shmop.2: wfix

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agorename.2: wfix
Michael Kerrisk [Sun, 25 Jul 2021 22:58:11 +0000 (00:58 +0200)] 
rename.2: wfix

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoproc.5: tfix
Michael Kerrisk [Sun, 25 Jul 2021 22:48:49 +0000 (00:48 +0200)] 
proc.5: tfix

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agosync.2: tfix
Michael Kerrisk [Sun, 25 Jul 2021 20:59:30 +0000 (22:59 +0200)] 
sync.2: tfix

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agosysvipc.7: tfix
Michael Kerrisk [Sun, 25 Jul 2021 20:57:03 +0000 (22:57 +0200)] 
sysvipc.7: tfix

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agohier.7: wfix
Michael Kerrisk [Sun, 25 Jul 2021 20:54:37 +0000 (22:54 +0200)] 
hier.7: wfix

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoenviron.7: wfix
Michael Kerrisk [Sun, 25 Jul 2021 20:52:55 +0000 (22:52 +0200)] 
environ.7: wfix

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agocrypt.3: ffix
Michael Kerrisk [Sun, 25 Jul 2021 20:51:18 +0000 (22:51 +0200)] 
crypt.3: ffix

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoconsole_codes.4: tfix
Michael Kerrisk [Sun, 25 Jul 2021 20:42:48 +0000 (22:42 +0200)] 
console_codes.4: tfix

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agounicode.7: tfix
Michael Kerrisk [Sun, 25 Jul 2021 20:39:45 +0000 (22:39 +0200)] 
unicode.7: tfix

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agouri.7: wfix
Michael Kerrisk [Sun, 25 Jul 2021 20:35:59 +0000 (22:35 +0200)] 
uri.7: wfix

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agobzero.3: wfix
Michael Kerrisk [Sun, 25 Jul 2021 20:29:27 +0000 (22:29 +0200)] 
bzero.3: wfix

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoatanh.3: tfix
Michael Kerrisk [Sun, 25 Jul 2021 20:28:18 +0000 (22:28 +0200)] 
atanh.3: tfix

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agopid_namespaces.7: tfix
Michael Kerrisk [Sun, 25 Jul 2021 20:26:35 +0000 (22:26 +0200)] 
pid_namespaces.7: tfix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoperf_event_open.2: tfix
Michael Kerrisk [Sun, 25 Jul 2021 20:26:01 +0000 (22:26 +0200)] 
perf_event_open.2: tfix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agochmod.2: tfix
Michael Kerrisk [Sun, 25 Jul 2021 20:25:30 +0000 (22:25 +0200)] 
chmod.2: tfix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agobdflush.2: srcfix
Michael Kerrisk [Sun, 25 Jul 2021 20:25:10 +0000 (22:25 +0200)] 
bdflush.2: srcfix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoclose_range.2: Glibc 2.34 has added a close_range() wrapper
Michael Kerrisk [Mon, 12 Jul 2021 01:23:46 +0000 (03:23 +0200)] 
close_range.2: Glibc 2.34 has added a close_range() wrapper

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agold.so.8: Document --list-tunables option added in glibc 2.33
Michael Kerrisk [Sun, 4 Jul 2021 21:33:57 +0000 (09:33 +1200)] 
ld.so.8: Document --list-tunables option added in glibc 2.33

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoStart of man-pages-5.13: updating Changes and Changes.old
Michael Kerrisk [Tue, 22 Jun 2021 01:04:07 +0000 (13:04 +1200)] 
Start of man-pages-5.13: updating Changes and Changes.old

4 years agoStart of man-pages-5.13: updating .Announce and .lsm files
Michael Kerrisk [Tue, 22 Jun 2021 01:04:07 +0000 (13:04 +1200)] 
Start of man-pages-5.13: updating .Announce and .lsm files

4 years agoStart of man-pages-5.13: renaming .Announce and .lsm files
Michael Kerrisk [Tue, 22 Jun 2021 01:04:07 +0000 (13:04 +1200)] 
Start of man-pages-5.13: renaming .Announce and .lsm files

4 years agoReady for 5.12
Michael Kerrisk [Sun, 20 Jun 2021 04:56:14 +0000 (16:56 +1200)] 
Ready for 5.12

4 years agoexit_group.2, ioprio_set.2, process_madvise.2, seccomp_unotify.2, set_mempolicy.2...
Michael Kerrisk [Sun, 20 Jun 2021 04:55:15 +0000 (16:55 +1200)] 
exit_group.2, ioprio_set.2, process_madvise.2, seccomp_unotify.2, set_mempolicy.2, set_tid_address.2, bswap.3, kernel_lockdown.7: tstamp

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoChanges: Ready for 5.12
Michael Kerrisk [Sun, 20 Jun 2021 04:53:07 +0000 (16:53 +1200)] 
Changes: Ready for 5.12

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoioctl_fideduperange.2: tfix
Michael Kerrisk [Sun, 20 Jun 2021 05:18:33 +0000 (17:18 +1200)] 
ioctl_fideduperange.2: tfix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoChanges: Change release location
Michael Kerrisk [Sun, 20 Jun 2021 03:56:16 +0000 (15:56 +1200)] 
Changes: Change release location

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agomount.2: Minor fixes to Topi Miettinen's patch
Michael Kerrisk [Sun, 20 Jun 2021 03:54:10 +0000 (15:54 +1200)] 
mount.2: Minor fixes to Topi Miettinen's patch

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agomount.2: document SELinux use of MS_NOSUID mount flag
Topi Miettinen [Sat, 12 Jun 2021 08:51:09 +0000 (11:51 +0300)] 
mount.2: document SELinux use of MS_NOSUID mount flag

Using mount flag `MS_NOSUID` also affects SELinux domain transitions but
this has not been documented well.

Signed-off-by: Topi Miettinen <toiwoton@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agostrcmp.3: tfix
Alejandro Colomar [Sat, 12 Jun 2021 08:27:41 +0000 (10:27 +0200)] 
strcmp.3: tfix

With a simple backslash, '\0' ended up as ' ' in the man output.

Reported-by: Štěpán Němec <stepnem@gmail.com>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoferror.3: tfix
thomasavoss [Sat, 12 Jun 2021 08:27:40 +0000 (10:27 +0200)] 
ferror.3: tfix

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agogetline.3: !*lineptr is sufficient
наб [Sat, 12 Jun 2021 08:27:39 +0000 (10:27 +0200)] 
getline.3: !*lineptr is sufficient

No implementation or spec requires *n to be 0 to allocate a new buffer:
  * musl checks for !*lineptr
    (and sets *n=0 for later allocations)
  * glibc checks for !*lineptr || !*n
    (but only because it allocates early)
  * NetBSD checks for !*lineptr
    (and sets *n=0 for later allocations)
    (but specifies *n => mlen(*lineptr) >= *n as a precondition,
     to which this appears to be an exception)
  * FreeBSD checks for !*lineptr and sets *n=0
    (and specifies !*lineptr as sufficient)
  * Lastly, POSIX.1-2017 specifies:
    > If *n is non-zero, the application shall ensure that *lineptr
    > either points to an object of size at least *n bytes,
    > or is a null pointer.

The new wording matches POSIX, even if it arrives at the point slightly
differently

Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agowait4.2: SYNOPSIS: Remove includes
Alejandro Colomar [Sat, 12 Jun 2021 08:31:45 +0000 (10:31 +0200)] 
wait4.2: SYNOPSIS: Remove includes

Don't document includes that provide types; only those that
provide prototypes and constants.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agowait.2: Remove <sys/types.h>
Alejandro Colomar [Sat, 12 Jun 2021 08:31:44 +0000 (10:31 +0200)] 
wait.2: Remove <sys/types.h>

The types that need <sys/types.h> are better documented in
system_data_types(7).  Let's keep only the includes for the
prototypes and the constants.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agovmsplice.2: Remove unneeded include
Alejandro Colomar [Sat, 12 Jun 2021 08:31:43 +0000 (10:31 +0200)] 
vmsplice.2: Remove unneeded include

'struct iovec' is defined in <bits/types/struct_iovec.h>,
which is included by <sys/io.h>, but it is also included by
<bits/fcntl-linux.h>, which is in the end included by <fcntl.h>.
Given that we already include <fcntl.h>, we don't need any more
includes.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoutimensat.2: ffix
Alejandro Colomar [Sat, 12 Jun 2021 08:31:42 +0000 (10:31 +0200)] 
utimensat.2: ffix

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoutime.2: SYNOPSIS: Fix includes
Alejandro Colomar [Sat, 12 Jun 2021 08:31:41 +0000 (10:31 +0200)] 
utime.2: SYNOPSIS: Fix includes

'struct utimbuf' is provided by <utime.h>.
There's no need for <sys/types.h>.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agouserfaultfd.2: Use syscall(SYS_...); for system calls without a wrapper; fix includes too
Alejandro Colomar [Sat, 12 Jun 2021 08:31:40 +0000 (10:31 +0200)] 
userfaultfd.2: Use syscall(SYS_...); for system calls without a wrapper; fix includes too

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agouserfaultfd.2: Remove unused includes
Alejandro Colomar [Sat, 12 Jun 2021 08:31:39 +0000 (10:31 +0200)] 
userfaultfd.2: Remove unused includes

<sys/types.h> makes no sense for a function that only uses 'int'.
The flags used by this function are provided by <fcntl.h>
(or others), but not by <linux/userfaultfd.h>.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agounlink.2: ffix
Alejandro Colomar [Sat, 12 Jun 2021 08:31:38 +0000 (10:31 +0200)] 
unlink.2: ffix

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoumask.2: Remove <sys/types.h>
Alejandro Colomar [Sat, 12 Jun 2021 08:31:37 +0000 (10:31 +0200)] 
umask.2: Remove <sys/types.h>

'mode_t', which is the only reason this might have been ever
needed, is provided by <sys/stat.h> since POSIX.1-2001.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agotruncate.2: Remove <sys/types.h>
Alejandro Colomar [Sat, 12 Jun 2021 08:31:36 +0000 (10:31 +0200)] 
truncate.2: Remove <sys/types.h>

'off_t', which is the only reason this might have been ever
needed, is provided by <unistd.h> since POSIX.1-2001.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agotkill.2: Use syscall(SYS_...); for system calls without a wrapper; fix includes too
Alejandro Colomar [Sat, 12 Jun 2021 08:31:35 +0000 (10:31 +0200)] 
tkill.2: Use syscall(SYS_...); for system calls without a wrapper; fix includes too

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agos390_sthyi.2: tfix
Alejandro Colomar [Sat, 12 Jun 2021 08:31:34 +0000 (10:31 +0200)] 
s390_sthyi.2: tfix

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agos390_runtime_instr.2: tfix
Alejandro Colomar [Sat, 12 Jun 2021 08:31:33 +0000 (10:31 +0200)] 
s390_runtime_instr.2: tfix

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agos390_guarded_storage.2: tfix
Alejandro Colomar [Sat, 12 Jun 2021 08:31:32 +0000 (10:31 +0200)] 
s390_guarded_storage.2: tfix

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agotimer_create.2: SYNOPSIS: Document why more than one header is needed
Alejandro Colomar [Sat, 12 Jun 2021 08:31:31 +0000 (10:31 +0200)] 
timer_create.2: SYNOPSIS: Document why more than one header is needed

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agosyslog.2: Use syscall(SYS_...); for raw system calls
Alejandro Colomar [Sat, 12 Jun 2021 08:31:30 +0000 (10:31 +0200)] 
syslog.2: Use syscall(SYS_...); for raw system calls

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agosyscall.2: wfix + ffix
Alejandro Colomar [Sat, 12 Jun 2021 08:31:29 +0000 (10:31 +0200)] 
syscall.2: wfix + ffix

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agosymlink.2: ffix
Alejandro Colomar [Sat, 12 Jun 2021 08:31:28 +0000 (10:31 +0200)] 
symlink.2: ffix

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoswapon.2: SYNOPSIS: Fix includes
Alejandro Colomar [Sat, 12 Jun 2021 08:31:27 +0000 (10:31 +0200)] 
swapon.2: SYNOPSIS: Fix includes

There seems to be no reason to include <unistd.h>.
<sys/swap.h> already provides both the function prototypes and the
SWAP_* constants.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agosubpage_prot.2: Use syscall(SYS_...); for system calls without a wrapper
Alejandro Colomar [Sat, 12 Jun 2021 08:31:26 +0000 (10:31 +0200)] 
subpage_prot.2: Use syscall(SYS_...); for system calls without a wrapper

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agostatx.2: SYNOPSIS: Fix includes
Alejandro Colomar [Sat, 12 Jun 2021 08:31:25 +0000 (10:31 +0200)] 
statx.2: SYNOPSIS: Fix includes

<unistd.h> doesn't seem to be needed:
  AT_* constants come from <fcntl.h>
  STATX_* constants come from <sys/stat.h>
  'struct statx' comes from <sys/stat.h>

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agostat.2: SYNOPSIS: Fix includes
Alejandro Colomar [Sat, 12 Jun 2021 08:31:24 +0000 (10:31 +0200)] 
stat.2: SYNOPSIS: Fix includes

Remove <sys/types.h>; ffix too

<sys/types.h> is only needed for 'struct stat'.
That is better documented in system_data_types(7).

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agospu_run.2: Use syscall(SYS_...), for system calls without a wrapper
Alejandro Colomar [Sat, 12 Jun 2021 08:31:23 +0000 (10:31 +0200)] 
spu_run.2: Use syscall(SYS_...), for system calls without a wrapper

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agopipe.2: SYNOPSIS: Fix incorrect prototype
Alejandro Colomar [Sat, 12 Jun 2021 08:31:22 +0000 (10:31 +0200)] 
pipe.2: SYNOPSIS: Fix incorrect prototype

A function declarator with empty parentheses, which is not a
prototype, is an obsolescent feature of C (See C17 6.11.6.1), and
doesn't mean 0 parameters, but instead that no information about
the parameters is provided (See C17 6.5.2.2).

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agospu_create.2: Use syscall(SYS_...), for system calls without a wrapper
Alejandro Colomar [Sat, 12 Jun 2021 08:31:21 +0000 (10:31 +0200)] 
spu_create.2: Use syscall(SYS_...), for system calls without a wrapper

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agospu_create.2: Remove <sys/types.h>
Alejandro Colomar [Sat, 12 Jun 2021 08:31:20 +0000 (10:31 +0200)] 
spu_create.2: Remove <sys/types.h>

It's only needed for getting 'mode_t'.
But that type is better documented in system_data_types(7).

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoseccomp.2: Use syscall(SYS_...); for system calls without a wrapper
Alejandro Colomar [Sat, 12 Jun 2021 08:31:19 +0000 (10:31 +0200)] 
seccomp.2: Use syscall(SYS_...); for system calls without a wrapper

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoseccomp.2: Document why each header is needed
Alejandro Colomar [Sat, 12 Jun 2021 08:31:18 +0000 (10:31 +0200)] 
seccomp.2: Document why each header is needed

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Tyler Hicks <tyhicks@canonical.com>
Cc: Will Drewry <wad@chromium.org>
Cc: Michael Kerrisk <mtk.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoMIN.3: New link to MIN.3
Michael Kerrisk [Sun, 20 Jun 2021 02:20:38 +0000 (14:20 +1200)] 
MIN.3: New link to MIN.3

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoMAX.3: New page to document MAX() and MIN()
Alejandro Colomar [Wed, 12 May 2021 22:51:31 +0000 (00:51 +0200)] 
MAX.3: New page to document MAX() and MIN()

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Cc: Paul Eggert <eggert@cs.ucla.edu>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoseccomp_unotify.2: Add caveats regarding emulation of blocking system calls
Michael Kerrisk [Mon, 2 Nov 2020 13:10:44 +0000 (14:10 +0100)] 
seccomp_unotify.2: Add caveats regarding emulation of blocking system calls

Reported-by: Sargun Dhillon <sargun@sargun.me>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoseccomp_unotify.2: Reformat ioctls as subsections rather than hanging list
Michael Kerrisk [Sat, 31 Oct 2020 18:24:54 +0000 (19:24 +0100)] 
seccomp_unotify.2: Reformat ioctls as subsections rather than hanging list

Doing so decreases the degree to which text is indented, and
thus avoids short, poorly wrapped lines.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoseccomp_unotify.2: Document the SECCOMP_IOCTL_NOTIF_ADDFD ioctl()
Michael Kerrisk [Sat, 31 Oct 2020 16:29:27 +0000 (17:29 +0100)] 
seccomp_unotify.2: Document the SECCOMP_IOCTL_NOTIF_ADDFD ioctl()

Starting from some notes by Sargun Dhillon.

Reported-by: Sargun Dhillon <sargun@sargun.me>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoseccomp_unotify.2: EXAMPLES: simplify logic in getTargetPathname()
Michael Kerrisk [Fri, 30 Oct 2020 15:36:04 +0000 (16:36 +0100)] 
seccomp_unotify.2: EXAMPLES: simplify logic in getTargetPathname()

And reword some comments there.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoseccomp_unotify.2: EXAMPLES: fix a file descriptor leak
Michael Kerrisk [Fri, 30 Oct 2020 15:31:11 +0000 (16:31 +0100)] 
seccomp_unotify.2: EXAMPLES: fix a file descriptor leak

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoseccomp_unotify.2: EXAMPLES: some code modularity improvements
Michael Kerrisk [Fri, 30 Oct 2020 10:04:52 +0000 (11:04 +0100)] 
seccomp_unotify.2: EXAMPLES: some code modularity improvements

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoseccomp_unotify.2: Minor cleanup fix
Michael Kerrisk [Fri, 30 Oct 2020 08:55:16 +0000 (09:55 +0100)] 
seccomp_unotify.2: Minor cleanup fix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoseccomp_unotify.2: Change name of SECCOMP_IOCTL_NOTIF_ID_VALID function
Michael Kerrisk [Fri, 30 Oct 2020 06:50:00 +0000 (07:50 +0100)] 
seccomp_unotify.2: Change name of SECCOMP_IOCTL_NOTIF_ID_VALID function

Give this function a shorter, slightly easier to read name.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoseccomp_unotify.2: Fixes after review comments from Christian Brauner
Michael Kerrisk [Thu, 29 Oct 2020 19:52:50 +0000 (20:52 +0100)] 
seccomp_unotify.2: Fixes after review comments from Christian Brauner

Reported-by: Christian Brauner <christian.brauner@canonical.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoseccomp_unotify.2: A cookie check is also required after reading target's memory
Michael Kerrisk [Thu, 29 Oct 2020 18:41:22 +0000 (19:41 +0100)] 
seccomp_unotify.2: A cookie check is also required after reading target's memory

Quoting Jann Horn:

[[
As discussed at
<https://lore.kernel.org/r/CAG48ez0m4Y24ZBZCh+Tf4ORMm9_q4n7VOzpGjwGF7_Fe8EQH=Q@mail.gmail.com>,
we need to re-check checkNotificationIdIsValid() after reading remote
memory but before using the read value in any way. Otherwise, the
syscall could in the meantime get interrupted by a signal handler, the
signal handler could return, and then the function that performed the
syscall could free() allocations or return (thereby freeing buffers on
the stack).

In essence, this pread() is (unavoidably) a potential use-after-free
read; and to make that not have any security impact, we need to check
whether UAF read occurred before using the read value. This should
probably be called out elsewhere in the manpage, too...

Now, of course, **reading** is the easy case. The difficult case is if
we have to **write** to the remote process... because then we can't
play games like that. If we write data to a freed pointer, we're
screwed, that's it. (And for somewhat unrelated bonus fun, consider
that /proc/$pid/mem is originally intended for process debugging,
including installing breakpoints, and will therefore happily write
over "readonly" private mappings, such as typical mappings of
executable code.)

So, uuuuh... I guess if anyone wants to actually write memory back to
the target process, we'd better come up with some dedicated API for
that, using an ioctl on the seccomp fd that magically freezes the
target process inside the syscall while writing to its memory, or
something like that? And until then, the manpage should have a big fat
warning that writing to the target's memory is simply not possible
(safely).
]]

and
<https://lore.kernel.org/r/CAG48ez0m4Y24ZBZCh+Tf4ORMm9_q4n7VOzpGjwGF7_Fe8EQH=Q@mail.gmail.com>:

[[
The second bit of trouble is that if the supervisor is so oblivious
that it doesn't realize that syscalls can be interrupted, it'll run
into other problems. Let's say the target process does something like
this:

int func(void) {
  char pathbuf[4096];
  sprintf(pathbuf, "/tmp/blah.%d", some_number);
  mount("foo", pathbuf, ...);
}

and mount() is handled with a notification. If the supervisor just
reads the path string and immediately passes it into the real mount()
syscall, something like this can happen:

target: starts mount()
target: receives signal, aborts mount()
target: runs signal handler, returns from signal handler
target: returns out of func()
supervisor: receives notification
supervisor: reads path from remote buffer
supervisor: calls mount()

but because the stack allocation has already been freed by the time
the supervisor reads it, the supervisor just reads random garbage, and
beautiful fireworks ensue.

So the supervisor *fundamentally* has to be written to expect that at
*any* time, the target can abandon a syscall. And every read of remote
memory has to be separated from uses of that remote memory by a
notification ID recheck.

And at that point, I think it's reasonable to expect the supervisor to
also be able to handle that a syscall can be aborted before the
notification is delivered.
]]

Reported-by: Jann Horn <jannh@google.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoseccomp_unotify.2: wfix
Michael Kerrisk [Thu, 29 Oct 2020 18:23:47 +0000 (19:23 +0100)] 
seccomp_unotify.2: wfix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoseccomp_unotify.2: EXAMPLES: make SECCOMP_IOCTL_NOTIF_ID_VALID function return bool
Michael Kerrisk [Thu, 29 Oct 2020 16:15:50 +0000 (17:15 +0100)] 
seccomp_unotify.2: EXAMPLES: make SECCOMP_IOCTL_NOTIF_ID_VALID function return bool

- Rename the function that does the SECCOMP_IOCTL_NOTIF_ID_VALID
  check.
- Make that function return a 'bool' rather than terminating the
  process.
- Use that return value in the calling function.
- Rework/improve various related comments.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>