Commit Graph

19597 Commits

Author SHA1 Message Date
Michael Kerrisk 5593795fc3 msgctl.2: tfix
Reported-by: Joe Lawrence <joe.lawrence@redhat.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-04 17:19:36 +01:00
Michael Kerrisk 14cbb25e36 msgctl.2, semctl.2, shmctl.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-04 17:17:07 +01:00
Davidlohr Bueso d2ff4f8619 msgctl.2, semctl.2, shmctl.2: Document STAT_ANY commands
Reported-by: Joe Lawrence <joe.lawrence@redhat.com>
Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-04 17:10:47 +01:00
Michael Kerrisk 08069f7a04 lirc.4: Minor language fix-ups
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-04 12:13:32 +01:00
Michael Kerrisk 7d3e44d581 lirc.4: Remove crufty text
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-04 12:11:25 +01:00
Michael Kerrisk f3c3a5c42b lirc.4: Minor wording and formatting fixes
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-04 12:11:25 +01:00
Sean Young aef83b6047 lirc.4: tfix
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-04 11:41:01 +01:00
Sean Young a1e1ac251d lirc.4: Document remaining ioctl (LIRC_GET_REC_TIMEOUT)
Now all ioctls are documented.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-04 11:39:48 +01:00
Michael Kerrisk 77eefc59bd cgroups.7: tfix
Reported-by: Alan Jenkins <alan.christopher.jenkins@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-04 11:29:06 +01:00
Michael Kerrisk c6c28d527d user_namespaces.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-02 13:52:24 +01:00
Michael Kerrisk 602ecf86cd lp.4: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-02 13:37:43 +01:00
Michael Kerrisk 2c1608c23b namespaces.7: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-02 13:32:25 +01:00
Michael Kerrisk 99a9a45f06 lirc.4: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-02 13:02:30 +01:00
Michael Kerrisk 264a16db27 lirc.4: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-02 12:38:10 +01:00
Sean Young 5116995534 lirc.4: Document error returns more explicitly
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-02 12:36:57 +01:00
Michael Kerrisk 922819b84d lirc.4: Minor fix-ups for Sean Young's previous patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-02 12:36:57 +01:00
Sean Young 29a1847441 lirc.4: Both ioctls are supported if LIRC_CAN_SET_REC_CARRIER_RANGE is set
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-02 12:36:57 +01:00
Sean Young f75ee79d12 lirc.4: LIRC_CAN_SET_REC_DUTY_CYCLE_RANGE was never supported
No driver ever supported such a thing.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-02 12:36:57 +01:00
Michael Kerrisk 17f08f5e64 lirc.4: Minor reworking of Sean Young's LIRC_SET_REC_TIMEOUT patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-02 12:36:57 +01:00
Sean Young ae04ed0767 lirc.4: Timeout reports are enabled by default
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-02 12:18:30 +01:00
Ian Turner 9e8d7a8925 lockf.3: ERRORS: add EINTR
Ian Turner: The exact return calls are at the discretion of the
underlying VFS, but I'm pretty sure that EINTR is a possibility.
Or, if it's not, then the flock() manpage should be amended
accordingly, since the two share the same underlying
implementation.

mtk: lockf(3) is implemented on top of fcntl() locking, so
EINTR is of course a possibility.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-02 07:47:39 +01:00
Quentin Monnet 3bcfaff627 bpf.2: SEE ALSO: add bpf-helpers(7)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-01 21:23:56 +01:00
Michael Kerrisk 2eb89baa0e capabilities.7: Minor fixes to Marcus Gelderie's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-01 20:55:13 +01:00
Marcus Gelderie 35ecd12dd9 capabilities.7: Mention header for SECBIT constants
Mention that the named constants (SECBIT_KEEP_CAPS and others)
are available only if the linux/securebits.h user-space header
is included.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-01 20:55:13 +01:00
Michael Kerrisk c3617f39b6 mmap.2: tfix
Reported-by: Thomas Posch <kernel.org@online.posch.name>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-01 18:23:33 +01:00
Paul Eggert 5355e20f81 zic.8: Sync from tzdb upstream
Make zic.8 a copy of the upstream tzdb version, except that
the tzdb version's first line is replaced by man-pages
boilerplate, and omit features introduced after 2017b
(the most recent merge to glibc).

This has the following effect:

Document --version, --help.

Document new -v warnings.

Remove -y.

Document that input should be text files, and similar restrictions
on names.

Document negative DST.

Document what is meant by "white space".

Do some minor reformatting.

Use .B for as-is keywords, like commands.

New section "EXTENDED EXAMPLE".

Omit some changes that were made on the man-pages side, notably by
changing some "timezone"s back to the preferred-upstream "time
zone" when talking about traditional time zones as opposed to
POSIX timezone settings.  Also, fix some formatting glitches.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-01 15:09:33 +01:00
Paul Eggert 09c05a89e3 zdump.8: Sync from tzdb upstream
Make zdump.8 a copy of the upstream tzdb version, except that
the tzdb version's first line is replaced by man-pages
boilerplate.

