Commit Graph

4950 Commits

Author SHA1 Message Date
Michael Kerrisk f54da10e44 ioctl_fat.2: Tweaks to Heinrich's new page
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 08:32:14 +01:00
Michael Kerrisk 68232827ac ioctl.2: SEE ALSO: add ioctl_fat(2)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 08:32:13 +01:00
Michael Kerrisk eeed01713b ioctl_fat.2: Rename from ioctl-fat.2
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 08:32:13 +01:00
Heinrich Schuchardt a1cd6a8ff6 ioctl-fat.2: New man page for the ioctl(2) FAT API
The ioctl(2) system call may be used to retrieve information about
the FAT file system and to set file attributes.

Signed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 08:32:13 +01:00
Michael Kerrisk 6da93ae616 modify_ldt.2: Minor fixups
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 08:32:13 +01:00
Andy Lutomirski f89f50fa38 modify_ldt.2: Clarify the lm bit's behavior
The lm bit should never have existed in the first place.  Sigh.

Signed-off-by: Andy Lutomirski <luto@amacapital.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 08:32:13 +01:00
Michael Kerrisk ed26cc5a2e set_thread_area.2: Tweaks after feedback from Andy Lutomirski
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 08:32:13 +01:00
Michael Kerrisk ef8db991f1 arch_prctl.2: Tweaks after feedback from Andy Lutomirski
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 08:32:13 +01:00
Michael Kerrisk c79a3031bb modify_ldt.2: Tweaks after feedback from Andy Lutomirski
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 08:32:13 +01:00
Michael Kerrisk 520789667e set_thread_area.2: Various fixes for Andy Lutomirski's patch
Notably, various info about get_thread_area() got dropped
during the merge of the two pages.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 08:32:13 +01:00
Michael Kerrisk 5c3f9e21f1 arch_prctl.2: Minor tweaks to Andy Lutomirski's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 08:32:13 +01:00
Michael Kerrisk 7acf749e4f modify_ldt.2: Minor tweaks to Andy Lutomirski's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 08:32:13 +01:00
Andy Lutomirski 14620a2531 arch_prctl.2, set_thread_area.2, get_thread_area.2: Improve TLS documentation
The documentation for set_thread_area was very vague.  This
improves it, accounts for recent kernel changes, and merges
it with get_thread_area.2.

get_thread_area.2 now becomes a link.

While I'm at it, clarify the related arch_prctl.2 man page.

Signed-off-by: Andy Lutomirski <luto@amacapital.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 08:32:13 +01:00
Andy Lutomirski 38f7c37983 modify_ldt.2: Overhaul the documentation
This clarifies the behavior and documents all four functions.

