Skip to contentSkip to conversation

yama: clarify ptrace_scope=2 in Yama documentation

PATCH Applied Yves-Alexis Perez 4 participants 7 messages Oct 2, 2018 – Oct 7, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 yama: clarify ptrace_scope=2 in Yama documentation

Current phrasing is ambiguous since it's unclear if attaching to a children through PTRACE_TRACEME requires CAP_SYS_PTRACE. Rephrase the sentence to make that clear.

---
 Documentation/admin-guide/LSM/Yama.rst | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Documentation/admin-guide/LSM/Yama.rst +2 -2
index 13468ea696b7..d0a060de3973 100644
@@ -64,8 +64,8 @@ The sysctl settings (writable only with ``CAP_SYS_PTRACE``) are:
     Using ``PTRACE_TRACEME`` is unchanged.
 
 2 - admin-only attach:
-    only processes with ``CAP_SYS_PTRACE`` may use ptrace
-    with ``PTRACE_ATTACH``, or through children calling ``PTRACE_TRACEME``.
+    only processes with ``CAP_SYS_PTRACE`` may use ptrace, either with
+    ``PTRACE_ATTACH`` or through children calling ``PTRACE_TRACEME``.
 
 3 - no attach:
     no processes may use ptrace with ``PTRACE_ATTACH`` nor via
Signature · 5 lines
2.19.0


-- 
Yves-Alexis
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Yves-Alexis Perez

Current phrasing is ambiguous since it's unclear if attaching to a children through PTRACE_TRACEME requires CAP_SYS_PTRACE. Rephrase the sentence to make that clear.

Thanks! Yes, this makes things more clear.

Jon, can you take this in your tree?

-Kees

Quoted 25 lines
---
 Documentation/admin-guide/LSM/Yama.rst | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Documentation/admin-guide/LSM/Yama.rst +2 -3
index 13468ea696b7..d0a060de3973 100644
@@ -64,8 +64,8 @@ The sysctl settings (writable only with ``CAP_SYS_PTRACE``) are:
     Using ``PTRACE_TRACEME`` is unchanged.
 
 2 - admin-only attach:
-    only processes with ``CAP_SYS_PTRACE`` may use ptrace
-    with ``PTRACE_ATTACH``, or through children calling ``PTRACE_TRACEME``.
+    only processes with ``CAP_SYS_PTRACE`` may use ptrace, either with
+    ``PTRACE_ATTACH`` or through children calling ``PTRACE_TRACEME``.
 
 3 - no attach:
     no processes may use ptrace with ``PTRACE_ATTACH`` nor via
--

2.19.0

--
Yves-Alexis

Signature · 2 lines
Kees Cook
Pixel Security
maintainer Applied
#2 lore raw
Quoted 5 lines · On Tue, 2 Oct 2018 13:52:32 -0700 Kees Cook <[email protected]> wrote:
Quoted 4 lines · Yves-Alexis Perez

Current phrasing is ambiguous since it's unclear if attaching to a children through PTRACE_TRACEME requires CAP_SYS_PTRACE. Rephrase the sentence to make that clear.

Quoted 7 lines
Quoted 1 line

Thanks! Yes, this makes things more clear.

Jon, can you take this in your tree?

Applied, thanks.

jon

#3 lore raw
In reply to Yves-Alexis Perez
Quoted 3 lines · Yves-Alexis Perez

Current phrasing is ambiguous since it's unclear if attaching to a children through PTRACE_TRACEME requires CAP_SYS_PTRACE. Rephrase the sentence to make that clear.

I disagree that your sentence makes that clear. How about:

Documentation/admin-guide/LSM/Yama.rst The sysctl settings (writable only with ``CAP_SYS_PTRACE``) are: · line 68

Quoted 5 lines

2 - admin-only attach:

Documentation/admin-guide/LSM/Yama.rst +2 -2
-    only processes with ``CAP_SYS_PTRACE`` may use ptrace
-    with ``PTRACE_ATTACH``, or through children calling ``PTRACE_TRACEME``.
+    only processes with ``CAP_SYS_PTRACE`` may use ptrace, either with
+    ``PTRACE_ATTACH`` or through children calling ``PTRACE_TRACEME``.

+ only processes with ``CAP_SYS_PTRACE`` may use ptrace. This
+ restricts both ``PTRACE_ATTACH`` and ``PTRACE_TRACEME``.

#4 lore raw
Quoted 13 lines · Matthew Wilcox
Quoted 3 lines · Yves-Alexis Perez

Current phrasing is ambiguous since it's unclear if attaching to a children through PTRACE_TRACEME requires CAP_SYS_PTRACE. Rephrase the sentence to make that clear.

I disagree that your sentence makes that clear. How about:

Quoted 5 lines

2 - admin-only attach:

Documentation/admin-guide/LSM/Yama.rst +2 -2
-    only processes with ``CAP_SYS_PTRACE`` may use ptrace
-    with ``PTRACE_ATTACH``, or through children calling ``PTRACE_TRACEME``.
+    only processes with ``CAP_SYS_PTRACE`` may use ptrace, either with
+    ``PTRACE_ATTACH`` or through children calling ``PTRACE_TRACEME``.

Review

Quoted 2 lines
(quoted diff) +2 -0
+    only processes with ``CAP_SYS_PTRACE`` may use ptrace.  This
+    restricts both ``PTRACE_ATTACH`` and ``PTRACE_TRACEME``.

PTRACE_TRACEME is done by the child, not the process with CAP_SYS_PTRACE, so I still think the Yves-Alexis's is clearer. But if other agree, I'm fine with it. :)

-Kees

Signature · 2 lines
Kees Cook
Pixel Security
#5 lore raw
In reply to Matthew Wilcox
Quoted 14 lines · Matthew Wilcox
Quoted 3 lines · Yves-Alexis Perez

Current phrasing is ambiguous since it's unclear if attaching to a children through PTRACE_TRACEME requires CAP_SYS_PTRACE. Rephrase the sentence to make that clear.

I disagree that your sentence makes that clear. How about:

Quoted 6 lines

2 - admin-only attach:

(quoted diff) +0 -2
-    only processes with ``CAP_SYS_PTRACE`` may use ptrace
-    with ``PTRACE_ATTACH``, or through children calling

``PTRACE_TRACEME``.

Documentation/admin-guide/LSM/Yama.rst +2 -0
+    only processes with ``CAP_SYS_PTRACE`` may use ptrace, either with
+    ``PTRACE_ATTACH`` or through children calling ``PTRACE_TRACEME``.

Review

Quoted 2 lines
(quoted diff) +2 -0
+    only processes with ``CAP_SYS_PTRACE`` may use ptrace.  This
+    restricts both ``PTRACE_ATTACH`` and ``PTRACE_TRACEME``.

Hi Matthew,

I'm no native speaker, both versions are fine by me but I liked keeping the “children calling” part since the semantics are quite different for PTRACE_ATTACH and PTRACE_TRACEME.

Regards,

Signature · 1 line
Yves-Alexis
#6 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Quoted 15 lines · Yves-Alexis Perez
Quoted 14 lines · Matthew Wilcox
Quoted 3 lines · Yves-Alexis Perez

Current phrasing is ambiguous since it's unclear if attaching to a children through PTRACE_TRACEME requires CAP_SYS_PTRACE. Rephrase the sentence to make that clear.

I disagree that your sentence makes that clear. How about:

Quoted 6 lines

2 - admin-only attach:

(quoted diff) +0 -2
-    only processes with ``CAP_SYS_PTRACE`` may use ptrace
-    with ``PTRACE_ATTACH``, or through children calling

``PTRACE_TRACEME``.

Documentation/admin-guide/LSM/Yama.rst +2 -0
+    only processes with ``CAP_SYS_PTRACE`` may use ptrace, either with
+    ``PTRACE_ATTACH`` or through children calling ``PTRACE_TRACEME``.
Quoted 9 lines

Review

Quoted 2 lines
(quoted diff) +2 -0
+    only processes with ``CAP_SYS_PTRACE`` may use ptrace.  This
+    restricts both ``PTRACE_ATTACH`` and ``PTRACE_TRACEME``.

Hi Matthew,

I'm no native speaker, both versions are fine by me but I liked keeping the “children calling” part since the semantics are quite different for PTRACE_ATTACH and PTRACE_TRACEME.

Hi Kees, Matthew,

so what's the status on this? Who needs to acknowledge one wording or another?

Regards,
- --
Yves-Alexis
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEE8vi34Qgfo83x35gF3rYcyPpXRFsFAlu5ydIACgkQ3rYcyPpX RFt7oAgAued/FsFiGvk6U/RG3JEj5p5aRu6harAXqK/Mw8n1gEu0nGvZvFJn31eY fcU8quTtbmiNR2oYrAxjri2dhVd2JLsKDZU1bhpcKk33jDOzhUjeKnJgLGY38Z01 5idfKSy0CEZ0FvYvpt7gOm3loFlbM0au9JgFszVwFM8Yartr5vH1mPlZUwGbrroH RORqAkwVI+g8iK1vqq9fdCf9J5mwcYu0DR8STvP8Nx12zEDNeiCShvXDNNt5VKg3 BHVNPHvE8uKaZmlyYt1oy9ZKjjcHn6veVkKEKFRz/TVc+q/Z7G1cORzVb7GzIPGj 9GoIZP2+Wi+7KUqUYQnHZSfujd5BzQ==
=jfBM
-----END PGP SIGNATURE-----