This has the following effect:

Document new options -i, -t, -V.

New section LIMITATIONS.

Do some minor reformatting.

Omit some changes that were made on the man-pages side, notably by
changing some "timezone"s back to the preferred-upstream "time
zone" when talking about traditional time zones as opposed to
POSIX timezone settings.  Also, fix some formatting glitches.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-01 15:09:18 +01:00
Paul Eggert a312fa038d tzfile.5: Sync from tzdb upstream
Make tzfile.5 a copy of the upstream tzdb version, except that
the tzdb version's first line is replaced by man-pages
boilerplate.

This has the following effect:

Do some minor spec fixes, notably about time type 0
and empty TZ strings.  Omit some changes that were made on the
man-pages side, notably by changing some "timezone"s back to the
preferred-upstream "time zone" when talking about traditional
time zones as opposed to POSIX timezone settings.
Also, fix some formatting glitches.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-01 15:09:09 +01:00
Michael Kerrisk 53666f6c30 bpf-helpers.7: Add new man page for eBPF helper functions
eBPF sub-system on Linux can use "helper functions", functions
implemented in the kernel that can be called from within a eBPF program
injected by a user on Linux. The kernel already supports a long list of
such helpers (sixty-seven at this time, new ones are under review).
Therefore, it is proposed to create a new manual page, separate from
bpf(2), to document those helpers for people willing to develop new eBPF
programs.

Additionally, in an effort to keep this documentation in synchronisation
with what is implemented in the kernel, it is further proposed to keep
the documentation itself in the kernel sources, as comments in file
"include/uapi/linux/bpf.h", and to generate the man page from there.

This patch adds the new man page, generated from kernel sources, to the
man-pages repository. For each eBPF helper function, a description of
the helper, of its arguments and of the return value is provided. The
idea is that all future changes for this page should be redirected to
the kernel file "include/uapi/linux/bpf.h", and the modified page
generated from there.

Generating the page itself is a two-step process. First, the
documentation is extracted from include/uapi/linux/bpf.h, and converted
to a RST (reStructuredText-formatted) page, with the relevant script
from Linux sources:

      $ ./scripts/bpf_helpers_doc.py > /tmp/bpf-helpers.rst

The second step consists in turning the RST document into the final man
page, with rst2man:

      $ rst2man /tmp/bpf-helpers.rst > bpf-helpers.7

The bpf.h file was taken as at kernel 4.19

Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Quentin Monnet <quentin.monnet@netronome.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-01 14:57:49 +01:00
Michael Kerrisk dd63e15948 capabilities.7: Correct the description of SECBIT_KEEP_CAPS
This just adds to the point made by Marcus Gelderie's patch.  Note
also that SECBIT_KEEP_CAPS provides the same functionality as the
prctl() PR_SET_KEEPCAPS flag, and the prctl(2) manual page has the
correct description of the semantics (i.e., that the flag affects
the treatment of onlt the permitted capability set).

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-01 14:40:49 +01:00
Michael Kerrisk ab7ef2a882 capabilities.7: Minor tweaks to the text added by Marcus Gelderie's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-01 14:40:49 +01:00
Marcus Gelderie 7d32b135d6 capabilities.7: Add details about SECBIT_KEEP_CAPS
The description of SECBIT_KEEP_CAPS is misleading about the
effects on the effective capabilities of a process during a
switch to nonzero UIDs.  The effective set is cleared based on
the effective UID switching to a nonzero value, even if
SECBIT_KEEP_CAPS is set. However, with this bit set, the
effective and permitted sets are not cleared if the real and
saved set-user-ID are set to nonzero values.

This was tested using the following C code and reading the kernel
source at security/commoncap.c: cap_emulate_setxuid.

void print_caps(void) {
    cap_t current = cap_get_proc();
    if (!current) {
        perror("Current caps");
        return;
    }
    char *text = cap_to_text(current, NULL);
    if (!text) {
        perror("Converting caps to text");
        goto free_caps;
    }
    printf("Capabilities: %s\n", text);
    cap_free(text);
free_caps:
    cap_free(current);
}

void print_creds(void) {
    uid_t ruid, suid, euid;
    if (getresuid(&ruid, &euid, &suid)) {
        perror("Error getting UIDs");
        return;
    }
    printf("real = %d, effective = %d, saved set-user-ID = %d\n", ruid, euid, suid);
}

void set_caps(int size, const cap_value_t *caps) {
    cap_t current = cap_init();
    if (!current) {
        perror("Error getting current caps");
        return;
    }
    if (cap_clear(current)) {
        perror("Error clearing caps");
    }
    if (cap_set_flag(current, CAP_INHERITABLE, size, caps, CAP_SET)) {
        perror("setting caps");
        goto free_caps;
    }
    if (cap_set_flag(current, CAP_EFFECTIVE, size, caps, CAP_SET)) {
        perror("setting caps");
        goto free_caps;
    }
    if (cap_set_flag(current, CAP_PERMITTED, size, caps, CAP_SET)) {
        perror("setting caps");
        goto free_caps;
    }
    if (cap_set_proc(current)) {
        perror("Comitting caps");
        goto free_caps;
    }
free_caps:
    cap_free(current);
}