Signed-off-by: Andy Lutomirski <luto@amacapital.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 08:32:13 +01:00
Akihiro Motoki 97c0185b99 restart_syscall.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 08:32:13 +01:00
Michael Kerrisk 1fbe05e023 stat.2: NOTES: add "C library/kernel ABI differences" subheading
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 08:32:13 +01:00
Michael Kerrisk 858f88b8a6 wait.2: Note that waitpid() is a wrapper for wait4()
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 08:32:13 +01:00
Michael Kerrisk 3e5977d606 getpid.2: NOTES: add "C library/kernel ABI differences" subheading
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 08:32:13 +01:00
Michael Kerrisk a99f81e6b6 nice.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 08:32:13 +01:00
Michael Kerrisk b8c523866d wait4.2: NOTES: add "C library/kernel ABI differences" subheading
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 08:32:13 +01:00
Michael Kerrisk 5c68d6c79b killpg.2: NOTES: add "C library/kernel ABI differences" subheading
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 08:32:13 +01:00
Michael Kerrisk 7704b6a995 wait.2: Note that wait() is a library function implemented via wait4()
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 08:32:13 +01:00
Michael Kerrisk ae6e18f4b7 fork.2: NOTES: add "C library/kernel ABI differences" subheading
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 08:32:13 +01:00
Vince Weaver 50e4319c2a perf_event_open.2: Clarify PERF_EVENT_IOC_REFRESH behavior
Currently the PERF_EVENT_IOC_REFRESH ioctl, when applied to a group
leader, will refresh all children.  Also if a refresh value of 0
is chosen then the refresh becomes infinite (never runs out).
Back in 2011 PAPI was relying on these behaviors but I was told
that both were unsupported and subject to being removed at any time.
(See https://lkml.org/lkml/2011/5/24/337 )
However the behavior has not been changed.

This patch updates the manpage to still list the behavior as
unsupported, but removes the inaccurate description of it
only being a problem with 2.6 kernels.

Signed-off-by: Vince Weaver <vincent.weaver@maine.edu>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 08:32:13 +01:00
Heinrich Schuchardt 7f810a615d fork.2: Child and parent run in separate memory spaces
fork.2 should clearly point out that child and parent
process run in separate memory spaces.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 08:32:13 +01:00
Michael Kerrisk 53cdec414b ptrace.2: Minor tweaks to Denys Vlasenko's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 08:32:12 +01:00
Denys Vlasenko 28e2ca574f ptrace.2: Add information on PTRACE_SEIZE versus PTRACE_ATTACH differences
Extend description of PTRACE_SEIZE with the short summary of its
differences from PTRACE_ATTACH.

The following paragraph:

PTRACE_EVENT_STOP
       Stop induced by PTRACE_INTERRUPT command, or group-stop, or ini-
       tial  ptrace-stop when a new child is attached (only if attached
       using PTRACE_SEIZE), or PTRACE_EVENT_STOP if PTRACE_SEIZE was used.

has an editing error (the part after last comma makes no sense).
Removing it.

Mention that legacy post-execve SIGTRAP is disabled by PTRACE_SEIZE.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 08:32:12 +01:00
Michael Kerrisk 0e48cd5a7c getxattr.2: Add pointer to example in listxattr(2)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 08:32:12 +01:00
Michael Kerrisk a8215524ac listxattr.2: Add note on handling increases in sizes of keys or values
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 08:32:12 +01:00
Michael Kerrisk 9c321ba20b listxattr.2: Minor fixups
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 08:32:12 +01:00
Heinrich Schuchardt 636a38776c listxattr.2: Provide example program
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 08:32:11 +01:00
Michael Kerrisk 0f2ea061ef capget.2: Rewrite discussion of kernel versions that support file capabilities
File capabilities ceased to be optional in Linux 2.6.33.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 08:32:11 +01:00
Michael Kerrisk 1872536844 capget.2: tfix 2015-02-21 08:32:11 +01:00
Michael Kerrisk 58bdfd464d capget.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 08:32:11 +01:00
Michael Kerrisk 5d33c0808b capget.2: Document V3 capabilities constants
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 08:32:11 +01:00
Michael Kerrisk 487c2f050d mmap.2: grfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 08:32:11 +01:00
James Hunt 674f11ecbc ptrace.2: Explain behaviour should ptrace tracer call execve(2)
This behaviour was verified by reading the kernel source and
confirming the behaviour using a test program.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 08:32:11 +01:00
Eric Wong 7b6a329977 sendfile.2: Caution against modifying sent pages
The following program illustrates the difference between TCP
and Unix stream sockets doing sendfile.  Since TCP implements
zero-copy, the new modifications to the file transferred is
seen upon reading despite the modifications happening after
sendfile was last called.

Unix stream sockets do not implement zero-copy (as of
Linux 3.15), so readers continue to see the contents of the
file at the time it was sent, not as they are at the time of
reading.

----------------- sendfile-mod.c ---------------
	#define _GNU_SOURCE
	#include <sys/ioctl.h>
	#include <sys/types.h>
	#include <sys/socket.h>
	#include <sys/sendfile.h>
	#include <arpa/inet.h>
	#include <stdio.h>
	#include <errno.h>
	#include <string.h>
	#include <unistd.h>
	#include <assert.h>
	#include <fcntl.h>

static void tcp_socketpair(int sv[2])
{
	struct sockaddr_in addr;
	socklen_t addrlen = sizeof(addr);
	int l = socket(PF_INET, SOCK_STREAM, 0);
	int c = socket(PF_INET, SOCK_STREAM, 0);
	int a;
	int val = 1;

	addr.sin_family = AF_INET;
	addr.sin_addr.s_addr = INADDR_ANY;
	addr.sin_port = 0;
	assert(0 == bind(l, (struct sockaddr*)&addr, addrlen));
	assert(0 == listen(l, 1024));
	assert(0 == getsockname(l, (struct sockaddr *)&addr, &addrlen));
	assert(0 == connect(c, (struct sockaddr *)&addr, addrlen));
	a = accept4(l, NULL, NULL, SOCK_NONBLOCK);
	assert(a >= 0);
	close(l);
	assert(0 == ioctl(c, FIONBIO, &val));
	sv[0] = a;
	sv[1] = c;
}

int main(int argc, char *argv[])
{
	int pair[2];
	FILE *tmp = tmpfile();
	int tfd;
	char buf[16384];
	ssize_t w, r;
	size_t i;
	const size_t n = 2048;
	off_t off = 0;
	char expect[4096];
	int flags = SOCK_STREAM|SOCK_NONBLOCK;

	tfd = fileno(tmp);
	assert(tfd >= 0);

	/* prepare the tempfile */
	memset(buf, 'a', sizeof(buf));
	for (i = 0; i < n; i++)
		assert(sizeof(buf) == write(tfd, buf, sizeof(buf)));

	if (argc == 2 && strcmp(argv[1], "unix") == 0)
		assert(0 == socketpair(AF_UNIX, flags, 0, pair));
	else if (argc == 2 && strcmp(argv[1], "pipe") == 0)
		assert(0 == pipe2(pair, O_NONBLOCK));
	else
		tcp_socketpair(pair);

	/* fill up the socket buffer */
	for (;;) {
		w = sendfile(pair[1], tfd, &off, n);
		if (w > 0)
			continue;
		if (w < 0 && errno == EAGAIN)
			break;
		assert(0 && "unhandled error" && w && errno);
	}
	printf("wrote off=%lld\n", (long long)off);

	/* rewrite the tempfile */
	memset(buf, 'A', sizeof(buf));
	assert(0 == lseek(tfd, 0, SEEK_SET));
	for (i = 0; i < n; i++)
		assert(sizeof(buf) == write(tfd, buf, sizeof(buf)));

	/* we should be reading 'a's, not 'A's */
	memset(expect, 'a', sizeof(expect));
	do {
		r = read(pair[0], buf, sizeof(expect));

		/* TCP fails here since it is zero copy (on Linux 3.15.5) */
		if (r > 0)
			assert(memcmp(buf, expect, r) == 0);
	} while (r > 0);

	return 0;
}

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 08:32:11 +01:00
Peng Haitao 87ab04792c clone.2: Fix description of CLONE_PARENT_SETTID
CLONE_PARENT_SETTID only stores child thread ID in parent memory.

Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 08:32:11 +01:00
Kevin Easton 8a76b19ecd clone.2, execve.2: Document interaction of execve(2) with CLONE_FILES
This patch the fact that a successful execve(2) in a process that
is sharing a file descriptor table results in unsharing the table.

I discovered this through testing and verified it by source
inspection - there is a call to unshare_files() early in
do_execve_common().

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 08:32:11 +01:00
Jan Stancek 3d350ba3c9 migrate_pages.2: Document EFAULT and EINVAL errors
I encountered these errors while writing testcase for migrate_pages
syscall for LTP (Linux test project).

I checked stable kernel tree 3.5 to see which paths return these.
Both can be returned from get_nodes(), which is called from:
SYSCALL_DEFINE4(migrate_pages, pid_t, pid, unsigned long, maxnode,
                const unsigned long __user *, old_nodes,
                const unsigned long __user *, new_nodes)

The testcase does following:
EFAULT
a) old_nodes/new_nodes is area mmaped with PROT_NONE
b) old_nodes/new_nodes is area not mmapped in process address
   space, -1 or area that has been just munmmaped

