Commit Graph

21251 Commits

Author SHA1 Message Date
Michael Kerrisk 6a7093c3f3 core.5: minor tweaks
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-09 12:39:17 +02:00
Michael Kerrisk 8d85a961ac core.5: Explain that core_pattern %e is process/thread 'comm' value
The 'comm' value is typically the same as the (possibly
truncated) executable name, but may be something different.

Reported-by: Jonny Grant <jg@jguk.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-09 12:08:39 +02:00
Michael Kerrisk 492a8b724f connect.2: Minor tweaks to Stefan Puiu's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-09 10:17:34 +02:00
Stefan Puiu 375c65a9c2 connect.2: Can return EACCES because of SELinux
Recently I had to troubleshoot a problem where a connect() call
was returning EACCES:

17648 socket(AF_INET, SOCK_STREAM, IPPROTO_IP) = 37
17648 connect(37, {sa_family=AF_INET, sin_port=htons(8081),
sin_addr=inet_addr("10.12.1.201")}, 16) = -1 EACCES (Permission
denied)

I've traced this to SELinux policy denying the connection. This is
on a Fedora 23 VM:

$ cat /etc/redhat-release
Fedora release 23 (Twenty Three)
$ uname -a
Linux mako-fedora-01 4.8.13-100.fc23.x86_64 #1 SMP Fri Dec 9 14:51:40
UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

The manpage says this can happen when connecting to a broadcast
address, or when a local firewall rule blocks the connection.
However, the address above is unicast, and using 'wget' from
another account to access the URL works fine.

