Commit Graph

20413 Commits

Author SHA1 Message Date
Michael Kerrisk 512669dce1 Ready for 5.05 2020-02-09 12:24:58 +01:00
Michael Kerrisk 6b621d05b3 _exit.2, capget.2, fcntl.2, futex.2, listen.2, memfd_create.2, modify_ldt.2, move_pages.2, open.2, perf_event_open.2, ptrace.2, set_thread_area.2, stime.2, syscall.2, sysctl.2, userfaultfd.2, cmsg.3, exit.3, ftime.3, getpt.3, malloc.3, console_codes.4, loop.4, inotify.7, netlink.7, packet.7, rtnetlink.7, tcp.7, unix.7, vsock.7, ldconfig.8: tstamp
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-02-09 11:53:28 +01:00
Michael Kerrisk c8f25a0524 Changes: Ready for 5.05
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-02-09 10:25:48 +01:00
Michael Kerrisk 93902a96eb stime.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-02-09 10:25:48 +01:00
Michael Kerrisk 9ec6412745 malloc.3: Minor tweaks to Vegard Nossum's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-02-08 23:37:21 +01:00
Vegard Nossum 813d606b00 malloc.3: realloc() return value
One might be tempted to think that realloc() always requests a new
allocation before moving the contents over (at least in the case
where the new size is bigger than the original). This is not the
case; for example, on my system the following program:

	#include <stdlib.h>
	#include <stdio.h>
	#include <unistd.h>

	int main(int argc, char *argv[])
	{
		void *x = malloc(15);
		void *y = malloc(32);

		printf("x = %p\n", x);
		printf("y = %p\n", y);
		printf("usable_size(x) = %lu\n", malloc_usable_size(x));

		void *z = realloc(x, 24);
		printf("z = %p\n", z);

		return 0;
	}

prints:

	x = 0x1b3a010
	y = 0x1b3a030
	usable_size(x) = 24
	z = 0x1b3a010

Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-02-08 23:37:10 +01:00
Michael Kerrisk f3aa51b217 fcntl.2: Further tweaks to F_SEAL_FUTURE_WRITE text
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-02-08 14:10:31 +01:00
Michael Kerrisk e15b10ba32 memfd_create.2: Minor tweaks's to Joel Fernandes's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-02-08 13:04:07 +01:00
Michael Kerrisk fc6a14f557 memfd_create.2: srcfix: semantic line breaks
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-02-08 13:04:07 +01:00
Joel Fernandes (Google) 98eff9f7e5 memfd_create.2: Update manpage with new memfd F_SEAL_FUTURE_WRITE seal
More details of the seal can be found in the LKML patch:
https://lore.kernel.org/lkml/20181120052137.74317-1-joel@joelfernandes.org/T/#t

Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-02-08 13:04:07 +01:00
Michael Kerrisk e1cd30eb5e fcntl.2: Note kernel version for F_SEAL_FUTURE_WRITE
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-02-08 13:04:07 +01:00
Michael Kerrisk e9a2c239b3 fcntl.2: Minor tweaks to Joel Fernandes's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-02-08 12:37:39 +01:00
Michael Kerrisk 9341a793d0 fcntl.2: srcfix: rewrap source lines
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-02-08 12:31:11 +01:00
Michael Kerrisk e38bb9196d fcntl.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-02-08 12:09:56 +01:00
Joel Fernandes (Google) 7b7d3b200a fcntl.2: Update manpage with new memfd F_SEAL_FUTURE_WRITE seal
More details of the seal can be found in the LKML patch:
https://lore.kernel.org/lkml/20181120052137.74317-1-joel@joelfernandes.org/T/#t

Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-02-08 12:09:07 +01:00
Benjamin Peterson f3491e47ba exit.3: Use hex for the status mask
Admittedly, the POSIX specification for exit() also uses octal.
However, 0xFF immediately indicates the lowest 8 bits to me
whereas I had to think a bit about the octal mask.

Cowritten-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-02-08 11:59:37 +01:00
Michael Kerrisk ba9ae75ddb clone.2: Add old EINVAL error for AArch64
Reported-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-02-08 09:11:01 +01:00
Michael Kerrisk f44b032900 listen.2: The 'somaxconn' default value has increased to 4096
See https://bugzilla.suse.com/show_bug.cgi?id=1162464