EINVAL
a) maxnodes overflows kernel limit
b) new_nodes contain node, which has no memory or does not exist
   or is not returned for get_mempolicy(MPOL_F_MEMS_ALLOWED).

Signed-off-by: Jan Stancek <jstancek@redhat.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 08:32:11 +01:00
Michael Kerrisk 7949b871f5 cacheflush.2: Refer reader to BUGS in discussion of EINVAL error
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 08:32:10 +01:00
Ralf Baechle 7bbc267ac3 cacheflush.2: Update some portability details and bugs
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 08:32:10 +01:00
Mark Seaborn b22b377bd4 mprotect.2: mention effect of READ_IMPLIES_EXEC personality flag
I puzzled over mprotect()'s effect on /proc/*/maps for a while
yesterday -- it was setting "x" without PROT_EXEC being specified.
Here is a patch to add some explanation.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 08:31:58 +01:00
Michael Kerrisk cae279c4d5 access.2: Tweaks to Denys Vlasenko's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 07:58:28 +01:00
Denys Vlasenko 062d1cb332 access.2: Explain how access() check treats capabilities
We have users who are terribly confused why their binaries
with CAP_DAC_OVERRIDE capability see EACCESS from access() calls,
but are able to read the file.

The reason is access() isn't the "can I read/write/execute this
file?" question, it is the "(assuming that I'm a setuid binary,)
can *the user who invoked me* read/write/execute this file?"
question.

That's why it uses real UIDs as documented, and why it ignores
capabilities when capability-endorsed binaries are run by non-root
(this patch adds this information).

To make users more likely to notice this less-known detail,
the patch expands the explanation with rationale for this logic
into a separate paragraph.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
CC: linux-man@vger.kernel.org
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 07:58:28 +01:00
Michael Kerrisk 4b081d8d9d sched_setattr.2: SYNOPSIS: remove 'const' from 'attr' sched_getattr() argument
Reported-by: Christophe Blaess <Christophe@blaess.fr>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 07:58:28 +01:00
Michael Kerrisk 723560ba1c mlock.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 07:58:28 +01:00
Michael Kerrisk cd6e402be4 pciconfig_read.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 07:58:28 +01:00
Michal Hocko 17ad768d41 fork.2: EAGAIN is not reported when task allocation fails
I am not sure why we have:

   "EAGAIN fork() cannot allocate sufficient memory to copy
    the parent's page tables and allocate a task structure
    or the child."

The text seems to be there from the time when man-pages
were moved to git so there is no history for it.

And it doesn't reflect reality: the kernel reports both
dup_task_struct and dup_mm failures as ENOMEM to the
userspace. This seems to be the case from early 2.x times
so let's simply remove this part.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 07:58:28 +01:00
Michael Kerrisk 98f792f704 semop.2: Note defaults for SEMOPM and warn against increasing > 1000
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 07:58:28 +01:00
Michael Kerrisk 8a3e6dc72f semget.2: Note default value for SEMMNI and SEMMSL
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 07:58:28 +01:00
Michael Kerrisk a75f73c22a msgget.2: Add details of MSGMNI default value
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 07:58:27 +01:00
Michael Kerrisk faeaa68cca msgop.2: Clarify wording of MSGMAX and MSGMNB limits
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 07:58:27 +01:00
Michael Kerrisk 2f2a53b56e setxattr.2: ERRORS: add ENOTSUP for invalid namespace prefix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 07:58:27 +01:00
Michael Kerrisk 5e73ab4bc4 setxattr.2: Remove redundant text under ENOTSUP error
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 07:58:27 +01:00
Michael Kerrisk 9398702ca2 setxattr.2: Rework text describing 'flags' argument
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 07:58:27 +01:00
Michael Kerrisk 60da5b89a7 setxattr.2: Note that zero-length attribute values are permitted
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 07:58:27 +01:00
Michael Kerrisk 736703bde2 setxattr.2: Minor rewordings
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 07:58:27 +01:00
Michael Kerrisk 5232e869b2 setxattr.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 07:58:27 +01:00
Michael Kerrisk 220b2331ef removexattr.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 07:58:27 +01:00
Michael Kerrisk 495420ae2c removexattr.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 07:58:27 +01:00
Michael Kerrisk a4526c2f11 listxattr.2: Reword discussion of size==0 case
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 07:58:27 +01:00
Michael Kerrisk fae9230bda getxattr.2: Various rewordings plus one or two details clarified
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 07:58:27 +01:00
Michael Kerrisk f1ec5ad108 listxattr.2: Remove mention of which filesystems implement ACLs
Such a list will only become outdated (as it already was).

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 07:58:27 +01:00
Michael Kerrisk 2d10343d11 listxattr.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 07:58:27 +01:00
Michael Kerrisk ee6627733a fcntl.2: Clarify cases of conflict between traditional record and OFD locks
Verified by experiment on Linux 3.15 and 3.19rc4.

Acked-by: Jeff Layton <jlayton@poochiereds.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 07:58:27 +01:00
Michael Kerrisk 2d7fc98dfe prctl.2: Greatly expand discussion of "dumpable" flag
In particular, detail the interactions with
/proc/sys/fs/suid_dumpable.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 07:58:27 +01:00
Michael Kerrisk 6e2bb1c2f7 prctl.2: Reorder paragraphs describing PR_SET_DUMPABLE
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 07:58:27 +01:00
Michael Kerrisk 0de51ed1fc prctl.2: srcfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 07:58:27 +01:00
Michael Kerrisk 8aad30d779 prctl.2: Mention SUID_DUMP_DISABLE and SUID_DUMP_USER under PR_SET_DUMPABLE
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 07:58:27 +01:00
Michael Kerrisk 840a2b86c7 prctl.2: Executing a file with capabilities also resets the parent death signal
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 07:58:27 +01:00
Michael Kerrisk 4a3713a498 prctl.2: Minor restructuring of text for PR_SET_DUMPABLE
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 07:58:26 +01:00
Michael Kerrisk 13f296bcc4 prctl.2: Mention file capabilities in discussion of PR_SET_DUMPABLE
Reported-by: Bill McConnaughey <mcconnau@biochem.wustl.edu>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 07:58:24 +01:00
Michael Kerrisk f55912a99f getcpu.2: tfix
Reported-by: Zbigniew Brzeziński <zbigniew.brzezinski@student.put.poznan.pl>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-04 20:26:19 +01:00
Heinrich Schuchardt 35800487b6 getrandom.2: tfix
Let's assume Michael's email address did not change.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-03 08:16:32 +01:00
Michael Kerrisk 4f69e06a2c Removed trailing white space at end of lines 2015-02-01 17:14:59 +01:00
Michael Kerrisk 9dc53e71c2 kexec_load.2, personality.2, prctl.2, reboot.2, socket.2, fflush.3, getopt.3, random.3, termios.3, random.4, passwd.5, capabilities.7, signal.7: tstamp
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-01 17:14:12 +01:00
Michael Kerrisk fd4b38534c personality.2: SEE ALSO: add setarch(8)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-01 09:13:57 +01:00
Michael Kerrisk 3907aed3a1 getrandom.2: srcfix: Update copyright for Heinrich
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-31 14:37:52 +01:00
Michael Kerrisk f86ee883f4 getrandom.2: Add mtk to copyright
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-31 14:37:30 +01:00
Michael Kerrisk e84195de1e kexec_load.2: ERRROS: add some details to kexec_file_load ENOEXEC error
Reported-by: Scot Doyle <lkml14@scotdoyle.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-30 16:23:45 +01:00
Michael Kerrisk 077e532d80 getrandom.2: Minor tweaks
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-29 23:28:58 +01:00
Michael Kerrisk bfa4433525 socket.2: Tweaks to Stephan Mueller's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-29 23:24:57 +01:00
Stephan Mueller 31d070f8b4 socket.2: document AF_ALG
Add a reference to the AF_ALG protocol accessible via socket(2).

Signed-off-by: Stephan Mueller <stephan.mueller@atsec.com>
CC: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-29 23:22:59 +01:00
Michael Kerrisk 0646abd614 getrandom.2: Rework GRND_RANDOM text
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-29 23:12:23 +01:00
Michael Kerrisk 3426471b46 getrandom.2: Rework discussion of blocking section on interuption by signals
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-29 23:12:23 +01:00
Michael Kerrisk 8f891eb06d semget.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-29 11:12:44 +01:00
Michael Kerrisk 6b5e7695be getrandom.2: Reads from /dev/urandom can block for large request sizes
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-29 09:12:48 +01:00
Michael Kerrisk 2cc7c11a89 getrandom.2: SEE ALSO: add signal(7)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-29 09:03:32 +01:00
Michael Kerrisk a66935bad6 getrandom.2: Give the reader a hint about when /dev/urandom is initialized
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-29 09:03:32 +01:00
Michael Kerrisk 2c7135dbfb getrandom.2: Minor tweaks to Heinrich's text
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-29 09:03:32 +01:00
Heinrich Schuchardt 11353d7b62 getrandom.2: Clarification of open questions
With his last patches for getrandom.2 Michael Kerrisk posed a few
questions and left some comments in the man-page. This patch
seeks to clarify the open issues.

 72 For example, if the call is interrupted by a signal handler,
 73 it may return a partially filled buffer, or fail with the error
 74 .BR EINTR .
 75 .\" Tested with buffer sizes > 256 bytes: both partial reads
 76 .\" and EINTR can occur, with the former being more frequent.
 77 .\"

Michael's observation agrees with the code.
For buffer size > 256: If the buffer is still empty EINTR occurs.
If any number of bytes has been read to the buffer, that number
is returned.  The comment can be removed.

 78 .\" mtk: In the absence of signals, in my testing, even very large reads
 79 .\" return full buffers. I found that reads of up to 33554431 always
 80 .\" returned a filled buffer. Specifying 'buflen' > 33554431 always
 81 .\" returned just 33554431 bytes. (I'm not sure where that number comes
        from.

The maximum number of bytes transferred is limited for
/dev/urandom to:

    nbytes = min_t(size_t, nbytes, INT_MAX >> (ENTROPY_SHIFT + 3));
    // <= 0x1fffff

and for /dev/random to
nbytes = min_t(size_t, nbytes, SEC_XFER_SIZE); // <= 0x200

Lets put this into the NOTES section.

 224 When reading from
 225 .IR /dev/random ,
 226 blocking requests of any size can be interrupted by a signal
 227 (the call fails with the error
 228 .BR EINTR ).

Thats ok.

 82 If the pool has not yet been initialized, then the call blocks, unless
 83 .B GRND_RANDOM
 84 is specified in
 85 .IR flags .
 86 .\" FIXME We need a bit more information here.
 87 .\"       The reader will ask: when is /dev/urandom initialized?
 88 .\"       There should be some text here to explain that.

Entropy is collected from different sources, e.g.
 - time of reaping a thread
 - MAC address of a network interfaces
 - Allwinner security ID
 - ROM content of a firewire device
 - ...

When more than 128 bits have been collected, the pool is set
to initialized.

I suggest that detailed information about the initialization
should be provided on the random.4 page.

I added a paragraph in the NOTES section.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-29 09:02:41 +01:00
Michael Kerrisk 053e5e6914 getrandom.2: Enhance discussion of /dev/urandom reads in DESCRIPTION
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-29 09:02:41 +01:00
Michael Kerrisk 652febf0d9 getrandom.2: Clarify interaction of GRND_RANDOM and signals
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-29 09:02:41 +01:00
Michael Kerrisk 05e4d7afa9 getrandom.2: NOTES: clarify discussion of EINTR error
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-29 09:02:41 +01:00
Michael Kerrisk 473844a13d getrandom.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-29 09:02:41 +01:00
Michael Kerrisk f350b993d0 getrandom.2: srcfix: add FIXME
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-29 09:02:41 +01:00
Michael Kerrisk 973ff2fc67 getrandom.2: Clarify text with respect to GRND_NONBLOCK
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-29 09:02:41 +01:00
Michael Kerrisk 28ef3452e4 getrandom.2: Clarify sentence on getrandom() and partial GRND_RANDOM reads
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-29 09:02:41 +01:00