Commit Graph

3265 Commits

Author SHA1 Message Date
Michael Kerrisk bd05436994 fifo.7: wfix
Reported-by: Adam Liddell <ml+kernel.org@aliddell.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-12-18 17:16:34 +01:00
Michael Kerrisk d145c0250b cgroups.7: Minor rewording
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-12-18 17:14:49 +01:00
Nikolay Borisov cfec905ed7 cgroups.7: Add information about RDMA controller
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-12-18 17:11:47 +01:00
Michael Kerrisk b8cee784b3 capabilities.7: Clarify effect of CAP_SETFCAP
Make it clear that CAP_SETFCAP allows setting arbitrary
capabilities on a file.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-12-16 00:09:25 +01:00
Stefan Hajnoczi ba294a0ee6 vsock.7: Clarify send(2)/recv(2) families of system calls
Sockets support both read(2)/write(2) and send(2)/recv(2) system
calls.  Each of these is actually a family of multiple system
calls such as send(2), sendfile(2), sendmsg(2), sendmmsg(2), and
sendto(2).

This patch claries which families of system calls can be used.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-12-12 19:12:07 +01:00
Michael Kerrisk 308a16d989 vsock.7: Place SEE ALSO and ERRORS in alphabetical order
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-12-11 20:30:38 +01:00
Michael Kerrisk 2472922151 vsock.7: Minor fixes
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-12-11 20:30:37 +01:00
Michael Kerrisk 4a70bb07bc vsock.7: srcfix: rewrap source lines
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-12-11 20:19:03 +01:00
Stefan Hajnoczi 29598b2f2d vsock.7: Document the VSOCK socket address family
The AF_VSOCK address family has been available since Linux 3.9.

This patch adds vsock.7 and describes its use along the same lines as
existing ip.7, unix.7, and netlink.7 man pages.

