]>
git.ipfire.org Git - thirdparty/man-pages.git/log
Michael Kerrisk [Mon, 30 Apr 2018 15:53:13 +0000 (17:53 +0200)]
Ready for 4.16
Michael Kerrisk [Mon, 30 Apr 2018 15:53:01 +0000 (17:53 +0200)]
Removed trailing white space at end of lines
Michael Kerrisk [Mon, 30 Apr 2018 15:53:01 +0000 (17:53 +0200)]
Changes: Expanded tabs
Michael Kerrisk [Mon, 30 Apr 2018 15:42:24 +0000 (17:42 +0200)]
Changes: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Michael Kerrisk [Mon, 30 Apr 2018 15:41:31 +0000 (17:41 +0200)]
execve.2, fallocate.2, getrlimit.2, io_submit.2, membarrier.2, mmap.2, msgget.2, open.2, ptrace.2, readv.2, semget.2, shmget.2, shutdown.2, syscall.2, wait.2, wait4.2, crypt.3, encrypt.3, fseek.3, getcwd.3, makedev.3, pthread_create.3, puts.3, tsearch.3, elf.5, filesystems.5, group.5, passwd.5, sysfs.5, mount_namespaces.7, posixoptions.7, time.7, unix.7, vdso.7, xattr.7, ld.so.8: tstamp
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Michael Kerrisk [Mon, 30 Apr 2018 15:35:35 +0000 (17:35 +0200)]
Changes: Ready for 4.16
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Michael Kerrisk [Fri, 27 Apr 2018 12:44:52 +0000 (14:44 +0200)]
syscall.2: spfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Michael Kerrisk [Fri, 27 Apr 2018 12:44:20 +0000 (14:44 +0200)]
keyctl.2, sincos.3: spfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Michael Kerrisk [Fri, 27 Apr 2018 12:43:23 +0000 (14:43 +0200)]
bpf.2, sched_setattr.2, crypt.3, elf.5, proc.5, fanotify.7, feature_test_macros.7, sched.7: spfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Michael Kerrisk [Fri, 27 Apr 2018 12:40:53 +0000 (14:40 +0200)]
keyctl.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Michael Kerrisk [Fri, 27 Apr 2018 12:40:24 +0000 (14:40 +0200)]
fallocate.2, keyctl.2, bzero.3: spfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Michael Kerrisk [Fri, 27 Apr 2018 12:38:59 +0000 (14:38 +0200)]
copy_file_range.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Michael Kerrisk [Fri, 27 Apr 2018 12:10:32 +0000 (14:10 +0200)]
namespaces.7: Mention that device ID should also be checked when comparing NS symlinks
When comparing two namespaces symlinks to see if they refer to
the same namespace, both the inode number and the device ID
should be compared. This point was already made clear in
ioctl_ns(2), but was missing from this page.
Reported-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Jakub Wilk [Thu, 26 Apr 2018 21:37:12 +0000 (23:37 +0200)]
open.2: Add missing argument for snprintf() in example code
Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Jakub Wilk [Thu, 26 Apr 2018 21:28:17 +0000 (23:28 +0200)]
unix.7: tfix
Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Jakub Wilk [Thu, 26 Apr 2018 21:28:16 +0000 (23:28 +0200)]
capabilities.7: tfix
Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Michael Kerrisk [Tue, 24 Apr 2018 16:25:44 +0000 (18:25 +0200)]
vdso.7: VDSO symbols (system calls) are not visible to seccomp(2) filters
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Michael Kerrisk [Fri, 20 Apr 2018 11:20:33 +0000 (13:20 +0200)]
seteuid.2: grfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Michael Kerrisk [Thu, 19 Apr 2018 18:07:23 +0000 (20:07 +0200)]
setgid.2: wfix: Make wording consistent with setuid(2)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Michael Kerrisk [Thu, 19 Apr 2018 13:00:04 +0000 (15:00 +0200)]
fseek.3: Improve EPIPE error text
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Michael Kerrisk [Thu, 19 Apr 2018 12:57:17 +0000 (14:57 +0200)]
fseek.3: ERRORS: EBADF should be ESPIPE
Reported-by: Andy Owen <andrew.owen@dolby.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Michael Kerrisk [Thu, 19 Apr 2018 09:18:31 +0000 (11:18 +0200)]
capabilities.7: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Michael Kerrisk [Sat, 14 Apr 2018 20:35:53 +0000 (22:35 +0200)]
msgget.2, semget.2, shmget.2: The purpose of "flags" == 0 is to obtain ID of an existing IPC object
This was implied in these pages, but the meaning of "flags" == 0
could be more explicit, as indicated by questions such as
https://stackoverflow.com/questions/
49833569 /flag-value-of-semget-function
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Michael Kerrisk [Sat, 14 Apr 2018 20:21:22 +0000 (22:21 +0200)]
msgget.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Michael Kerrisk [Sat, 14 Apr 2018 20:20:40 +0000 (22:20 +0200)]
shmget.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Michael Kerrisk [Fri, 13 Apr 2018 19:13:59 +0000 (21:13 +0200)]
capabilities.7: srcfix: FIXME
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Michael Kerrisk [Fri, 13 Apr 2018 19:04:29 +0000 (21:04 +0200)]
capabilities.7: Rework file capability versioning and namespaced file caps text
There was some confused missing of concepts between the
two subsections, and some other details that needed fixing up.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Michael Kerrisk [Fri, 13 Apr 2018 15:22:03 +0000 (17:22 +0200)]
capabilities.7: Explain when VFS_CAP_REVISION_3 file capabilities have effect
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Michael Kerrisk [Fri, 13 Apr 2018 13:41:10 +0000 (15:41 +0200)]
capabilities.7: Explain rules that determine version of security.capability xattr
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Michael Kerrisk [Fri, 13 Apr 2018 11:42:11 +0000 (13:42 +0200)]
capabilities.7: Explain term "namespace root user ID"
Confirmed with Serge Hallyn that: "nsroot" means the UID 0
in the namespace as it would be mapped into the initial userns.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Michael Kerrisk [Sun, 14 Jan 2018 20:39:15 +0000 (21:39 +0100)]
capabilities.7: Document namespaced-file capabilities
Cowritten-by: Serge E. Hallyn <serge@hallyn.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Michael Kerrisk [Sat, 13 Jan 2018 19:55:53 +0000 (20:55 +0100)]
capabilities.7: Describe file capability versioning
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Michael Kerrisk [Fri, 13 Apr 2018 09:32:43 +0000 (11:32 +0200)]
encrypt.3: Replace text that is duplicated in crypt(3) with a cross reference
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Michael Kerrisk [Fri, 13 Apr 2018 19:22:52 +0000 (21:22 +0200)]
crypt.3: tfix
Reported-by: Nikos Mavrogiannopoulos <nmavrogi@redhat.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Michael Kerrisk [Fri, 13 Apr 2018 09:30:39 +0000 (11:30 +0200)]
crypt.3: Tweaks to Carlos O'Donell's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Michael Kerrisk [Fri, 13 Apr 2018 09:25:34 +0000 (11:25 +0200)]
encrypt.3: srcfix: rewrap source lines
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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: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>
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>
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 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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>