Reported-by: Peter Gajdos <pgajdos@suse.cz>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-02-07 18:02:52 +01:00
Michael Kerrisk a2587fbb2e open.2: In O_TMPFILE example, describe alternative linkat() call
This was already shown in an earlier version of the page,
but Adam Borowski's patch replaced it with an alternative.
Probably, it is better to show both possibilities.

Reported-by: "Joseph C. Sible" <josephcsible@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-02-07 17:59:34 +01:00
Adam Borowski fc29a199d9 open.2: No need for /proc to make an O_TMPFILE file permanent
In the example snippet, we already have the fd, thus there's no
need to refer to the file by name.  And, /proc/ might be not
mounted or not accessible.

Noticed-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Adam Borowski <kilobyte@angband.pl>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-02-07 17:30:45 +01:00
Michael Kerrisk cb83181db3 console_codes.4: Minor tweaks to Adam Borowski's patches
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-02-07 17:26:21 +01:00
Michael Kerrisk 40fe605beb console_codes.4: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-02-07 17:18:39 +01:00
Adam Borowski 329eb744fa console_codes.4: Document \e[90m to 97, 100 to 107
Supported since fadb4244085cd04fd9c8b3a4b3bc161f506431f3 (4.9),
100..107 are supposed to be bright but this does not yet work
(unmerged patches to do so exist).

Signed-off-by: Adam Borowski <kilobyte@angband.pl>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-02-07 16:35:48 +01:00
Adam Borowski f1779b1234 console_codes.4: Update \e[38m and \e[48m
Supported since cec5b2a97a11ade56a701e83044d0a2a984c67b4 (3.16).

Signed-off-by: Adam Borowski <kilobyte@angband.pl>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-02-07 16:33:15 +01:00
Adam Borowski a133a6bc03 console_codes.4: \e[21m is now underline
Since 65d9982d7e523a1a8e7c9af012da0d166f72fc56 (4.17), it follows
xterm rather than common sense and consistency, being the only
command 1..9 where N+20 doesn't undo what N did.  As libvte
0.51.90 got changed the same way, this behaviour will probably
stay.

Signed-off-by: Adam Borowski <kilobyte@angband.pl>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-02-07 16:28:50 +01:00
Yu Jian Wu 03ba66f3a6 ioctl_userfaultfd.2: wfix
Hi,

Patch as attached. I think the comment on the variables in the struct is
reversed.

Thanks!

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-02-07 16:21:18 +01:00
Dmitry V. Levin 0482a85341 cmsg.3: ffix
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-02-07 16:16:34 +01:00
Michael Kerrisk 1059ffb804 tcp.7: tcp_low_latency is ignored since Linux 4.14
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-02-07 16:11:46 +01:00
Michael Kerrisk 863d6b7de0 unix.7: The PID sent with SCM_CREDENTIALS must match an existing process
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-02-05 12:51:51 +01:00
Michael Kerrisk e4c98f64d1 cmsg.3: Modify CMSG_DATA() example to use memcpy()
See previous patch to this page for rationale

Reported-by: Rich Felker <dalias@libc.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-02-05 01:21:17 +01:00
Rich Felker 36d25246b4 cmsg.3: Clarify alignment issues and correct method of accessing CMSG_DATA()
From an email by Rich Felker:

It came to my attention while reviewing possible breakage with
move to 64-bit time_t that some applications are dereferencing
data in socket control messages (particularly SCM_TIMESTAMP*)
in-place as the message type, rather than memcpy'ing it to
appropriate storage. This necessarily does not work and is not
supportable if the message contains data with greater alignment
requirement than the header. In particular, on 32-bit archs,
cmsghdr has size 12 and alignment 4, but struct timeval and
timespec may have alignment requirement 8.

I found at least ptpd, socat, and ssmping doing this via Debian
Code Search:

https://sources.debian.org/src/ptpd/2.3.1-debian1-4/src/dep/net.c/?hl=1578#L1578
https://sources.debian.org/src/socat/1.7.3.3-2/xio-socket.c/?hl=1839#L1839
https://sources.debian.org/src/ssmping/0.9.1-3/ssmpngcl.c/?hl=307#L307

and I suspect there are a good deal more out there. On most archs
they won't break, or will visibly break with SIGBUS, but in theory
it's possible that they silently read wrong data and this might
happen on some older and more tiny-embedded-oriented archs.

I think it's clear to someone who understands alignment and who's
thought about it that applications just can't do this, but it
doesn't seem to be documented, and an example in cmsg(3) even
shows access to int payload via *(int *)CMSG_DATA(cmsg) (of course
int is safe because its alignment is <= header alignment, but this
is not mentioned).

Could we add text, and perhaps change the example, to indicate
that in general memcpy needs to be used to copy the payload
to/from a suitable object?

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-02-05 01:16:10 +01:00
Michael Kerrisk 477b8f4b6f exec.3: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-02-04 00:42:34 +01:00
Michael Kerrisk c98fe9f8ad seccomp.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-01-22 05:23:50 +01:00
Michael Kerrisk b386cee344 clone.2: Note the kernel version that added the 'set_tid' feature
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-01-22 02:19:09 +01:00
Michael Kerrisk 27f14b447a clone.2: Document CLONE_CLEAR_SIGHAND
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-01-22 02:09:17 +01:00
Denys Vlasenko 302c512cef ptrace.2: PTRACE_EVENT_STOP does not always report SIGTRAP
PTRACE_EVENT_STOP does not always report SIGTRAP, can be the
signal which stopped us

While at it, fix an obvious copy/paste error in
PTRACE_GET_SYSCALL_INFO description.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-01-22 01:14:19 +01:00
Michael Kerrisk 2b6923ba65 userfaultfd.2: Note that CAP_SYS_PTRACE is checked in the *initial* user namespace
(Add a detail missing in Yang Xu's patch.)

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-01-21 22:02:04 +01:00
Michael Kerrisk 465b6c35e9 proc.5: Document /proc/sys/vm/unprivileged_userfaultfd
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-01-21 22:01:35 +01:00
Michael Kerrisk c4f13bc72a userfaultfd.2: Tweaks to Yang Xu's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-01-21 22:01:35 +01:00
Yang Xu 339b899c4c userfaultfd.2: Add EPERM error
Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-01-21 21:46:23 +01:00
Michael Kerrisk f7eff3e7e0 loop.4: Minor tweaks to Yang Xu's patches
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-01-21 21:21:27 +01:00
Michael Kerrisk eb39881da1 loop.4: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-01-21 21:04:34 +01:00
Michael Kerrisk 38ad865260 loop.4: srcfix: semantic line breaks
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-01-21 21:04:34 +01:00
Yang Xu 89593f2df6 loop.4: Document LOOP_SET_BLOCK_SIZE
Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-01-21 21:00:59 +01:00
Yang Xu 9d40af2a55 loop.4: Document LOOP_SET_DIRECT_IO
Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-01-21 21:00:45 +01:00
Daniel Colascione f46304f747 perf_event_open.2: Mention EINTR for perf_event_open
Somewhat surprisingly, perf_event_open() can fail with EINTR when
trying to enable perf reporting for a uprobe that's already been
configured for use with ftrace. Mention this error in the man
page.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-01-21 20:48:28 +01:00
Nick Shipp 5687d86fa5 inotify.7: Merge late perror() into fprintf()
fprintf() may have overridden errno before perror() could print
it in this example.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-01-21 20:45:24 +01:00
Jakub Wilk 91201f28d8 keyrings.7: ffix
Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-01-21 20:22:27 +01:00
Michael Kerrisk 9d7fb78448 epoll.7: wfix
Reported-by: John Jones <jmjatlanta@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-01-21 20:20:04 +01:00
Mike Salvatore 4207253f85 getcwd.3: wfix
This patch is a minor wording fix in getcwd.3 that changes "In the case getcwd()" to "In the case of getcwd()". This patch should apply cleanly to the master branch of the git repository.

Regards,
Mike Salvatore

From 3b68ad225dbaada2b1b55153dc57807b04531cd6 Mon Sep 17 00:00:00 2001
From: Mike Salvatore <mike.salvatore@canonical.com>
Date: Thu, 16 Jan 2020 16:08:08 -0500
Subject: [PATCH] getcwd.3: wfix

Signed-off-by: Mike Salvatore <mike.salvatore@canonical.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-01-21 20:13:56 +01:00