]> git.ipfire.org Git - thirdparty/man-pages.git/log
thirdparty/man-pages.git
6 years agocrypt.3: srcfix: rewrap source lines
Michael Kerrisk [Fri, 13 Apr 2018 09:23:29 +0000 (11:23 +0200)] 
crypt.3: srcfix: rewrap source lines

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agocrypt.3, encrypt.3: Add notes about _XOPEN_CRYPT
Carlos O'Donell [Thu, 12 Apr 2018 19:05:40 +0000 (14:05 -0500)] 
crypt.3, encrypt.3: Add notes about _XOPEN_CRYPT

The distribution may choose not to support _XOPEN_CRYPT in the
case that the distribution has transitioned from glibc crypt to
libxcrypt.

Signed-off-by: Carlos O'Donell <carlos@redhat.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agoposixoptions.7: tfix
Michael Kerrisk [Fri, 13 Apr 2018 09:20:11 +0000 (11:20 +0200)] 
posixoptions.7: tfix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agoposixoptions.7: Use a more consistent, less cluttered layout for option lists
Michael Kerrisk [Fri, 13 Apr 2018 09:19:22 +0000 (11:19 +0200)] 
posixoptions.7: Use a more consistent, less cluttered layout for option lists

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agoposixoptions.7: Make function lists more consistent and less cluttered
Michael Kerrisk [Fri, 13 Apr 2018 08:44:01 +0000 (10:44 +0200)] 
posixoptions.7: Make function lists more consistent and less cluttered

Use more consistent layout for lists of functions, and
remove punctuation from the lists to make them less cluttered.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agoposixoptions.7: tfix
Michael Kerrisk [Fri, 13 Apr 2018 08:23:19 +0000 (10:23 +0200)] 
posixoptions.7: tfix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agoposixoptions.7: wfix
Michael Kerrisk [Fri, 13 Apr 2018 08:22:30 +0000 (10:22 +0200)] 
posixoptions.7: wfix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agoposixoptions.7: ffix
Michael Kerrisk [Fri, 13 Apr 2018 07:47:25 +0000 (09:47 +0200)] 
posixoptions.7: ffix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agoposixoptions.7: tfix
Michael Kerrisk [Fri, 13 Apr 2018 07:42:39 +0000 (09:42 +0200)] 
posixoptions.7: tfix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agoposixoptions.7: ffix
Michael Kerrisk [Fri, 13 Apr 2018 07:42:26 +0000 (09:42 +0200)] 
posixoptions.7: ffix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agoposixoptions.7: Expand XSI Options groups
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>
6 years agommap.2: Minor wording improvements to text on MAP_FIXED hazard
Michael Kerrisk [Fri, 13 Apr 2018 07:20:24 +0000 (09:20 +0200)] 
mmap.2: Minor wording improvements to text on MAP_FIXED hazard

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agommap.2: Further tweaks to mention of MAP_FIXED_NOREPLACE in MAP_FIXED notes
Michael Kerrisk [Fri, 13 Apr 2018 07:16:18 +0000 (09:16 +0200)] 
mmap.2: Further tweaks to mention of MAP_FIXED_NOREPLACE in MAP_FIXED notes

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agommap.2: Move the text on MAP_FIXED to NOTES
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>
6 years agommap.2: Further wording tweaks to the discussion of MAP_FIXED hazards
Michael Kerrisk [Fri, 13 Apr 2018 07:04:35 +0000 (09:04 +0200)] 
mmap.2: Further wording tweaks to the discussion of MAP_FIXED hazards

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agommap.2: Minor wording fix
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>
6 years agommap.2: Minor wording fixes to to text describing MAP_FIXED hazards
Michael Kerrisk [Fri, 13 Apr 2018 06:50:38 +0000 (08:50 +0200)] 
mmap.2: Minor wording fixes to to text describing MAP_FIXED hazards

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agommap.2: Simplify mention of MAP_FIXED_NOREPLACE in the discussion of MAP_FIXED
Michael Kerrisk [Fri, 13 Apr 2018 06:44:24 +0000 (08:44 +0200)] 
mmap.2: Simplify mention of MAP_FIXED_NOREPLACE in the discussion of MAP_FIXED

