Commit Graph

17813 Commits

Author SHA1 Message Date
Michael Kerrisk b7f97e8ea5 socket.7: Minor tweaks
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-04-20 16:39:51 +02:00
Francois Saint-Jacques ca1969e92b socket.7: Document SO_INCOMING_CPU
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-04-20 16:39:50 +02:00
Michael Kerrisk fedefd800e kexec_load.2, sched_setaffinity.2, bootparam.7: Documentation/kernel-parameters.txt is now in Documentation/admin-guide/
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-04-20 13:22:12 +02:00
Mike Frysinger 261c7e1d15 prctl(2): PR_SET_MM: Refine CONFIG_CHECKPOINT_RESTORE requirement
The Linux 3.10 release dropped the c/r requirement and opened it
up to all users.

Signed-off-by: Mike Frysinger <vapier@chromium.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-04-19 15:52:04 +02:00
Mike Frysinger 7e3236a5a0 prctl(2): PR_SET_MM: Document new PR_SET_MM_MAP{,_SIZE} helpers
Signed-off-by: Mike Frysinger <vapier@chromium.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-04-19 15:52:04 +02:00
Mike Frysinger a87d0921a7 prctl(2): PR_SET_MM: Document arg4/arg5 zero behavior
The kernel will immediately reject calls where arg4/arg5 are not
zero.  See kernel/sys.c:prctl_set_mm().

