Commit Graph

7980 Commits

Author SHA1 Message Date
Matti Moell 17ea6db2d6 io_submit.2: Fix kernel version numbers for 'aio_rw_flags' flags
Even though the RFW_* flags were first introduced in Linux 4.6,
they could not be used with aio until 4.13 where the aio_rw_flags
field was added to struct iocb (9830f4be159b "fs: Use RWF_* flags
for AIO operations"). Correct the stated version for each flag.

Fixes: 2f72816f86 ("io_submit.2: Add kernel version numbers for various 'aio_rw_flags' flags")

Signed-off-by: Matti Möll <Matti.Moell@opensynergy.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-09-13 14:57:53 +02:00
Michael Kerrisk 6812112d03 move_pages.2: Some reworking of Yang Xu's text
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-09-13 14:57:53 +02:00
Yang Xu b5874806cb move_pages.2: Mark E2BIG as deprecated
E2BIG was removed in 2.6.29, we should mark it as deprecated.

Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-09-13 13:48:18 +02:00
Shawn Anastasio 6e164fba7e syscall.2: Add information for powerpc64
Add powerpc64 to the calling convention tables.

Signed-off-by: Shawn Anastasio <shawn@anastas.io>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-09-13 11:54:11 +02:00
Michael Kerrisk 227a368231 ptrace.2: Clarify meaning of ptrace_syscall_info 'is_error' field
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-09-12 10:50:02 +02:00
Michael Kerrisk 9d8f542d1f ptrace.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-09-12 10:50:02 +02:00
Michael Kerrisk f04534d22c ptrace.2: Describe the PTRACE_GET_SYSCALL_INFO 'op' value in more detail
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-09-12 10:49:56 +02:00
Michael Kerrisk 93c37f08be ptrace.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-09-12 10:49:56 +02:00
Michael Kerrisk 1c0955b15a ptrace.2: Minor tweaks to Dmitry Levin's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-09-12 10:49:51 +02:00
Dmitry V. Levin a60e8f1bb3 ptrace.2: Document struct ptrace_syscall_info
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-09-12 08:48:26 +02:00
Christopher M. Riedl 5f0922e7a0 mprotect.2: wfix
Signed-off-by: Christopher M. Riedl <cmr@informatik.wtf>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-09-11 15:00:19 +02:00
Michael Kerrisk 7fd5cf65c4 syscalls.2: Add clone3() and pidfd_open()
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-09-10 13:43:56 +02:00
Michael Kerrisk 519f86ca43 syscalls.2: Add fsconfig(), fsmount(), fsopen(), fspick(), move_mount(), open_tree()
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-09-10 13:43:56 +02:00
Michael Kerrisk 6d2c81ea36 syscalls.2: Add new syscalls in 5.1
Add io_uring_enter(), io_uring_register(), io_uring_setup(), and
pidfd_send_signal().

Signed-off-by:(), Michael(), Kerrisk(), <mtk.manpages@gmail.com>
2019-09-10 13:33:08 +02:00
Michael Kerrisk c3543fab53 ptrace.2: Minor tweaks to Dmitry Levin's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-09-10 12:49:01 +02:00
Dmitry V. Levin fc91449cb5 ptrace.2: Document PTRACE_GET_SYSCALL_INFO
PTRACE_GET_SYSCALL_INFO request was introduced by Linux kernel
commit 201766a20e30f982ccfe36bebfad9602c3ff574a aka
v5.3-rc1~65^2~23.

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-09-10 12:45:14 +02:00
Michael Kerrisk fec82988e7 syscall.2: Update name of syscall instruction for riscv
As reported by Florin:

    In the first table, for the riscv Arch/ABI, the instruction
    should be ecall instead of scall.

    According the official manual, the instruction has been
    renamed.
    https://content.riscv.org/wp-content/uploads/2017/05/riscv-spec-v2.2.pdf

    "The SCALL and SBREAK instructions have been renamed to
    ECALL and EBREAK, respectively. Their encoding and
    functionality are unchanged."

Reported-by: Florin Blanaru <florin.blanaru96@gmail.com>
Reviewed-by: Adam Borowski <kilobyte@angband.pl>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-09-10 12:45:14 +02:00
Jakub Wilk b5e1b804f9 fanotify_mark.2: Document FAN_MOVE_SELF
Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-09-10 12:45:14 +02:00
Jakub Wilk 10fa1da2a3 fanotify_mark.2: Add kernel version numbers for some FAN_* constants
Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-09-10 12:45:14 +02:00
Jakub Wilk bbd7edea6e fanotify_mark.2: ffix
Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-09-10 12:45:14 +02:00
Michael Kerrisk b6088873ae prctl.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-08-27 13:56:13 +02:00
Eric Biggers ff085a5e44 socket.2: tfix
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-08-26 23:14:49 +02:00
Michael Kerrisk d837569d1e uname.2: Replace reference to namespaces(7) with reference to uts_namespaces(7)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-08-26 23:14:49 +02:00
Michael Kerrisk 16ea6936c7 getdomainname.2: Add mention of UTS namespaces
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-08-26 23:14:49 +02:00
Michael Kerrisk 79ea68831f gethostname.2: Mention UTS namespaces
Reported-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-08-26 23:14:49 +02:00
Michael Kerrisk ed4f87f0c8 clone.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-08-26 21:54:16 +02:00
Michael Kerrisk c031ffcc56 statx.2: Clarify details of a case where an invalid 'mask' value may be rejected
As reported by Simone:

    I was looking at version from 2017-09-15 but it's the same
    on: http://man7.org/linux/man-pages/man2/statx.2.html
    (2019-03-06)

    There is reported (about the mask argument) after the list
    of constants:

    > Note that the kernel does not reject values in mask other
    > than the above.  Instead, it simply informs the caller which
    > values are sup‐ ported by this kernel and filesystem via the
    > statx.stx_mask field.

    But as reported in the error values, there can be EINVAL if
    mask has a reserved valued, and I found a check against
    STATX__RESERVED in fs/stat.c for this. So if you use a that
    bit (0x80000000U) the kernel will reject the value.

    Probably is better to say that the kernel do not enforce the
    use of only the listed values, but there are anyway reserved
    values so and so you cannot put whatever you want on mask
    (that apply to more values than UINT_MAX).

Reported-by: Simone Piccardi <piccardi@truelite.it>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-08-20 09:29:49 +02:00
Michael Kerrisk 0b9a799587 prctl.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-08-02 08:35:43 +02:00
Michael Kerrisk 63121bd499 pldd.1, bpf.2, chdir.2, clone.2, fanotify_init.2, fanotify_mark.2, intro.2, ipc.2, mount.2, mprotect.2, msgctl.2, msgget.2, msgop.2, pivot_root.2, pkey_alloc.2, poll.2, prctl.2, semctl.2, semget.2, semop.2, setxattr.2, shmctl.2, shmget.2, shmop.2, tkill.2, dlopen.3, exec.3, ftok.3, getutent.3, on_exit.3, strcat.3, cpuid.4, proc.5, capabilities.7, cgroup_namespaces.7, credentials.7, fanotify.7, mount_namespaces.7, namespaces.7, sched.7, signal.7, socket.7, unix.7, user_namespaces.7, vdso.7, xattr.7, ld.so.8: tstamp
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-08-02 08:34:32 +02:00
Michael Kerrisk 8d7dde9f9c setxattr.2: Place new ERANGE error in correct alphabetical order
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-08-01 19:33:38 +02:00
Michael Kerrisk cada754ad1 setxattr.2: Tweaks to Finn O'Leary's text
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-08-01 19:33:38 +02:00
Finn O'Leary acea950099 setxattr.2: Add ERANGE to 'ERRORS' section
Hi,

Both the Ext2 filesystem handler and the Ext4 filesystem handler will
return the ERANGE error code. Ext2 will return it if the name or value is
too long to be able to be stored, Ext4 will return it if the name is too
long. For reference, the relevant files/lines (with excerpts) are:

fs/ext2/xattr.c: lines 394 to 396 in ext2_xattr_set
>  394         name_len = strlen(name);
>  395         if (name_len > 255 || value_len > sb->s_blocksize)
>  396                 return -ERANGE;

fs/ext4/xattr.c: lines 2317 to 2318 in ext4_xattr_set_handle
> 2317         if (strlen(name) > 255)
> 2318                 return -ERANGE;

Other filesystems also return this code:

xfs/libxfs/xfs_attr.h: lines 53 to 55
> * The maximum size (into the kernel or returned from the kernel) of an
> * attribute value or the buffer used for an attr_list() call.  Larger
> * sizes will result in an ERANGE return code.

It's possible that more filesystem handlers do this, a cursory grep shows
that most of the filesystem xattr handler files mention ERANGE in some
form. A suggested patch is below (I'm not 100% sure on the wording through).

Thanks

--
- Finn

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-08-01 19:33:38 +02:00
Yang Xu c14f79303f prctl.2: Correct some details for PR_SET_TIMERSLACK
In kernel/sys.c, arg2 is an unsigned long value and it will never
less than 0. Also, since kernel commit id da8b44d5a9f8 (Linux
4.6), timer_slack_ns and default timer_slack_ns have been
converted into u64, the return value of PR_GET_TIMERSLACK has been
limited under ULONG_MAX.

The timer slack value also can be inherited by a child created via
fork(2).

Reviewed-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-07-30 08:25:37 +02:00
Michael Kerrisk 0bdda5d08e poll.2: Note that poll() equivalent code for ppoll() is not quite equivalent
As reported by Alan Stern:

Here are two extracts from the man page for ppoll(2):

     Specifying a negative value in timeout means an infinite
     timeout.

     Other than the difference in the precision of the timeout
     argument, the following ppoll() call:

       ready = ppoll(&fds, nfds, tmo_p, &sigmask);

     is equivalent to atomically executing the following calls:

       sigset_t origmask;
       int timeout;

       timeout = (tmo_p == NULL) ? -1 :
                 (tmo_p->tv_sec * 1000 + tmo_p->tv_nsec / 1000000);
       pthread_sigmask(SIG_SETMASK, &sigmask, &origmask);
       ready = poll(&fds, nfds, timeout);
       pthread_sigmask(SIG_SETMASK, &origmask, NULL);

But if tmo_p->tv_sec is negative, the ppoll() call is not
equivalent to the corresponding poll() call.  The kernel rejects
negative values of tv_sec with an EINVAL error; it does not
interpret the value as meaning an infinite timeout.

(Yes, the kernel interprets tmo_p == NULL as an infinite timeout,
but the man page is still wrong for the case tmo_p->tv_sec < 0.)

Suggested fix: Following the end of the second extract above, add:

    except that negative time values in tmo_p are not
    interpreted as an infinite timeout.

Also, in the ERRORS section, change the text for EINVAL to:

    EINVAL The nfds value exceeds the RLIMIT_NOFILE value or
    *tmo_p contains an invalid (negative) time value.

Reported-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-07-30 08:25:27 +02:00
Michael Kerrisk 6f4a00d62f mount.2: ERRORS: Add a couple of EINVAL errors for MS_MOVE
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-07-28 09:17:06 +02:00
Michael Kerrisk 0610c6f1f8 mount.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-07-26 23:28:08 +02:00
Michael Kerrisk a68bb0b38d mount.2: SEE ALSO: add chroot(2) and pivot_root(2)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-07-26 23:27:18 +02:00
Michael Kerrisk a39e880f67 pivot_root.2: 'put_old' can't be a mount point with MS_SHARED propagation
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-07-26 23:22:59 +02:00
Michael Kerrisk 34a0f19c76 pivot_root.2: SEE ALSO: add mount(2)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-07-26 17:10:58 +02:00
Michael Kerrisk 1a0b1fd76b pivot_root.2: ERRORS: EINVAL occurs if 'new_root' or its parent has shared propagation
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-07-26 17:10:06 +02:00
Michael Kerrisk 37704bfc8f pivot_root.2: 'new_root' must be a mount point
It appears that 'new_root' may not have needed to be a mount
point on ancient kernels, but already in Linux 2.4.5, there
was the diff shown below. Verified also by testing.

@@ -1631,8 +1605,9 @@
  *  - we don't move root/cwd if they are not at the root (reason: if something
  *    cared enough to change them, it's probably wrong to force them elsewhere)
  *  - it's okay to pick a root that isn't the root of a file system, e.g.
- *    /nfs/my_root where /nfs is the mount point. Better avoid creating
- *    unreachable mount points this way, though.
+ *    /nfs/my_root where /nfs is the mount point. It must be a mountpoint,
+ *    though, so you may need to say mount --bind /nfs/my_root /nfs/my_root
+ *    first.
  */

 asmlinkage long sys_pivot_root(const char *new_root, const char *put_old)
@@ -1640,7 +1615,7 @@
        struct dentry *root;
        struct vfsmount *root_mnt;
        struct vfsmount *tmp;
-       struct nameidata new_nd, old_nd;
+       struct nameidata new_nd, old_nd, parent_nd, root_parent;
        char *name;
        int error;

@@ -1688,6 +1663,10 @@
        if (new_nd.mnt == root_mnt || old_nd.mnt == root_mnt)
                goto out2; /* loop */
        error = -EINVAL;
+       if (root_mnt->mnt_root != root)
+               goto out2;
+       if (new_nd.mnt->mnt_root != new_nd.dentry)
+               goto out2; /* not a mountpoint */
        tmp = old_nd.mnt; /* make sure we can reach put_old from new_root */
        spin_lock(&dcache_lock);
        if (tmp != new_nd.mnt) {

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-07-26 16:54:16 +02:00
Michael Kerrisk 4d4708bfd2 getgroups.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-07-16 13:50:05 +02:00
Jakub Wilk ed386413f8 execve.2: tfix
Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-07-13 10:15:48 -06:00
Michael Kerrisk 069be4fd22 bpf.2: Correct kernel version for JIT support on s390
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-07-13 18:05:50 +02:00
Michael Kerrisk 4c63ee20b0 tkill.2: glibc 2.30 provides a wrapper for tgkill()
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-07-08 12:23:55 +02:00
Michael Kerrisk 343cdc5ac9 clone.2, intro.2, ipc.2, msgctl.2, msgget.2, msgop.2, semctl.2, semget.2, semop.2, shmctl.2, shmget.2, shmop.2, ftok.3, proc.5, namespaces.7: Change reference to svipc(7) to sysvipc(7)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-06-25 06:38:01 +02:00
Michael Kerrisk 173eb06cd8 ptrace.2: wfix: s/proper superset/superset/ in "Ptrace access mode checking"
Reported-by: Alexey Izbyshev <izbyshev@ispras.ru>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-06-21 08:04:58 +02:00
Michael Kerrisk 63059c4b52 execve.2: Some tweaks to Shawn Landden's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-06-21 08:02:38 +02:00
Shawn Landden 60f16bf2fe execve.2: Add more detail about Shebangs
Signed-off-by: Shawn Landden <shawn@git.icu>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-06-21 08:02:37 +02:00
Michael Kerrisk 44dceef0cd execve.2: Since Linux 5.1, the limit on the #! line is 255 chars (rather than 127)
Reported-by: Eugene Syromyatnikov <evgsyr@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-06-19 21:06:11 +02:00