After discussions with Jann Horn and John Hubbard.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agommap.2: wfix
Michael Kerrisk [Fri, 13 Apr 2018 06:38:50 +0000 (08:38 +0200)] 
mmap.2: wfix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agommap.2: wfix
Michael Kerrisk [Fri, 13 Apr 2018 06:23:14 +0000 (08:23 +0200)] 
mmap.2: wfix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agommap.2: tfix
Michael Kerrisk [Fri, 13 Apr 2018 06:21:32 +0000 (08:21 +0200)] 
mmap.2: tfix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agommap.2: ffix
Michael Kerrisk [Fri, 13 Apr 2018 06:19:44 +0000 (08:19 +0200)] 
mmap.2: ffix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agommap.2: MAP_FIXED is okay if the address range has been reserved
Jann Horn [Thu, 12 Apr 2018 15:39:41 +0000 (17:39 +0200)] 
mmap.2: MAP_FIXED is okay if the address range has been reserved

Clarify that MAP_FIXED is appropriate if the specified address
range has been reserved using an existing mapping, but shouldn't
be used otherwise.

Signed-off-by: Jann Horn <jannh@google.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agommap.2: Clarify rationale of MAP_SYNC somewhat
Michael Kerrisk [Thu, 12 Apr 2018 18:12:50 +0000 (20:12 +0200)] 
mmap.2: Clarify rationale of MAP_SYNC somewhat

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agommap.2: Minor tweaks to Jan Kara's patch
Michael Kerrisk [Thu, 12 Apr 2018 12:49:52 +0000 (14:49 +0200)] 
mmap.2: Minor tweaks to Jan Kara's patch

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agommap.2: srcfix: rewrap source lines
Michael Kerrisk [Thu, 12 Apr 2018 12:38:24 +0000 (14:38 +0200)] 
mmap.2: srcfix: rewrap source lines

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agommap.2: Add description of MAP_SHARED_VALIDATE and MAP_SYNC
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>
6 years agogetcwd.3: Minor tweaks to Carlos O'Donell's patch
Michael Kerrisk [Thu, 12 Apr 2018 11:49:40 +0000 (13:49 +0200)] 
getcwd.3: Minor tweaks to Carlos O'Donell's patch

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agogetcwd.3: srcfix
Michael Kerrisk [Thu, 12 Apr 2018 11:47:03 +0000 (13:47 +0200)] 
getcwd.3: srcfix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agogetcwd.3: Mention that "(unreachable)" is no longer returned for glibc >= 2.27.
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>
6 years agomembarrier.2: wfix
Michael Kerrisk [Thu, 12 Apr 2018 11:37:28 +0000 (13:37 +0200)] 
membarrier.2: wfix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agomembarrier.2: ffix code example
Michael Kerrisk [Thu, 12 Apr 2018 11:30:07 +0000 (13:30 +0200)] 
membarrier.2: ffix code example

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agomembarrier.2: ffix
Michael Kerrisk [Thu, 12 Apr 2018 11:27:19 +0000 (13:27 +0200)] 
membarrier.2: ffix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agomembarrier.2: Some wording improvements
Michael Kerrisk [Thu, 12 Apr 2018 11:25:56 +0000 (13:25 +0200)] 
membarrier.2: Some wording improvements