Signed-off-by: Mike Frysinger <vapier@chromium.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-04-19 15:52:04 +02:00
Michael Kerrisk d983a4c854 rename.2: Note that there is no glibc wrapper for renameat2()
Reported-by: Georg Sauthoff <mail@georg.so>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-04-19 15:52:04 +02:00
Michael Kerrisk 42cfcef15e proc.5: Refer to namespaces(7) for discussion of /proc/sys/user/* files
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-04-19 15:52:04 +02:00
Michael Kerrisk 5046cb7268 namespaces.7: Document the /proc/sys/user/* files added in Linux 4.9
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-04-19 15:52:04 +02:00
Michael Kerrisk 2f7a331e53 clone.2, unshare.2: Exceeding one of the limits in /proc/sys/user/* can cause ENOSPC
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-04-19 15:52:03 +02:00
Michael Kerrisk b5742eccf1 clone.2, unshare.2: Exceeding the maximum nested user namespace limit now gives ENOSPC
Formerly, if the limit of 32 nested user namespaces was exceeded,
the error EUSERS resulted. Starting with Linux 4.9, the error
is ENOSPC.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-04-19 15:52:03 +02:00
Michael Kerrisk b20e22aeb7 clone.2, unshare.2: CLONE_NEWPID yields ENOSPC if nesting limit of PID namespaces is reached
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-04-19 15:52:03 +02:00
Michael Kerrisk aa825b59ec clone.2: CLONE_NEWCGROUP by an unprivileged process also causes an EPERM error
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-04-19 15:52:03 +02:00
Michael Kerrisk fb509133db pid_namespaces.7: The maximum nesting depth for PID namespaces is 32
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-04-17 21:00:55 +02:00
Michael Kerrisk 96580790f7 sigprocmask.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-04-16 20:57:52 +02:00
Michael Kerrisk b9ad845d01 sigprocmask.2: 'set' and 'oldset' can both be NULL
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-04-16 20:56:20 +02:00
Michael Kerrisk 59e6b4c6be ld.so.8: Minor wording fix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-04-14 09:49:28 +02:00
Marcin Ślusarz b78969acbb stat.2: Tweak description of AT_EMPTY_PATH
Currently it says when dirfd is AT_FDCWD it can be something
other than directory, which doesn't make much sense. Just swap
the order of sentences.

Signed-off-by: Marcin Ślusarz <marcin.slusarz@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-04-10 16:19:15 +02:00
Cyril Hrubis 108e40cccb ioctl_list.2: BLKRASET/BLKRAGET take unsigned long
The BLKRASET/BLKRAGET ioctls() take unsigned long, if I pass int * to
the BLKRAGET ioctl on x86_64 (or on any other arch where sizeof(int) !=
sizeof(long)) the BLKRAGET ioctl will rewrite four bytes on the stack.

If you look at block/ioctl.c in kernel sources you can clearly see that
BLKRAGET ioctl calls put_long().

Compile following reproducer and run it as ./a.out /dev/sda, you can see
that the second member of the array will be zeroed. If you change the
array to have only one member you will see stack smashing trace.

I also wonder if it's OK to pass int value to ioctl() at all, the arg
value seems to be unsigned long in the syscall definition in fs/ioctl.c
and there does not seem to be any glibc magic around the syscall.

-------------------------8<----------------------------

static int fd;

int main(int argc, char *argv[])
{
	int ra[] = {100, 100};

	fd = open(argv[1], O_RDONLY);
	if (fd < 0) {
		perror("open");
		return 1;
	}

	ioctl(fd, BLKRAGET, ra);

	fprintf(stderr, "%i %i\n", ra[0], ra[1]);

	return 0;
}

-------------------------8<----------------------------

Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-04-10 16:16:04 +02:00
Michael Kerrisk f0ed97100f getentropy.3: Some improvements to Nikos Mavrogiannopoulos's patch
Reported-by: Florian Weimer <fw@deneb.enyo.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-04-10 14:10:11 +02:00
Michael Kerrisk 419ba7b3c5 getentropy.3: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-04-10 14:02:54 +02:00
Nikos Mavrogiannopoulos 9cf011f94b getentropy.3: Correct header file
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-04-10 14:00:22 +02:00
Florian Weimer 6c1f939f08 nsswitch.conf.5: Mention sudoers
It turns out that sudo drops things into nsswitch.conf, too.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-04-10 13:47:50 +02:00
Michael Kerrisk 61428042e2 bzero.3: Add correct header file for exlicit_bzero()
Reported-by: Zack Weinberg <zackw@panix.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-04-10 13:47:50 +02:00
Michael Kerrisk e6af0066c8 bzero.3: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-04-10 13:47:50 +02:00
Jakub Wilk 725399bba7 zdump.8: Add OPTIONS section heading
Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-04-10 13:47:50 +02:00
Jakub Wilk a263fdde88 environ.7: Fix name of function that honors TMPDIR
tempnam() takes the TMPDIR environment variable into account, unlike
tmpnam(), which always creates pathnames within /tmp.

Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-04-10 13:47:50 +02:00
Michael Kerrisk acf0d7db21 fcntl.2: File seals are not generally applicable to tmpfs(5) files
As far as I can see, file seals can be applied only to
memfd_create(2) file descriptors. This was checked by experiment
and by reading mm/shmem.c::shmem_get_inode((), where one finds
the following line that applies to all new shmem files:

                info->seals = F_SEAL_SEAL;

Only in the code of the memfd_create() system call is this
setting reversed (in mm/shmem.c::memfd_create):

        if (flags & MFD_ALLOW_SEALING)
                info->seals &= ~F_SEAL_SEAL;

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-04-10 13:47:50 +02:00
Michael Kerrisk 5c92cfd352 mmap.2: Remove ancient reference to flags that appear on some other systems
MAP_AUTOGROW, MAP_AUTORESRV, MAP_COPY, and MAP_LOCAL may have
appeared on some systems many years ago, but  the discussion here
mentions no details and the systems and flags probably ceased to
be relevant long ago. So, remove this text.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-04-10 13:47:50 +02:00
Michael Kerrisk e867555833 proc.5: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-04-10 13:47:50 +02:00
Michael Kerrisk b53015848e proc.5: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-04-10 13:47:49 +02:00
Michael Kerrisk a88f0e061a _exit.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-04-10 13:47:49 +02:00
Michael Kerrisk ccb3ff19e4 _exit.2: Only the least significant byte of exit status is passed to the parent
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-04-10 13:47:49 +02:00
Michael Kerrisk 661cfc7eca execve.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-04-10 13:47:49 +02:00
Michael Kerrisk 8b7365ac02 execve.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-04-10 13:47:49 +02:00
Michael Kerrisk 765633a200 tmpfs.5: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-04-10 13:47:49 +02:00
Michael Kerrisk 2a73d3e870 sigaction.2: Show the prototype of an SA_SIGINFO signal handler
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-04-10 13:47:49 +02:00
Michael Kerrisk 69ccc9f11d fcntl.2: Mention memfd_create() in the discussion of file seals
Give the reader a clue about what kinds of objects can
be employed with file seals.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-04-10 13:47:49 +02:00
Michael Kerrisk 547afefe40 shm_open.3: Clarify that POSIX shared memory uses tmpfs(5)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-04-10 13:47:49 +02:00
Michael Kerrisk 967631f2c8 epoll_ctl.2: Give the reader a clue that the 'events' field can be zero
'events' specified as zero still allows EPOLLHUP and
EPOLLERR to be reported.

Reported-by: Nicolas Biscos <nicolas.biscos+man7@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-04-10 13:47:49 +02:00
Michael Kerrisk 25c2dd2f87 epoll_ctl.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-03-31 06:54:35 +02:00
Michael Kerrisk 0dea65b805 epoll_ctl.2: Defer to poll(2) for an explanation of EPOLLIN
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-03-31 06:54:35 +02:00
Michael Kerrisk 4258cf6d03 epoll_ctl.2: EPOLLERR is also set on write end of a pipe when the read end is closed
Reported-by: Nicolas Biscos <nicolas.biscos+man7@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-03-31 06:54:22 +02:00
Michael Kerrisk b3da9249db poll.2: POLLERR is also set on write end of a pipe when the read end is closed
Reported-by: Nicolas Biscos <nicolas.biscos+man7@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-03-31 06:54:17 +02:00
Michael Kerrisk 1a2e88acd6 tcp.7: Note indications for OOB data given by select(2) and poll(2)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-03-30 17:30:38 +02:00
Michael Kerrisk d871cf8569 select.2: Refer to POLLPRI in poll(2) for info on exceptional conditions
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-03-30 17:30:38 +02:00
Michael Kerrisk cd2ea4b451 select.2: Give a hint that sets must be reinitialized if using select() in a loop
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-03-30 17:30:38 +02:00
Michael Kerrisk 47da6ce7fd select.2: Minor wording fixes
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-03-30 17:30:38 +02:00
Michael Kerrisk e629dd7890 poll.2: Expand discussion of POLLPRI
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-03-29 12:30:50 +02:00
Michael Kerrisk 3352f57925 ioctl_tty.2: Packet mode state change events give POLLPRI events for poll(2)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-03-29 12:30:50 +02:00