The context is that we're building an OS image, and this involves
downloading RPMs through a proxy. The proxy (polipo) is labelled
by SELinux, and I guess there is some sort of policy that says
"proxy can only connect to HTTP ports". When trying to connect to
a server listening on a port that is not labeled as an HTTP server
port, I guess SELinux steps in. With 'setenforce 0', the build
works fine. In the kernel sources I see connect() calls
security_socket_connect() (see
https://elixir.bootlin.com/linux/latest/source/net/socket.c#L1855),
which calls whatever security hooks are registered. I see the
SELinux hook getting registered at
https://elixir.bootlin.com/linux/latest/source/security/selinux/hooks.c#L7047,
and setting a perf probe on the call proves that the
selinux_socket_connect function gets called (while
tcp_v4_connect() is not).

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-09 10:09:55 +02:00
Michael Kerrisk 94e316bfea user_namespaces.7: Clarify "system time"
From an email conversation with Léo Stefanesco:

> In the man7.org version of the man page for user_namespaces(7), it reads:
>
>    there are many privileged operations that affect
>    resources that are not associated with any namespace type,
>    for example, changing the system time
>    (governed by CAP_SYS_TIME)
>
> which is not consistent with time_namespaces(7).

In fact, strictly peaking the text still is correct, even after
the arrival of time namespaces.

Time namespaces virtualize only the boot-time and monotonic
clocks, not the "real time" (i.e., calendar time), which is the
time referred in the passage you quote.

That said, the text is perhaps now a little misleading, and
a little clarification would help. I changed the text to:

    there are many privileged operations that affect
    resources are not associated with any namespace type,
    for example, changing the system **(i.e., calendar)** time
    (governed by CAP_SYS_TIME)

Reported-by: Léo Stefanesco <leo.lveb@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-09 10:03:04 +02:00
Michael Kerrisk 7dc03d8607 bpf-helpers.7: Resync against kernel 5.7
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-09 09:47:48 +02:00
Michael Kerrisk 599e0cef94 ioctl.2: Remove mentions of ioctl_list(2)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-09 09:40:08 +02:00
Michael Kerrisk 3de87d4684 ioctl_list.2: Remove this page
This page was first added more than 20 years ago. Since
that time it has seen hardly any update, and is by now
very much out of date, as reported by Heinrich Schuchardt
and confirmed by Eugene Syromyatnikov.

As Heinrich says:

    Man-pages like netdevices.7 or ioctl_fat.2 are what is
    needed to help a user who does not want to read through the
    kernel code.

    If ioctl_list.2 has not been reasonably maintained since
    Linux 1.3.27 and hence is not a reliable source of
    information, shouldn't it be dropped?

My answer is, yes (but let's move a little info into ioctl(2)).

Reported-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reported-by: Eugene Syromyatnikov <evgsyr@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-09 09:40:08 +02:00
Michael Kerrisk 91b00e53b3 ioctl.2: Move subsection on "ioctl structure" from ioctl_list(2) to ioctl(2)
In preparation for removing ioctl_list(2), let's preserve
some useful text that was added to ioctl_list(2)
by Andries Brouwer.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-09 09:40:08 +02:00
Michael Kerrisk 02e701cde3 syscall.2: Minor wording tweaks
Reported-by: Jonny Grant <jg@jguk.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-08 23:09:36 +02:00
Michael Kerrisk c5f7febc4f random.3: wfix: no need to mention INT32_MAX
Reported-by: walter harms <wharms@bfs.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-08 23:09:36 +02:00
John Marshall 2de361c8e9 random.3: Change "RAND_MAX" tp "2^31-1"
RAND_MAX is for rand(3).  POSIX fixes random()'s range at 2^31-1;
RAND_MAX may be smaller on some platforms (even though with glibc
or musl on Linux they are the same).

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-08 23:09:36 +02:00
Amir Goldstein e9898cc8ba fanotify.7, fanotify_mark.2: Clarify FAN_ONDIR in output mask
FAN_ONDIR was an input only flag before introducing
FAN_REPORT_FID.  Since the introduction of FAN_REPORT_FID, it can
also be in output mask.

Move the text describing its role in the output mask to fanotify.7
where the other output mask bits are documented.

[mtk: commit message tidy-up]

Reviewed-by: Matthew Bobrowski <mbobrowski@mbobrowski.org>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-08 23:07:59 +02:00
Amir Goldstein e5a800c135 fanotify_init.2: Move out of place entry FAN_REPORT_FID
It was inserted in the middle of the FAN_CLASS_ multi flags bit
and broke the multi flag documentation.

Reviewed-by: Matthew Bobrowski <mbobrowski@mbobrowski.org>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-08 22:16:40 +02:00
Amir Goldstein c3a3f611f6 fanotify.7, fanotify_mark.2: Revert "fanotify.7, fanotify_mark.2: Document FAN_DIR_MODIFY"
This reverts commit a93e5c9593.

FAN_DIR_MODIFY was disabled for v5.7 release by kernel commit
f17936993af0 ("fanotify: turn off support for FAN_DIR_MODIFY").

Reviewed-by: Matthew Bobrowski <mbobrowski@mbobrowski.org>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-08 22:16:34 +02:00
Michael Kerrisk 2f0e61aec2 core.5: Note that not dumping core of an unreadable binary is a security measure
Reported-by: Jonny Grant <jg@jguk.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-08 18:16:53 +02:00
Michael Kerrisk b665474b29 core.5: wfix
Reported-by: Jonny Grant <jg@jguk.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-08 18:06:10 +02:00
Jakub Wilk 4ad5b7a575 proc.5: ffix
Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-08 17:41:12 +02:00
Michael Kerrisk 7ced1a6529 err.3: EXAMPLES: use EXIT_FAILURE rather than 1 as exit status
By way of good example, use the an EXIT_* symbolic constant,
rather than a hard-coded number.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-03 22:52:36 +02:00
Michael Kerrisk bd1686486f clock_getres.2, fsync.2, mlock.2, mmap.2, msync.2, INFINITY.3, cexp2.3, clog2.3, flockfile.3: Remove AVAILABILITY section heading
In the few pages where this heading (which is "nonstandard" within
man-pages) is used, it always immediately follows CONFORMING TO
and generally contains information related to standards. Remove
the section heading, thus incorporating AVAILABILITY into
CONFORMING TO.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-31 10:45:27 +02:00
Michael Kerrisk 005383e69e man-pages.7: Rename EXAMPLE to EXAMPLES
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-31 10:45:27 +02:00
Michael Kerrisk a14af333d6 Various pages: retitle EXAMPLE section heading to EXAMPLES
EXAMPLES appears to be the wider majority usage across various
projects' manual pages, and is also what is used in the POSIX
manual pages.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-31 10:45:27 +02:00
Michael Kerrisk c91a4f144c man-pages.7: Add REPORTING BUGS section
man-pages doesn't have a REPORTING BUGS section in manual pages,
but many other projects do. Make some recommendations about
placement of that section.
2020-05-31 10:45:27 +02:00
Michael Kerrisk fa1e323100 man-pages.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-31 10:45:27 +02:00
Michael Kerrisk 88c9c16a68 man-pages.7: Describe COPYRIGHT section
man-pages doesn't use COPYRIGHT sections in manual pages, but
various projects do. Make some recommendations about placement
of the section.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-31 10:45:27 +02:00
Michael Kerrisk cd2621174c man-pages.7: Mention AUTHORS in summary section list
Although man-pages doesn't use AUTHORS sections, many projects do
use an AUTHORS section in their manual pages, so mention it in
man-pages to suggest some guidance on the position at which
to place that section.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-31 10:45:27 +02:00
Michael Kerrisk 24581849d9 core.5: tfix
Reported-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-28 11:37:38 +02:00
Michael Kerrisk 8626fdd2de core.5: Mention 'sysctl -w' as a way of changing core_pattern setting
Reported-by: Jonny Grant <jg@jguk.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-28 11:37:32 +02:00
Michael Kerrisk 94c50673e6 core.5: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-28 09:52:09 +02:00
Dave Martin 4f65a89721 prctl.2: ffix: use literal hyphens when referencing kernel docs
There is one case of a cross-reference to a kernel documentation
filename that uses unescaped hyphens.

To avoid misrendering, escape these as \- similarly to other
instances.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-28 08:17:50 +02:00
Michael Kerrisk db4d540044 prctl.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-28 08:17:50 +02:00
Dave Martin 734439ca9e prctl.2: Add PR_SPEC_DISABLE_NOEXEC for SPECULATION_CTRL prctls
Add the PR_SPEC_DISABLE_NOEXEC mode added in Linux 5.1
for the PR_SPEC_STORE_BYPASS "misfeature" of
PR_SET_SPECULATION_CTRL and PR_GET_SPECULATION_CTRL.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Cc: Waiman Long <longman@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-28 08:17:50 +02:00
Michael Kerrisk 68b4922bf5 prctl.2: Minor tweaks to "prctl.2: Add PR_SPEC_INDIRECT_BRANCH for SPECULATION_CTRL prctls" patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-28 08:17:50 +02:00
Dave Martin 277d7d6d04 prctl.2: Add PR_SPEC_INDIRECT_BRANCH for SPECULATION_CTRL prctls
Add the PR_SPEC_INDIRECT_BRANCH "misfeature" added in Linux 4.20
for PR_SET_SPECULATION_CTRL and PR_GET_SPECULATION_CTRL.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Cc: Tim Chen <tim.c.chen@linux.intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-28 08:17:50 +02:00
Michael Kerrisk 7ef5957484 core.5: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-27 15:26:45 +02:00
Michael Kerrisk 259ce44eeb ctime.3: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-26 13:25:54 +02:00
Michael Kerrisk 5dbd04b5f9 pipe.2, socketpair.2, dlopen.3, posix_memalign.3, signal-safety.7: Correct bogus POSIX.1 standards names
POSIX.1-2003 ==> POSIX.1-2001 TC1
POSIX.1-2004 ==> POSIX.1-2001 TC2
POSIX.1-2013 ==> POSIX.1-2008 TC1
POSIX.1-2016 ==> POSIX.1-2008 TC2

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-26 13:25:54 +02:00
Michael Kerrisk b710e16161 close.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-26 13:25:54 +02:00
Michael Kerrisk e50b1125e1 tzset.3: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-26 13:25:54 +02:00
Michael Kerrisk fcf486714c getnameinfo.3: srcfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-26 13:25:54 +02:00
Michael Kerrisk 3e4c47dde2 dlopen.3: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-26 13:25:54 +02:00
Michael Kerrisk d645b01b31 posix_fadvise.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-26 13:25:54 +02:00
Michael Kerrisk e1403777e7 y0.3: errno is now correctly set to ERANGE on underflow
The fix was in glibc 2.17. See
https://www.sourceware.org/bugzilla/show_bug.cgi?id=6808

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-26 13:25:54 +02:00
Michael Kerrisk 14b81bcfdf y0.3: srcfix: remove an ancient FIXME that no longer matters much
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-26 13:25:54 +02:00
Michael Kerrisk 696b65a571 y0.3: These functions now correctly diagnose a pole error
The fix was in glibc 2.19. See
https://sourceware.org/bugzilla/show_bug.cgi?id=6807

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-26 13:25:54 +02:00
Michael Kerrisk c2e0ff42a4 y0.3: srcfix: Note on "Range error: result underflow" and FE_UNDERFLOW
The fact that an FE_UNDERFLOW exception is not raised for
"Range error: result underflow" is intended behavior.
See https://www.sourceware.org/bugzilla/show_bug.cgi?id=6806.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-26 12:10:55 +02:00
Michael Kerrisk 84828d04a6 j0.3: srcfix: add notes that failing to raise FE_UNDERFLOW is intended behavior
See https://www.sourceware.org/bugzilla/show_bug.cgi?id=6805

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-26 11:26:00 +02:00
Michael Kerrisk 5b08d967e8 scalbln.3: These functions now correctly set errno for the ERANGE case
Modify DESCRIPTION appropriately and add BUGS section.
The fix was in glibc 2.20.

See https://www.sourceware.org/bugzilla/show_bug.cgi?id=6803

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-26 11:19:03 +02:00
Michael Kerrisk 121c4dfd41 hypot.3: srcfix: add some notes about the underflow case
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-26 10:56:28 +02:00
Michael Kerrisk 053d061aef sincos.3: The glibc implementation does now give EDOM for a domain error
The fix was in glibc 2.22
(commit d435569cd626bccb9c27361202a279d0fd7fce88).

See https://www.sourceware.org/bugzilla/show_bug.cgi?id=15467

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-26 10:44:57 +02:00