CC: Jorgen Hansen <jhansen@vmware.com>
CC: Dexuan Cui <decui@microsoft.com>
Reviewed-by: Jorgen Hansen <jhansen@vmware.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-12-11 20:11:12 +01:00
Michael Kerrisk 46010ab917 socket.7: tfix
Reported-by: Joel Williamson <jwilliamson@carnegietechnologies.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-12-11 18:40:14 +01:00
Michael Kerrisk ec9612a19f network_namespaces.7: Minor adjustments to list of resources governed by network namespaces
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-12-10 23:19:17 +01:00
Michael Kerrisk f9ecf99e59 network_namespaces.7: When a NW namespace is freed, veth devices are destroyed
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-12-10 23:19:17 +01:00
Michael Kerrisk f051ce24ac network_namespaces.7: Reorganize text
No content changes...

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-12-10 23:19:17 +01:00
Michael Kerrisk 2685b303e3 namespaces.7, network_namespaces.7: Move content from namespaces(7) to network_namespaces(7)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-12-10 23:19:17 +01:00
Michael Kerrisk 9f7ce0c2e8 network_namespaces.7: New page describing network namespaces
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-12-10 23:19:17 +01:00
Michael Kerrisk 4bf43ba523 pid_namespaces.7: SEE ALSO: add mount_namespaces(7)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-12-08 10:13:42 +01:00
Michael Kerrisk 54b9d7bf87 user_namespaces.7: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-12-06 15:05:15 +01:00
Michael Kerrisk e62172cbd9 capabilities.7: Rephrase CAP_SETPCAP description
* Mention kernel versions.
* Place current kernel behavior first

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-12-05 22:27:27 +01:00
G. Branden Robinson 777411ae61 iconv.1, pthread_rwlockattr_setkind_np.3, man-pages.7, socket.7, iconvconfig.8: Standardize on "nonzero"
Also add this term to the style guide in man-pages(7).

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-12-05 22:27:13 +01:00
Michael Kerrisk e93e59f97b capabilities.7: SECBIT_KEEP_CAPS is ignored if SECBIT_NO_SETUID_FIXUP is set
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-12-03 11:16:32 +01:00
Michael Kerrisk e43d2a6013 capabilities.7: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-12-03 11:16:32 +01:00
Michael Kerrisk 02ff4f27c2 capabilities.7: Note which capability sets are affected by SECBIT_NO_SETUID_FIXUP
Note explicitly that SECBIT_NO_SETUID_FIXUP is relevant for
the permitted, effective, and ambient capability sets.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-12-03 11:16:19 +01:00
Michael Kerrisk 7c8eb8f7cf capabilities.7: Deemphasize the ancient prctl(2) PR_SET_KEEPCAPS command
The modern approach is SECBITS_KEEP_CAPS.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-12-02 16:21:37 +01:00
Michael Kerrisk f7dbc40ee7 capabilities.7: Minor wording fix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-12-02 16:21:37 +01:00
Michael Kerrisk 705a8f33f1 capabilities.7: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-12-02 15:43:02 +01:00
Michael Kerrisk bbb186d403 capabilities.7: Clarify which capability sets are effected by SECBIT_KEEP_CAPS
This flag has relevance only for the process permitted and
effective sets.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-12-02 15:40:39 +01:00
Michael Kerrisk e67ac266c8 capabilities.7: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-12-02 15:08:52 +01:00
Michael Kerrisk f6b60423bd capabilities.7: Ambient set is also cleared when UIDs are set to nonzero value
See cap_emulate_setxuid():

        kuid_t root_uid = make_kuid(old->user_ns, 0);

        if ((uid_eq(old->uid, root_uid) ||
             uid_eq(old->euid, root_uid) ||
             uid_eq(old->suid, root_uid)) &&
            (!uid_eq(new->uid, root_uid) &&
             !uid_eq(new->euid, root_uid) &&
             !uid_eq(new->suid, root_uid))) {
                if (!issecure(SECURE_KEEP_CAPS)) {
                        cap_clear(new->cap_permitted);
                        cap_clear(new->cap_effective);
                }

                /*
                 * Pre-ambient programs expect setresuid to nonroot followed
                 * by exec to drop capabilities.  We should make sure that
                 * this remains the case.
                 */
                cap_clear(new->cap_ambient);
        }

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-12-02 11:08:40 +01:00
Michael Kerrisk 8e821c3aa8 user_namespaces.7: Mention NS_GET_OWNER_UID ioctl() operation
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-12-02 09:22:40 +01:00
Michael Kerrisk a563b19b70 capabilities.7: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-12-02 09:12:07 +01:00
Michael Kerrisk 1c6f59c276 getpid.2, pipe.2, abort.3, daemon.3, pthread_yield.3, stdio.3, sysconf.3, tty.4, shells.5, sysfs.5, fifo.7, hier.7, icmp.7, path_resolution.7, pid_namespaces.7, standards.7: tstamp
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-11-26 12:38:46 +01:00
Michael Kerrisk 8466189293 fifo.7: Refer reader to pipe(7) for details of I/O semantics of FIFOs
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-11-23 13:36:00 +01:00
Michael Kerrisk 4cee582147 socket.7: Correct the description of SO_RXQ_OVFL
Two reports that the description of SO_RXQ_OVFL was wrong.

======

Commentary from Tobias:

This bug pertains to the manpage as visible on man7.org right
now.

The socket(7) man page has this paragraph:

       SO_RXQ_OVFL (since Linux 2.6.33)
              Indicates that an unsigned 32-bit value ancillary
              message (cmsg) should be attached to received skbs
              indicating the number of packets dropped by the
              socket between the last received packet and this
              received packet.

