Carlos O'Donell [Thu, 12 Apr 2018 19:05:33 +0000 (14:05 -0500)]
posixoptions.7: Expand XSI Options groups
We define in detail the X/Open System Interfaces i.e. _XOPEN_UNIX
and all of the X/Open System Interfaces (XSI) Options Groups.
The XSI options groups include encryption, realtime, advanced
realtime, realtime threads, advanced realtime threads, tracing,
streams, and legacy interfaces.
Signed-off-by: Carlos O'Donell <carlos@redhat.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Michael Kerrisk [Fri, 13 Apr 2018 07:12:16 +0000 (09:12 +0200)]
mmap.2: Move the text on MAP_FIXED to NOTES
This text has become rather long, making it it somewhat
unwieldy in the discussion of the mmap() flags. Therefore,
move it to NOTES, with a pointer in DESCRIPTION referring
the reader to NOTES.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Michael Kerrisk [Fri, 13 Apr 2018 06:53:06 +0000 (08:53 +0200)]
mmap.2: Minor wording fix
Change "extremely hazardous" to "hazardous". The former phrasing
is a little overwrought; on its own "hazardous" is enough to
convey the sense of danger.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Jan Kara [Thu, 12 Apr 2018 12:36:35 +0000 (14:36 +0200)]
mmap.2: Add description of MAP_SHARED_VALIDATE and MAP_SYNC
Reviewed-by: Ross Zwisler <ross.zwisler@linux.intel.com> Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Carlos O'Donell [Mon, 5 Feb 2018 20:34:49 +0000 (12:34 -0800)]
getcwd.3: Mention that "(unreachable)" is no longer returned for glibc >= 2.27.
With glibc fix 52a713fdd0a30e1bd79818e2e3c4ab44ddca1a94 for
CVE-2018-1000001 (Sourceware BZ #22679) the implementation in the
just released glibc 2.27 has been changed such that instead of
returning "(unreachable)" the implementation now returns ENOENT
as it would have if the current directory had been unlinked.
I see that in 2015 the quirk was documented in commit a2ac97c78bf05a55f8f616fc39a4724372dcfa95, and this is no longer
true with glibc 2.27, but may continue to be true in other C libraries,
so I reference NOTES from the paragraph in the central text.
Signed-off-by: Carlos O'Donell <carlos@redhat.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
membarrier.2: Document new membarrier commands introduced in Linux 4.16
Document the following membarrier commands introduced in
Linux 4.16:
MEMBARRIER_CMD_GLOBAL_EXPEDITED
(the old enum label MEMBARRIER_CMD_SHARED is now an
alias to preserve header backward compatibility)
MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED
MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE
MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> CC: Michael Kerrisk <mtk.manpages@gmail.com> CC: Ingo Molnar <mingo@redhat.com> CC: Peter Zijlstra <peterz@infradead.org> CC: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Michael Kerrisk [Thu, 12 Apr 2018 08:53:21 +0000 (10:53 +0200)]
unix.7: ERRORS: add EBADF for sending closed file descriptor with SCM_RIGHTS
As noted by Rusty Russell:
I was really surprised that sendmsg() returned EBADF on a valid fd;
turns out I was using sendmsg with SCM_RIGHTS to send a closed fd,
which gives EBADF (see test program below).
But this is only obliquely referenced in unix(7):
SCM_RIGHTS
Send or receive a set of open file descriptors
from another process. The data portion contains
an integer array of the file descriptors. The
passed file descriptors behave as though they have
been created with dup(2).
EBADF is not mentioned in the unix(7) ERRORS (it's mentioned in
dup(2)).
int fdpass_send(int sockout, int fd)
{
/* From the cmsg(3) manpage: */
struct msghdr msg = { 0 };
struct cmsghdr *cmsg;
struct iovec iov;
char c = 0;
union { /* Ancillary data buffer, wrapped in a union
in order to ensure it is suitably aligned */
char buf[CMSG_SPACE(sizeof(fd))];
struct cmsghdr align;
} u;
/* Keith Packard reports that 0-length sends don't work, so we
* always send 1 byte. */
iov.iov_base = &c;
iov.iov_len = 1;
return sendmsg(sockout, &msg, 0);
}
int fdpass_recv(int sockin)
{
/* From the cmsg(3) manpage: */
struct msghdr msg = { 0 };
struct cmsghdr *cmsg;
struct iovec iov;
int fd;
char c;
union { /* Ancillary data buffer, wrapped in a union
in order to ensure it is suitably aligned */
char buf[CMSG_SPACE(sizeof(fd))];
struct cmsghdr align;
} u;
Song Liu [Tue, 9 Jan 2018 19:39:26 +0000 (11:39 -0800)]
perf_event_open.2: Add type kprobe and uprobe
Two new types kprobe and uprobe are being added to
perf_event_open(), which allow creating kprobe or
uprobe with perf_event_open. This patch adds
information about these types.
Signed-off-by: Song Liu <songliubraving@fb.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Mike Frysinger [Mon, 5 Feb 2018 21:48:02 +0000 (16:48 -0500)]
ld.so.8: Make lack of separator escaping explicit
Make it clear that the delimiters in LD_PRELOAD, LD_LIBRARY_PATH,
and LD_AUDIT cannot be escaped so people don't try various methods
(such as \:) to workaround it.
Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Jann Horn [Wed, 21 Mar 2018 16:47:15 +0000 (17:47 +0100)]
tsearch.3: tdelete() can return dangling pointers
POSIX says that deleting the root node must cause tdelete() to
return some unspecified non-NULL pointer. Glibc implements it by
returning a dangling pointer to the (freed) root node:
$ cat bogus_tdelete.c
static void *root = NULL;
static void *xmalloc(unsigned n) {
void *p;
p = malloc(n);
if (!p)
err(1, "malloc");
return p;
}
static int compare(const void *pa, const void *pb) {
if (*(int *) pa < *(int *) pb)
return -1;
if (*(int *) pa > *(int *) pb)
return 1;
return 0;
}
Jann Horn [Wed, 21 Mar 2018 16:44:58 +0000 (17:44 +0100)]
tsearch.3: Clarify items vs nodes
The manpage claimed that tsearch() returns a pointer to a data
item. This is incorrect; tsearch() returns a pointer to the
corresponding tree node, which can also be interpreted as a
pointer to a pointer to the data item.
Since this API is quite unintuitive, also add a clarifying
sentence.
Signed-off-by: Jann Horn <jannh@google.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Michael Kerrisk [Tue, 27 Mar 2018 20:06:52 +0000 (22:06 +0200)]
socket.7: Fix error in SO_INCOMING_CPU code snippet
The last argument is passed by value, not reference. Reported-by: Tomi Salminen <tsalminen@forcepoint.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Michael Kerrisk [Mon, 5 Mar 2018 09:20:55 +0000 (10:20 +0100)]
seccomp.2: Note that execve() may change syscall numbers during life of process
On a multiarch/multi-ABI platform such as modern x86, each
architecture/ABI (x86-64, x32, i386)has its own syscall numbers,
which means a seccomp() filter may see different syscall numbers
over the life of the process if that process uses execve() to
execute programs that has a different architectures/ABIs.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Michael Kerrisk [Sun, 4 Mar 2018 10:47:47 +0000 (11:47 +0100)]
mount.2: ERRORS: add EBUSY for the case of trying to stack same mount twice
It is not possible to consecutively stack mounts of the
same source+target inside the same mount namespace.
For example, if procfs was already mounted against /proc in
this mount namespace:
$ sudo mount -t proc none /proc
mount: /proc: none already mounted or mount point busy.
See the following code in fs/namespace.c:
/* Refuse the same filesystem on the same mount point */
err = -EBUSY;
if (path->mnt->mnt_sb == newmnt->mnt.mnt_sb &&
path->mnt->mnt_root == path->dentry)
goto unlock;
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>