I'll pass these to Mathieu Desnoyers for checking

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agomembarrier.2: Minor tweaks to Mathieu Desnoyers' patch
Michael Kerrisk [Thu, 12 Apr 2018 11:05:28 +0000 (13:05 +0200)] 
membarrier.2: Minor tweaks to Mathieu Desnoyers' patch

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agomembarrier.2: Add kernel version for MEMBARRIER_CMD_QUERY and MEMBARRIER_CMD_SHARED
Michael Kerrisk [Thu, 12 Apr 2018 11:01:33 +0000 (13:01 +0200)] 
membarrier.2: Add kernel version for MEMBARRIER_CMD_QUERY and MEMBARRIER_CMD_SHARED

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agomembarrier.2: Minor tweaks to MEMBARRIER_CMD_SHARED text
Michael Kerrisk [Thu, 12 Apr 2018 10:59:29 +0000 (12:59 +0200)] 
membarrier.2: Minor tweaks to MEMBARRIER_CMD_SHARED text

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agomembarrier.2: tfix
Michael Kerrisk [Thu, 12 Apr 2018 10:44:38 +0000 (12:44 +0200)] 
membarrier.2: tfix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agomembarrier.2: ffix
Michael Kerrisk [Thu, 12 Apr 2018 10:27:51 +0000 (12:27 +0200)] 
membarrier.2: ffix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agomembarrier.2: srcfix
Michael Kerrisk [Thu, 12 Apr 2018 10:28:17 +0000 (12:28 +0200)] 
membarrier.2: srcfix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agomembarrier.2: Document new membarrier commands introduced in Linux 4.16
Mathieu Desnoyers [Mon, 12 Feb 2018 19:55:49 +0000 (14:55 -0500)] 
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>
6 years agoio_submit.2: Add kernel version numbers for various 'aio_rw_flags' flags
Michael Kerrisk [Thu, 12 Apr 2018 09:19:39 +0000 (11:19 +0200)] 
io_submit.2: Add kernel version numbers for various 'aio_rw_flags' flags

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agoreadv.2: wfix
Michael Kerrisk [Thu, 12 Apr 2018 09:10:41 +0000 (11:10 +0200)] 
readv.2: wfix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agoreadv.2: Remove redundant sentence
Michael Kerrisk [Thu, 12 Apr 2018 09:09:33 +0000 (11:09 +0200)] 
readv.2: Remove redundant sentence

The sentence is out of place, and probably doesn't really add to
the understanding already provided by the rest of the text

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agoreadv.2: srcfix
Michael Kerrisk [Thu, 12 Apr 2018 09:09:23 +0000 (11:09 +0200)] 
readv.2: srcfix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agoio_submit.2: Place 'aio_rw_flags' in alphabetical order
Michael Kerrisk [Thu, 12 Apr 2018 09:08:22 +0000 (11:08 +0200)] 
io_submit.2: Place 'aio_rw_flags' in alphabetical order

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agoio_submit.2: srcfix
Michael Kerrisk [Thu, 12 Apr 2018 09:06:12 +0000 (11:06 +0200)] 
io_submit.2: srcfix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agoreadv.2, io_submit.2: Document RWF_APPEND added in Linux 4.16
Jürg Billeter [Fri, 6 Apr 2018 13:51:06 +0000 (15:51 +0200)] 
readv.2, io_submit.2: Document RWF_APPEND added in Linux 4.16

Signed-off-by: Jürg Billeter <j@bitron.ch>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agounix.7: ERRORS: add EBADF for sending closed file descriptor with SCM_RIGHTS
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;

msg.msg_control = u.buf;
msg.msg_controllen = sizeof(u.buf);
memset(&u, 0, sizeof(u));
cmsg = CMSG_FIRSTHDR(&msg);
cmsg->cmsg_level = SOL_SOCKET;
cmsg->cmsg_type = SCM_RIGHTS;
cmsg->cmsg_len = CMSG_LEN(sizeof(fd));
memcpy(CMSG_DATA(cmsg), &fd, sizeof(fd));

msg.msg_name = NULL;
msg.msg_namelen = 0;
msg.msg_iov = &iov;
msg.msg_iovlen = 1;
msg.msg_flags = 0;