The second half is wrong: the counter (internally,
SOCK_SKB_CB(skb)->dropcount is *not* reset after every packet.
That is, it is a proper counter, not a gauge, in monitoring
parlance.

A better version of that paragraph:

       SO_RXQ_OVFL (since Linux 2.6.33)
              Indicates that an unsigned 32-bit value ancillary
              message (cmsg) should be attached to received skbs
              indicating the number of packets dropped by the
              socket since its creation.
======
Commentary from Petr

Generic SO_RXQ_OVFL helpers sock_skb_set_dropcount() and
sock_recv_drops() implements returning of sk->sk_drops (the total
number of dropped packets), although the documentation says the
number of dropped packets since the last received one should be
returned (quoting the current socket.7):

  SO_RXQ_OVFL (since Linux 2.6.33)
  Indicates that an unsigned 32-bit value ancillary message (cmsg)
  should be attached to received skbs indicating the number of packets
  dropped by the socket between the last received packet and this
  received packet.

I assume the documentation needs to be updated, as fixing this in
the code could break programs depending on the current behavior,
although the formerly planned functionality seems to be more
useful.

The problem can be revealed with the following program:

int extract_drop(struct msghdr *msg)
{
        struct cmsghdr *cmsg;
        int rtn;

        for (cmsg = CMSG_FIRSTHDR(msg); cmsg; cmsg = CMSG_NXTHDR(msg,cmsg)) {
                if (cmsg->cmsg_level == SOL_SOCKET &&
                    cmsg->cmsg_type == SO_RXQ_OVFL) {
                        memcpy(&rtn, CMSG_DATA(cmsg), sizeof rtn);
                        return rtn;
                }
        }
        return -1;
}

int main(int argc, char *argv[])
{
        struct sockaddr_in addr = { .sin_family = AF_INET };
        char msg[48*1024], cmsgbuf[256];
        struct iovec iov = { .iov_base = msg, .iov_len = sizeof msg };
        int sk1, sk2, i, one = 1;

        sk1 = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP);
        sk2 = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP);

        inet_pton(AF_INET, "127.0.0.1", &addr.sin_addr);
        addr.sin_port = htons(53333);

        bind(sk1, (struct sockaddr*)&addr, sizeof addr);
        connect(sk2, (struct sockaddr*)&addr, sizeof addr);

        // Kernel doubles this limit, but it accounts also the SKB overhead,
        // but it receives as long as there is at least 1 byte free.
        i = sizeof msg;
        setsockopt(sk1, SOL_SOCKET, SO_RCVBUF, &i, sizeof i);
        setsockopt(sk1, SOL_SOCKET, SO_RXQ_OVFL, &one, sizeof one);

        for (i = 0; i < 4; i++) {
                int rtn;

                send(sk2, msg, sizeof msg, 0);
                send(sk2, msg, sizeof msg, 0);
                send(sk2, msg, sizeof msg, 0);

                do {
                        struct msghdr msghdr = {
                                        .msg_iov = &iov, .msg_iovlen = 1,
                                        .msg_control = &cmsgbuf,
                                        .msg_controllen = sizeof cmsgbuf };
                        rtn = recvmsg(sk1, &msghdr, MSG_DONTWAIT);
                        if (rtn > 0) {
                                printf("rtn: %d drop %d\n", rtn,
                                                extract_drop(&msghdr));
                        } else {
                                printf("rtn: %d\n", rtn);
                        }
                } while (rtn > 0);
        }

        return 0;
}

which prints
  rtn: 49152 drop -1
  rtn: 49152 drop -1
  rtn: -1
  rtn: 49152 drop 1
  rtn: 49152 drop 1
  rtn: -1
  rtn: 49152 drop 2
  rtn: 49152 drop 2
  rtn: -1
  rtn: 49152 drop 3
  rtn: 49152 drop 3
  rtn: -1
although it should print (according to the documentation):
  rtn: 49152 drop 0
  rtn: 49152 drop 0
  rtn: -1
  rtn: 49152 drop 1
  rtn: 49152 drop 0
  rtn: -1
  rtn: 49152 drop 1
  rtn: 49152 drop 0
  rtn: -1
  rtn: 49152 drop 1
  rtn: 49152 drop 0
  rtn: -1