const cap_value_t caps[] = {CAP_SETUID, CAP_SETPCAP};
const size_t num_caps = sizeof(caps) / sizeof(cap_value_t);

int main(int argc, char **argv) {
    puts("[+] Dropping most capabilities to reduce amount of console output...");
    set_caps(num_caps, caps);
    puts("[+] Dropped capabilities. Starting with these credentials and capabilities:");

    print_caps();
    print_creds();

    if (argc >= 2 && 0 == strncmp(argv[1], "keep", 4)) {
        puts("[+] Setting SECBIT_KEEP_CAPS bit");
        if (prctl(PR_SET_SECUREBITS, SECBIT_KEEP_CAPS, 0, 0, 0)) {
            perror("Setting secure bits");
            return 1;
        }
    }

    puts("[+] Setting effective UID to 1000");
    if (seteuid(1000)) {
        perror("Error setting effective UID");
        return 2;
    }
    print_caps();
    print_creds();

    puts("[+] Raising caps again");
    set_caps(num_caps, caps);
    print_caps();
    print_creds();

    puts("[+] Setting all remaining UIDs to nonzero values");
    if (setreuid(1000, 1000)) {
        perror("Error setting all UIDs to 1000");
        return 3;
    }
    print_caps();
    print_creds();

    return 0;
}

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-01 14:39:25 +01:00
Michael Kerrisk 8e7e9720f6 lirc.4: Minor fixes after Sean Young's patches
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-01 12:57:38 +01:00
Sean Young e5f0504c7a lirc.4: Update SEE ALSO
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-01 12:57:38 +01:00
Sean Young 565301fcc8 lirc.4: lirc.h include file is in /usr/include/linux/lirc.h
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-01 12:57:38 +01:00
Sean Young e3f37bb8dc lirc.4: Some devices are send only
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-01 12:57:38 +01:00
Sean Young 85e952c63d lirc.4: Unsupported ioctl() operationsalways return ENOTTY
Note that LIRC_GET_FEATURES is the only ioctl() which is always
supported now that there are send-only devices.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-01 12:57:38 +01:00
Sean Young a0d4d60521 lirc.4: LIRC_MODE_LIRCCODE has been replaced by LIRC_MODE_SCANCODE
There are no drivers that support LIRC_MODE_LIRCCODE any more;
those drivers were in the kernel staging area, so they were
never part of the mainline kernel.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-01 12:57:38 +01:00
Michael Kerrisk 8cef0f2a17 full.4: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-01 12:57:38 +01:00
Michael Kerrisk 6e8a3b421b user_namespaces.7: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-10-31 08:47:02 +01:00
Michael Kerrisk 043aaa9427 namespaces.7: f
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-10-31 08:40:21 +01:00
Michael Kerrisk d45e85a94b namespaces.7: Briefly explain why CAP_SYS_ADMIN is needed to create nonuser namespaces
Reported-by: Tycho Kirchner <tychokirchner@mail.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-10-31 08:39:02 +01:00
Michael Kerrisk 29af6f1a59 user_namespaces.7: Rework terminology describing ownership of nonuser namespaces
Prefer the word "owns" rather than "associated with" when
describing the relationship between user namespaces and non-user
namespaces. The existing text used a mix of the two terms, with
"associated with" being predominant, but to my ear, describing the
relationship as "ownership" is more comprehensible.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-10-31 08:31:47 +01:00
Marc-André Lureau 659beec775 memfd_create.2: Update hugetlb file-sealing support
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-10-31 08:09:55 +01:00
Mattias Engdegård 40b1bfaa48 vcs.4: Broken example code
Fix broken example code in the vcs.4 man page
- use of wrong variable (attrib, which is uninitialised, instead of s)
- variable ch too narrow
- printing a font char index with %c, as if it were ASCII (it's not)
- removing the high font bit while changing the background colour
- unwarranted assumption of little-endian byte order

Also be friendly and use SEEK_* instead of numbers.

Reported-by: Michael Witten <mfwitten@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-10-31 08:03:06 +01:00
Sean Young 7734ee11e1 lirc.4: Remove ioctls and feature bits which were never implemented
The lirc header file included ioctls and feature bits which were
never implemented by any driver. They were removed in kernel
commit d55f09abe24b4dfadab246b6f217da547361cdb6

Reviewed-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Reported-by: Alec Leamas <leamas.alec@gmail.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-10-31 07:58:30 +01:00
Sean Young 50a8a7f404 lirc.4: Fix broken link
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-10-31 07:46:30 +01:00
Josh Triplett d63618d564 precedence.7: Add as a redirect to operator.7
Signed-off-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-10-28 10:10:20 +01:00
Jakub Wilk 9d32816ba3 clone.2: tfix
Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-10-27 08:58:11 +02:00
Jakub Wilk 3e9b499229 remainder.3: tfix
Remove stray words.

Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-10-27 08:57:37 +02:00