Commit Graph

16350 Commits

Author SHA1 Message Date
Michael Kerrisk e532361686 ptrace.2: Update Yama ptrace_scope documentation
Reframe the discussion in terms of PTRACE_MODE_ATTACH checks,
and make a few other minor tweaks and additions.

Reviewed-by: Jann Horn <jann@thejh.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-06-29 07:06:30 +02:00
Michael Kerrisk 94b0464cc2 ptrace.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-06-29 07:06:30 +02:00
Michael Kerrisk b0459842ff ptrace.2: srcfix: add 2015 copyright notice for mtk
(Yama ptrace_scope text added in 2015.)

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-06-29 07:06:30 +02:00
Michael Kerrisk 00172d8d96 ptrace.2: Add an introductory paragraph to the Ptrace access mode checks" section
Reported-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-06-29 07:06:29 +02:00
Michael Kerrisk 1c22e40a71 ptrace.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-06-29 07:06:29 +02:00
Michael Kerrisk 3224581342 ptrace.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-06-29 07:06:29 +02:00
Michael Kerrisk edb7368474 ptrace.2: Relocate text noting that PTRACE_MODE_* constants are kernel-internal
(No content changes.)

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-06-29 07:06:29 +02:00
Michael Kerrisk be26fa864f ptrace.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-06-29 07:06:29 +02:00
Michael Kerrisk bcd0d82dac ptrace.2: srcfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-06-29 07:06:29 +02:00
Stephen Smalley 3cd161fe57 ptrace.2: Describe PTRACE_MODE_NOAUDIT in more detail
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-06-29 07:06:29 +02:00
Michael Kerrisk 78f0786577 ptrace.2: Further fixes after review from Jann Horn
Reported-by: Jann Horn <jann@thejh.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-06-29 07:06:29 +02:00
Michael Kerrisk a330bffa78 ptrace.2: Minor improvements to ptrace access mode text
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-06-29 07:06:29 +02:00
Michael Kerrisk 611d3ac40a ptrace.2: Various fixes after review by Jann Horn
Among other things, Jann pointed out that the commoncap LSM
is always invoked, and Kees Cook pointed out the relevant
kernel code:

===
> BTW, can you point me at the piece(s) of kernel code that show that
> "commoncap" is always invoked in addition to any other LSM that has
> been installed?

It's not entirely obvious, but the bottom of security/commoncap.c shows:

struct security_hook_list capability_hooks[] = {
        LSM_HOOK_INIT(capable, cap_capable),
...
};

void __init capability_add_hooks(void)
{
        security_add_hooks(capability_hooks, ARRAY_SIZE(capability_hooks));
}

And security/security.c shows the initialization order of the LSMs:

int __init security_init(void)
{
        pr_info("Security Framework initialized\n");

        /*
         * Load minor LSMs, with the capability module always first.
         */
        capability_add_hooks();
        yama_add_hooks();
        loadpin_add_hooks();

        /*
         * Load all the remaining security modules.
         */
        do_security_initcalls();

        return 0;
}
===