Reported-by: Petr Malat <oss@malat.biz>
Reported-by: Tobias Klausmann <klausman@schwarzvogel.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-11-20 13:54:28 +01:00
Michael Kerrisk 73be834acb posixoptions.7: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-11-20 10:38:10 +01:00
Michael Kerrisk f2c2c3083f user_namespaces.7: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-11-19 09:56:40 +01:00
Michael Kerrisk 2660d01041 user_namespaces.7: Restore historical details about UID maps
Christian Brauner's patch added the Linux 4.15 details,
but we need to retain the historical details.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-11-19 09:56:35 +01:00
Christian Brauner dc04b65274 user_namespaces.7: Document new 340 line idmap limit
This patch documents the following kernel commit:

    commit 6397fac4915ab3002dc15aae751455da1a852f25
    Author: Christian Brauner <christian.brauner@ubuntu.com>
    Date:   Wed Oct 25 00:04:41 2017 +0200

        userns: bump idmap limits to 340

Since Linux 4.15 the number of idmap lines has been bumped to 340.
The patch also removes the "(arbitrary)" in "There is an
(arbitrary) limit on the number of lines in the file." since the
340 line limit is well-explained by the current implementation.
The struct recording the idmaps is 12 bytes and quite some proc
files only allow writes the size of a single page size which is
4096kB. This leaves room for 340 idmappings (340 * 12 = 4080
bytes).  The struct layout itself has been chosen very carefully
to allow for an implementation that limits the time-complexity for
the idmap codepaths to O(log n). However, I think it's unnecessary
to expose this much implementation detail to users in the man
page. So only mention this in the commit message.  Furthermore,
the comment about the page size restriction is misleading. The
kernel sources show that >= page size is considered an error.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-11-19 09:46:07 +01:00
Michael Kerrisk 3cf30efce5 locale.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-11-09 11:38:16 +01:00
Seonghun Lim 3da5e46892 aio.7: wsfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-11-09 09:25:47 +01:00
Seonghun Lim f3f7957b78 aio.7: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-11-09 09:25:22 +01:00
Michael Kerrisk fd39ef0c05 capabilities.7: srcfix: FIXME
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-11-07 21:20:40 +01:00
Michael Kerrisk 68ea3ce60e capabilities.7: srcfix: FIXME
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-11-07 21:20:40 +01:00
Michael Kerrisk 6a65cff8dd capabilities.7: Add a reference to xattr(7) in the discussion of extended attributes
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-11-07 20:55:35 +01:00
Michael Kerrisk 404fb8d3fe mq_overview.7: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-10-27 17:41:42 +02:00
G. Branden Robinson 9ab7f611ed Replace Latin abbreviation "cf.".
People seem to be using "cf." ("confere"), which means "compare",
to mean "see" instead, for which the Latin abbreviation would be
"q.v." ("quod vide" -> "which see").

In some cases "cf." might actually be the correct term but it's
still not clear what specific aspects of a function/system call
one is supposed to be comparing.

I left one use in place in hope of obtaining clarification,
because it looks like it might be useful there, if contextualized.

Migrate these uses to English and add them to the list of
abbreviations to be avoided.

If the patch to vfork(2) is not accepted, then the cf. still needs
an \& after it because it is at the end of the line but not the
end of a sentence.

Signed-off-by: G. Branden Robinson <g.branden.robinson@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-10-27 17:39:33 +02:00
Michael Kerrisk 47d0313853 pid_namespaces.7: tfix + srcfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-10-23 17:43:45 +02:00
Michael Kerrisk 10bd75534e pid_namespaces.7: Document /proc/sys/kernel/ns_last_pid
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-10-23 17:27:58 +02:00
G. Branden Robinson e789e07cb1 man-pages.7: Add a use case for real minus character
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-10-23 06:44:52 +02:00
G. Branden Robinson 679f40d6a5 hier.7: tfix
Escape hyphen in man page cross reference.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-10-23 06:43:57 +02:00
G. Branden Robinson b3f480154d ipv6.7: tfix
Use correct indefinite article before noun beginning with vowel sound.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-10-23 06:43:39 +02:00