/* 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;

msg.msg_control = u.buf;
msg.msg_controllen = sizeof(u.buf);

msg.msg_name = NULL;
msg.msg_namelen = 0;
msg.msg_iov = &iov;
msg.msg_iovlen = 1;
msg.msg_flags = 0;

iov.iov_base = &c;
iov.iov_len = 1;

if (recvmsg(sockin, &msg, 0) < 0)
return -1;

cmsg = CMSG_FIRSTHDR(&msg);
        if (!cmsg
    || cmsg->cmsg_len != CMSG_LEN(sizeof(fd))
    || cmsg->cmsg_level != SOL_SOCKET
    || cmsg->cmsg_type != SCM_RIGHTS) {
errno = -EINVAL;
return -1;
}

memcpy(&fd, CMSG_DATA(cmsg), sizeof(fd));
return fd;
}

static void child(int sockfd)
{
int newfd = fdpass_recv(sockfd);
assert(newfd < 0);
exit(0);
}

int main(void)
{
int sv[2];
int pid, ret;

assert(socketpair(AF_UNIX, SOCK_STREAM, 0, sv) == 0);

pid = fork();
if (pid == 0) {
close(sv[1]);
child(sv[0]);
}

close(sv[0]);
ret = fdpass_send(sv[1], sv[0]);
printf("fdpass of bad fd return %i (%s)\n", ret, strerror(errno));
return 0;
}

Reported-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agounix.7: wfix
Michael Kerrisk [Thu, 12 Apr 2018 08:42:34 +0000 (10:42 +0200)] 
unix.7: wfix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agoperf_event_open.2: Minor tweak to Song Liu's kprobe/uprobe patch: fix kernel version
Michael Kerrisk [Thu, 12 Apr 2018 08:23:41 +0000 (10:23 +0200)] 
perf_event_open.2: Minor tweak to Song Liu's kprobe/uprobe patch: fix kernel version

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agoperf_event_open.2: Minor tweaks to Song Liu's patch
Michael Kerrisk [Tue, 9 Jan 2018 23:27:53 +0000 (00:27 +0100)] 
perf_event_open.2: Minor tweaks to Song Liu's patch

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agoperf_event_open.2: Add type kprobe and uprobe
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>
6 years agommap.2: Explicitly mention MAP_FIXED_NOREPLACE in EEXIST description
Michael Kerrisk [Thu, 12 Apr 2018 08:06:34 +0000 (10:06 +0200)] 
mmap.2: Explicitly mention MAP_FIXED_NOREPLACE in EEXIST description

Reported-by: Jann Horn <jannh@google.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agommap.2: Minor wording fix
Michael Kerrisk [Thu, 12 Apr 2018 07:57:16 +0000 (09:57 +0200)] 
mmap.2: Minor wording fix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agommap.2: Add a little historical detail on the obsolete MAP_DENYWRITE
Michael Kerrisk [Thu, 12 Apr 2018 07:54:26 +0000 (09:54 +0200)] 
mmap.2: Add a little historical detail on the obsolete MAP_DENYWRITE

In Linux 2..0, do_mmap() had the following check:

                if (flags & MAP_DENYWRITE) {
                        if (file->f_inode->i_writecount > 0)
                                return -ETXTBSY;
                }

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agommap.2: Minor rewording of MAP_FIXED text
Michael Kerrisk [Thu, 12 Apr 2018 07:49:23 +0000 (09:49 +0200)] 
mmap.2: Minor rewording of MAP_FIXED text

The paragraph break-up of the existing text was
somewhat unnatural.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agommap.2: ffix
Michael Kerrisk [Thu, 12 Apr 2018 07:39:50 +0000 (09:39 +0200)] 
mmap.2: ffix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agommap.2: Minor tweaks to Michal Hocko's patch
Michael Kerrisk [Thu, 12 Apr 2018 07:35:25 +0000 (09:35 +0200)] 
mmap.2: Minor tweaks to Michal Hocko's patch

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agommap.2: tfix
Michael Kerrisk [Thu, 12 Apr 2018 07:32:47 +0000 (09:32 +0200)] 
mmap.2: tfix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agommap.2: srcfix: rewrap source lines
Michael Kerrisk [Thu, 12 Apr 2018 07:31:30 +0000 (09:31 +0200)] 
mmap.2: srcfix: rewrap source lines

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agommap.2: ffix
Michael Kerrisk [Thu, 12 Apr 2018 07:28:30 +0000 (09:28 +0200)] 
mmap.2: ffix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agommap.2: Document new MAP_FIXED_NOREPLACE flag
Michal Hocko [Wed, 11 Apr 2018 12:04:52 +0000 (14:04 +0200)] 
mmap.2: Document new MAP_FIXED_NOREPLACE flag

4.17+ kernels offer a new MAP_FIXED_NOREPLACE flag which allows
the caller to atomically probe for a given address range.

[wording heavily updated by John Hubbard]

Cowritten-by: John Hubbard <jhubbard@nvidia.com>
Signed-off-by: Michal Hocko <mhocko@suse.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agokeyring.7: wfix
Konstantin Grinemayer [Mon, 9 Apr 2018 14:54:11 +0000 (14:54 +0000)] 
keyring.7: wfix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agopthread_create.3: Minor fix: reorder table items
Michael Kerrisk [Thu, 5 Apr 2018 18:11:08 +0000 (20:11 +0200)] 
pthread_create.3: Minor fix: reorder table items

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agopthread_create.3: Minor tweaks to Frederic Brault's patch
Michael Kerrisk [Thu, 5 Apr 2018 18:10:23 +0000 (20:10 +0200)] 
pthread_create.3: Minor tweaks to Frederic Brault's patch

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agopthread_create.3: Note default thread stack size for several architectures
Frederic Brault [Mon, 12 Mar 2018 13:03:00 +0000 (14:03 +0100)] 
pthread_create.3: Note default thread stack size for several architectures

I am trying to fix a FIXME in the pthread_create.3 manpage.
It says info about default thread stack size should be put in
pthread_attr_setstacksize.3.

And pthread_attr_setstacksize.3 says "For details on the default
stack size of new threads, see pthread_create(3)".

So I list the default values for several architectures, starting
from glibc 2.12 (and still valid on current git glibc).

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agowait4.2: Soften the warning against the use of wait3()/wait4()
Michael Kerrisk [Sun, 1 Apr 2018 02:59:48 +0000 (04:59 +0200)] 
wait4.2: Soften the warning against the use of wait3()/wait4()

These functions are nonstandard, but there is no replacement.

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

Reported-by: Martin Mares <mj@ucw.cz>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agold.so.8: wfix
Michael Kerrisk [Wed, 28 Mar 2018 03:03:32 +0000 (05:03 +0200)] 
ld.so.8: wfix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agold.so.8: Remove unneeded mention of PATH in discussion of LD_LIBRARY_PATH
Michael Kerrisk [Wed, 28 Mar 2018 03:01:22 +0000 (05:01 +0200)] 
ld.so.8: Remove unneeded mention of PATH in discussion of LD_LIBRARY_PATH

This brief sentence doesn't add value to the text.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agold.so.8: Make lack of separator escaping explicit
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>
6 years agotsearch.3: tdelete() can return dangling pointers
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;
}

int main(void) {
    int *ptr;
    void *val, *parent;

    ptr = xmalloc(sizeof(int));
    *ptr = 1234;
    val = tsearch((void*)ptr, &root, compare);
    assert(*(int**)val == ptr);
    printf("root: %p\n", root);

    parent = tdelete((void*)ptr, &root, compare);
    printf("tdelete return value: %p; new root: %p\n", parent, root);

    return 0;
}
$ gcc -o bogus_tdelete bogus_tdelete.c -std=gnu99 -Wall
$ gdb ./bogus_tdelete
GNU gdb (GDB) 7.9-gg19
[...]
(gdb) break free
Function "free" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (free) pending.
(gdb) run
Starting program: /usr/local/google/home/jannh/tmp/bogus_tdelete
[...]
root: 0x555555756030

Breakpoint 1, 0x00007ffff7ab54e0 in free () from [...]
(gdb) print (void*)$rdi
$1 = (void *) 0x555555756030
(gdb) cont
Continuing.
tdelete return value: 0x555555756030; new root: (nil)
[Inferior 1 (process 56564) exited normally]
(gdb) quit

Therefore, explicitly note that tdelete() may return bad pointers
that must not be accessed.

Signed-off-by: Jann Horn <jannh@google.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agotsearch.3: Clarify items vs nodes
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>
6 years agoopen.2: Document more -ETXTBSY conditions
Jann Horn [Tue, 20 Mar 2018 01:14:02 +0000 (02:14 +0100)] 
open.2: Document more -ETXTBSY conditions

The first one happens in
do_filp_open -> path_openat -> do_last -> handle_truncate -> do_truncate
-> notify_change -> simple_setattr -> setattr_prepare -> inode_newsize_ok.

Demo:

[...]
[...]
[...]
open("/x", O_WRONLY|O_CREAT|O_TRUNC, 0666) = -1 ETXTBSY (Text file busy)
[...]
[...]
open("/x", O_WRONLY|O_CREAT, 0666)      = 3
dup2(3, 1)                              = 1
close(3)                                = 0
read(0, "\0\0\0\0[...]"..., 512) = 512
write(1, "\0\0\0\0[...]"..., 512) = 512
[...]

The second one is in kernel_read_file -> deny_write_access.

Signed-off-by: Jann Horn <jannh@google.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agosocket.7: Fix error in SO_INCOMING_CPU code snippet
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>
6 years agonetwork_namespaces.7: Add cross reference to unix(7)
Michael Kerrisk [Sat, 10 Mar 2018 19:57:03 +0000 (20:57 +0100)] 
network_namespaces.7: Add cross reference to unix(7)

For further information on UNIX domain abstract sockets.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agoclone.2: wfix
Michael Kerrisk [Fri, 9 Mar 2018 08:54:40 +0000 (09:54 +0100)] 
clone.2: wfix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agoclone.2: wfix
Michael Kerrisk [Fri, 9 Mar 2018 08:44:54 +0000 (09:44 +0100)] 
clone.2: wfix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agotime.7: Mention clock_gettime()/clock_settime() rather than [gs]ettimeofday()
Michael Kerrisk [Fri, 9 Mar 2018 07:57:45 +0000 (08:57 +0100)] 
time.7: Mention clock_gettime()/clock_settime() rather than [gs]ettimeofday()

gettimeofday() is declared obsolete by POSIX. Mention instead
the modern APIs for working with the realtime clock.

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

Reported-by: Enrique Garcia <cquike@arcor.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agosysfs.5: Add brief note on /sys/fs/smackfs
Michael Kerrisk [Thu, 8 Mar 2018 11:30:59 +0000 (12:30 +0100)] 
sysfs.5: Add brief note on /sys/fs/smackfs

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agogetrlimit.2: CAP_SYS_RESOURCE capability is required in *initial user namespace*
Michael Kerrisk [Thu, 8 Mar 2018 11:20:59 +0000 (12:20 +0100)] 
getrlimit.2: CAP_SYS_RESOURCE capability is required in *initial user namespace*

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agoseccomp.2: Note which architectures support seccomp BPF
Michael Kerrisk [Wed, 7 Mar 2018 09:22:03 +0000 (10:22 +0100)] 
seccomp.2: Note which architectures support seccomp BPF

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agoseccomp.2: wfix: s/prctl/ptrace/
Michael Kerrisk [Wed, 7 Mar 2018 09:02:07 +0000 (10:02 +0100)] 
seccomp.2: wfix: s/prctl/ptrace/

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agoseccomp.2: ffix
Michael Kerrisk [Wed, 7 Mar 2018 08:58:42 +0000 (09:58 +0100)] 
seccomp.2: ffix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agomount.2: Remove a couple of obsolete EBUSY errors
Michael Kerrisk [Tue, 6 Mar 2018 08:02:19 +0000 (09:02 +0100)] 
mount.2: Remove a couple of obsolete EBUSY errors

As far as I can tell, these EBUSY errors disappeared
with the addition of stackable mounts in Linux 2.4.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agobpf.2: Update list of architectures that support JITed eBPF
Michael Kerrisk [Mon, 5 Mar 2018 14:42:18 +0000 (15:42 +0100)] 
bpf.2: Update list of architectures that support JITed eBPF

And note kernel version numbers where support is added.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agobpf.2: Kernel 4.15 added CONFIG_BPF_JIT_ALWAYS_ON
Michael Kerrisk [Mon, 5 Mar 2018 14:36:26 +0000 (15:36 +0100)] 
bpf.2: Kernel 4.15 added CONFIG_BPF_JIT_ALWAYS_ON

This causes the JIT compiler to be always on and
forces bpf_jit_enable to 1.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agoseccomp.2: Note that execve() may change syscall numbers during life of process
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>
6 years agoseccomp.2: in EXAMPLE, clearly note that x32 syscalls are >= X32_SYSCALL_BIT
Michael Kerrisk [Mon, 5 Mar 2018 09:17:43 +0000 (10:17 +0100)] 
seccomp.2: in EXAMPLE, clearly note that x32 syscalls are >= X32_SYSCALL_BIT

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agomount.2: ERRORS: add EBUSY for the case of trying to stack same mount twice
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>
6 years agoelf.5: SEE ALSO: add patchelf(1)
Michael Kerrisk [Fri, 2 Mar 2018 13:34:41 +0000 (14:34 +0100)] 
elf.5: SEE ALSO: add patchelf(1)

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agomount_namespaces.7: Note another case where shared "peer groups" are formed
Michael Kerrisk [Sun, 25 Feb 2018 15:42:16 +0000 (16:42 +0100)] 
mount_namespaces.7: Note another case where shared "peer groups" are formed

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agomount_namespaces.7: ffix
Michael Kerrisk [Sun, 25 Feb 2018 15:37:08 +0000 (16:37 +0100)] 
mount_namespaces.7: ffix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agonetwork_namespaces.7: Network namespaces isolate the UNIX domain abstract socket...
Michael Kerrisk [Sat, 24 Feb 2018 16:49:24 +0000 (17:49 +0100)] 
network_namespaces.7: Network namespaces isolate the UNIX domain abstract socket namespace

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agommap.2: Clarify that when addr==NULL, address chosen by kernel is page-aligned
Michael Kerrisk [Sat, 24 Feb 2018 18:34:28 +0000 (19:34 +0100)] 
mmap.2: Clarify that when addr==NULL, address chosen by kernel is page-aligned

Reported-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agowait.2: wait() and waitpid() block the calling thread (not process)
Michael Kerrisk [Sat, 24 Feb 2018 18:02:50 +0000 (19:02 +0100)] 
wait.2: wait() and waitpid() block the calling thread (not process)

Reported-by: Robin Kuzmin <kuzmin.robin@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agorecvmmsg.2: tfix
Mattias Andrée [Wed, 14 Feb 2018 12:35:56 +0000 (13:35 +0100)] 
recvmmsg.2: tfix

recvmmsq -> recvmmsg

Signed-off-by: Mattias Andrée <maandree@kth.se>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agoldconfig.8: tfix
Michael Kerrisk [Sat, 24 Feb 2018 17:58:04 +0000 (18:58 +0100)] 
ldconfig.8: tfix

Reported-by: Howard Johnson <hwj@BridgeportContractor.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agosyscall.2: Add riscv
Adam Borowski [Wed, 21 Feb 2018 01:40:15 +0000 (02:40 +0100)] 
syscall.2: Add riscv

Signed-off-by: Adam Borowski <kilobyte@angband.pl>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
6 years agouser_namespaces.7: wfix
Michael Kerrisk [Fri, 23 Feb 2018 09:38:47 +0000 (10:38 +0100)] 
user_namespaces.7: wfix

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