Reported-by: Jann Horn <jann@thejh.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-06-29 07:06:29 +02:00
Michael Kerrisk 0647331a06 kcmp.2, ptrace.2: tfix
Reported-by: Jann Horn <jann@thejh.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-06-29 07:06:29 +02:00
Michael Kerrisk e4e2367fe6 ptrace.2: Clarify the purpose of mentioning the kernel PTRACE_MODE_* constants
The "ptrace access mode" text is about user-space-visible
behavior, but in order to explain that behavior at what I
believe is a sufficient level of detail (e.g., to differentiate
the various types of checks that are performed for various
system calls and pseudofile accesses), one needs (1) to discuss
the MODE flag details as implemented in the kernel, and (2) to
have a shorthand way to refer to the various cases from other
pages. It's not absolutely necessary to name the flags for (1),
but using the flag names is certainly a handy shorthand for (2).

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-06-29 07:06:29 +02:00
Michael Kerrisk 6f92213776 proc.5: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-06-29 07:06:29 +02:00
Michael Kerrisk 3bd3ab0f55 kcmp.2: kcmp() is governed by PTRACE_MODE_READ_REALCREDS
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-06-29 07:06:29 +02:00
Michael Kerrisk a1c7ef5685 get_robust_list.2: get_robust_list() is governed by PTRACE_MODE_READ_REALCREDS
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-06-29 07:06:29 +02:00
Michael Kerrisk 13ec13dc19 perf_event_open.2: If pid > 0, the operation is governed by PTRACE_MODE_READ_REALCREDS
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-06-29 07:06:29 +02:00
Michael Kerrisk c33e8aff8c ptrace.2: Note that PTRACE_SEIZE is subject to a ptrace access mode check
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-06-29 07:06:29 +02:00
Michael Kerrisk d4c976d820 ptrace.2: Rephrase PTRACE_ATTACH permissions in terms of ptrace access mode check
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-06-29 07:06:29 +02:00
Michael Kerrisk 408c8172e4 process_vm_readv.2: Rephrase permission rules in terms of a ptrace access mode check
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-06-29 07:06:29 +02:00
Michael Kerrisk b02b4b74d5 proc.5: Note /proc/PID/stat fields that are governed by PTRACE_MODE_READ_FSCREDS
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-06-29 07:06:29 +02:00
Michael Kerrisk 138a191e99 proc.5: /proc/PID/fd/* are governed by PTRACE_MODE_READ_FSCREDS
Permission to dereference/readlink /proc/PID/fd/* symlinks is
governed by a PTRACE_MODE_READ_FSCREDS ptrace access mode check.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-06-29 07:06:29 +02:00
Michael Kerrisk 33a1ab5da1 namespaces.7: /proc/PID/ns/* are governed by PTRACE_MODE_READ_FSCREDS
Permission to dereference/readlink /proc/PID/ns/* symlinks is
governed by a PTRACE_MODE_READ_FSCREDS ptrace access mode check.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-06-29 07:06:29 +02:00
Michael Kerrisk b902fe180b proc.5: /proc/PID/{cwd,exe,root} are governed by PTRACE_MODE_READ_FSCREDS
Permission to dereference/readlink /proc/PID/{cwd,exe,root} is
governed by a PTRACE_MODE_READ_FSCREDS ptrace access mode check.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-06-29 07:06:29 +02:00
Michael Kerrisk 4834ae914c proc.5: /proc/PID/{personality,stack,syscall} are governed by PTRACE_MODE_ATTACH_FSCREDS
Permission to access /proc/PID/{personality,stack,syscall} is
governed by a PTRACE_MODE_ATTACH_FSCREDS ptrace access mode check.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-06-29 07:06:29 +02:00
Michael Kerrisk d8e2972ab8 proc.5: /proc/PID/io is governed by PTRACE_MODE_READ_FSCREDS
Permission to access /proc/PID/io is governed by
a PTRACE_MODE_READ_FSCREDS ptrace access mode check.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-06-29 07:06:29 +02:00
Michael Kerrisk a62e0e012d proc.5: /proc/PID/timerslack_ns is governed by PTRACE_MODE_ATTACH_FSCREDS
Permission to access /proc/PID/timerslack_ns is governed by
a PTRACE_MODE_ATTACH_FSCREDS ptrace access mode check.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-06-29 07:06:28 +02:00
Michael Kerrisk 82664739be proc.5: /proc/PID/{auxv,environ,wchan} are governed by PTRACE_MODE_READ_FSCREDS
Permission to access /proc/PID/{auxv,environ,wchan} is governed by
a PTRACE_MODE_READ_FSCREDS ptrace access mode check.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-06-29 07:06:28 +02:00
Michael Kerrisk aee2f0bfa1 proc.5: Document /proc/PID/{maps,mem,pagemap} access mode checks
Permission to access /proc/PID/{maps,pagemap} is governed by a
PTRACE_MODE_READ_FSCREDS ptrace access mode check.

Permission to access /proc/PID/mem is governed by a
PTRACE_MODE_ATTACH_FSCREDS ptrace access mode check.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-06-29 07:06:28 +02:00
Michael Kerrisk ace93363fb ptrace.2: Document ptrace access modes
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Jann Horn <jann@thejh.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-06-29 07:06:28 +02:00
Michael Kerrisk 2e23a9b257 cgroups.7: ERRORS: add mount(2) EBUSY error
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-06-28 06:32:23 +02:00
Michael Kerrisk 687d3f4aef user_namespaces.7: Correct user namespace rules for mounting /proc
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-06-26 16:31:44 +02:00
Michael Kerrisk 7e52299f66 user_namespaces.7: CAP_SYS_ADMIN allows mounting cgroup filesystems
See https://bugzilla.kernel.org/show_bug.cgi?id=120671

Reported-by: Michał Zegan <webczat_200@poczta.onet.pl>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-06-26 16:11:30 +02:00
Michael Kerrisk 8a9fb19dbd user_namespaces.7: Clarify CAP_SYS_ADMIN details for mounting FS_USERNS_MOUNT filesystems
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-06-26 16:09:06 +02:00
Michael Kerrisk 329ad27142 acct.2, chmod.2, fcntl.2, mmap.2, mprotect.2, rmdir.2, times.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-06-26 13:08:52 +02:00
Michael Kerrisk 74714ea895 ctime.3, error.3, getmntent.3, getnetent_r.3, getrpcent_r.3, getservent_r.3, pthread_attr_init.3, pthread_getattr_np.3, pthread_tryjoin_np.3, rpc.3, setaliasent.3, setenv.3, unlocked_stdio.3: srcfix: Eliminate some groff warnings
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-06-26 11:25:22 +02:00
Michael Kerrisk 4100abc52e futex.2: Explain how to get equivalent of FUTEX_WAIT with an absolute timeout
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-06-26 11:25:22 +02:00
Michael Kerrisk 678c99868e futex.2: Describe FUTEX_BITSET_MATCH_ANY
Describe FUTEX_BITSET_MATCH_ANY and FUTEX_WAIT and FUTEX_WAKE
equivalences.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-06-26 11:25:11 +02:00
Michael Kerrisk 6c38ce7f1f futex.2: Note that at least one bit must be set in mask for BITSET operations
At least one bit must be set in the 'val3' mask supplied for the
FUTEX_WAIT_BITSET and FUTEX_WAKE_BITSET operations.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-06-24 09:42:15 +02:00
Michael Kerrisk 84abf4ba97 futex.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-06-24 09:34:16 +02:00
Michael Kerrisk b3d5bc4ca6 futex.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-06-24 09:28:56 +02:00
Michael Kerrisk ac991a11d7 futex.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-06-24 08:55:17 +02:00
Michael Kerrisk a6918f1d4b futex.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-06-24 08:54:03 +02:00
Michael Kerrisk 40d2dab928 futex.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-06-24 08:53:09 +02:00
Michael Kerrisk 6f19879d52 futex.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-06-24 08:53:09 +02:00
Michael Kerrisk a01c3098e8 futex.2: Clarify clock default and choices for FUTEX_WAIT
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-06-24 08:53:09 +02:00
Marko Myllynen 2c0cac3e00 charmap.5: ffix 2016-06-23 12:54:29 +02:00
Michael Kerrisk 8064bfa536 futex.2: Fix descriptions of various timeouts
Reported-by: Thomas Gleixner <tglx@linutronix.de>
Reported-by: Darren Hart <dvhart@infradead.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-06-23 12:47:49 +02:00