From: Yan Zhu <zhuyan2015@qq.com>
To: alexs@kernel.org, si.yanteng@linux.dev, corbet@lwn.net, mic@digikod.net
Cc: dzm91@hust.edu.cn, skhan@linuxfoundation.org, gnoack@google.com,
zhuyan2015@qq.com, linux-doc@vger.kernel.org,
linux-security-module@vger.kernel.org
Subject: [PATCH 07/10] docs/zh_CN: add LSM/Yama Chinese translation
Date: Sun, 15 Nov 2026 23:20:03 +0800 [thread overview]
Message-ID: <tencent_58599B779D476D63C80830EF7C2E66968508@qq.com> (raw)
In-Reply-To: <cover.1781105672.git.zhuyan2015@qq.com>
Translate Documentation/admin-guide/LSM/Yama.rst into Chinese.
Update the translation through commit 9d1bd9e8e028
("doc: yama: Swap HTTP for HTTPS and replace dead link")
Assisted-by: Claude:deepseek-4-pro
Signed-off-by: Yan Zhu <zhuyan2015@qq.com>
---
.../zh_CN/admin-guide/LSM/Yama.rst | 71 +++++++++++++++++++
1 file changed, 71 insertions(+)
create mode 100644 Documentation/translations/zh_CN/admin-guide/LSM/Yama.rst
diff --git a/Documentation/translations/zh_CN/admin-guide/LSM/Yama.rst b/Documentation/translations/zh_CN/admin-guide/LSM/Yama.rst
new file mode 100644
index 000000000000..ada3ec079432
--- /dev/null
+++ b/Documentation/translations/zh_CN/admin-guide/LSM/Yama.rst
@@ -0,0 +1,71 @@
+.. SPDX-License-Identifier: GPL-2.0
+.. include:: ../../disclaimer-zh_CN.rst
+
+:Original: Documentation/admin-guide/LSM/Yama.rst
+:翻译:
+ 朱岩 Yan Zhu <zhuyan2015@qq.com>
+
+
+====
+Yama
+====
+
+Yama 是一种 Linux 安全模块(LSM),用于收集系统范围内的 DAC(自主访问控制)
+安全保护,这些保护并不是由内核本身直接处理的。在编译时可通过
+``CONFIG_SECURITY_YAMA`` 选择,并可在运行时通过 ``/proc/sys/kernel/yama``
+中的 sysctl 接口控制:
+
+ptrace_scope
+============
+
+随着 Linux 的流行度提升,它将成为更大的恶意软件攻击目标。Linux 进程接口的一个
+突出弱点是单个用户能够检查其拥有的任意进程的内存和运行状态。例如,若 Pidgin
+被入侵,攻击者即可附加到其他运行中的进程(如 Firefox、SSH 会话、GPG 代理等),
+提取更多凭证,并在不依赖用户钓鱼的情况下扩大攻击范围。
+
+这不是理论上的问题。已有文献记载 `SSH 会话劫持 <yama_ssh_hijack_>`_ 和
+`任意代码注入 <yama_code_injection_>`_ 攻击,这些攻击在允许 ptrace 如前所述
+时仍然可能发生。由于 ptrace 并不是非开发者和非管理员常用的功能,系统构建者应
+当能够选择关闭此调试机制。
+
+一种解决方案是某些应用使用 ``prctl(PR_SET_DUMPABLE, ...)`` 明确禁止 ptrace
+附加(如 ssh‑agent),但大多数并未如此。更通用的方案是仅允许父进程向子进程的
+ptrace(即 ``gdb <child>``、``strace <child>`` 仍可工作),或通过
+``CAP_SYS_PTRACE``(即 root 仍可使用 ``gdb --pid=PID``、``strace -p PID``)。
+
+在模式 1 中,软件可以通过 ``prctl(PR_SET_PTRACER, pid, ...)`` 为调试进程与其
+子进程之间定义特定关系。子进程可声明哪些进程(及其后代)被允许调用
+``PTRACE_ATTACH``。每个子进程同一时间只能有一个此类声明的调试进程。例如 KDE、
+Chromium、Firefox 的崩溃处理器以及 Wine 用于相互 ptrace 的进程均采用此方式。
+若进程希望完全禁用这些限制,可调用
+``prctl(PR_SET_PTRACER, PR_SET_PTRACER_ANY, ...)``,从而允许任何已被允许的进
+程(即使在外部 pid 命名空间)进行附加。
+
+sysctl 配置如下(仅在拥有 ``CAP_SYS_PTRACE`` 时可写):
+
+0 - 经典 ptrace 权限:
+ 一个进程可以对任何在相同 uid 下运行的其他进程执行 `PTRACE_ATTACH`
+ 操作,只要目标进程是可转储的(即未转换 uid、未以特权启动或未调用过
+ `prctl(PR_SET_DUMPABLE...)`)。同样,`PTRACE_TRACEME` 保持不变。
+
+1 - 限制性 ptrace:
+ 进程必须与其欲 attach 的子进程预先建立关系。默认关系为仅限其后代,且满
+ 足上述经典条件。若要更改这种关系,子进程可以调用
+ ``prctl(PR_SET_PTRACER, debugger, ...)`` 来声明允许的调试器 PID,以便在
+ 该子进程上调用 ``PTRACE_ATTACH``。使用 ``PTRACE_TRACEME`` 则保持不变。
+
+2 - 仅管理员可 attach:
+ 只有具备 ``CAP_SYS_PTRACE`` 权限的进程才能使用 ptrace,无论是通过
+ ``PTRACE_ATTACH`` 还是通过子进程调用 ``PTRACE_TRACEME``)。
+
+3 - 禁止 attach:
+ 任意进程不可使用 ``PTRACE_ATTACH`` 或 ``PTRACE_TRACEME``。一旦设定,此值
+ 不可更改。
+
+最初的仅限于子进程的逻辑源自 grsecurity 中的限制条件制定的。
+
+.. _yama_ssh_hijack:
+ https://www.blackhat.com/presentations/bh-usa-05/bh-us-05-boileau.pdf
+
+.. _yama_code_injection:
+ https://c-skills.blogspot.com/2007/05/injectso.html
--
2.43.0
next prev parent reply other threads:[~2026-11-15 15:20 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1781105672.git.zhuyan2015@qq.com>
2026-06-12 15:58 ` [PATCH 01/10] docs/zh_CN: add LSM/index Chinese translation Yan Zhu
2026-06-12 15:58 ` [PATCH 02/10] docs/zh_CN: add LSM/apparmor " Yan Zhu
2026-06-12 15:58 ` [PATCH 03/10] docs/zh_CN: add LSM/LoadPin " Yan Zhu
2026-10-26 9:21 ` Dongliang Mu
2026-06-12 15:58 ` [PATCH 04/10] docs/zh_CN: add LSM/SELinux " Yan Zhu
2026-06-12 15:58 ` [PATCH 05/10] docs/zh_CN: add LSM/Smack " Yan Zhu
2026-06-12 15:58 ` [PATCH 06/10] docs/zh_CN: add LSM/tomoyo " Yan Zhu
2026-06-12 15:58 ` [PATCH 07/10] docs/zh_CN: add LSM/Yama " Yan Zhu
2026-06-12 15:58 ` [PATCH 08/10] docs/zh_CN: add LSM/SafeSetID " Yan Zhu
2026-06-12 15:58 ` [PATCH 09/10] docs/zh_CN: add LSM/ipe " Yan Zhu
2026-06-13 2:54 ` Fan Wu
2026-06-13 15:08 ` Yan Zhu
2026-10-26 9:26 ` Dongliang Mu
2026-07-06 4:41 ` Alex Shi
2026-10-23 15:38 ` Weijie Yuan
2026-06-12 15:58 ` [PATCH 10/10] docs/zh_CN: add LSM/landlock " Yan Zhu
2026-10-26 10:12 ` Dongliang Mu
2026-11-15 14:12 ` Yan Zhu
2026-06-12 16:03 ` [PATCH 03/10] docs/zh_CN: add LSM/LoadPin " Yan Zhu
2026-07-04 15:20 ` [PATCH 01/10] docs/zh_CN: add LSM/index " Weijie Yuan
2026-11-15 15:19 ` Yan Zhu
2026-11-15 15:19 ` [PATCH 02/10] docs/zh_CN: add LSM/apparmor " Yan Zhu
2026-11-15 15:19 ` [PATCH 03/10] docs/zh_CN: add LSM/LoadPin " Yan Zhu
2026-11-15 15:20 ` [PATCH 04/10] docs/zh_CN: add LSM/SELinux " Yan Zhu
2026-11-15 15:20 ` [PATCH 05/10] docs/zh_CN: add LSM/Smack " Yan Zhu
2026-11-15 15:20 ` [PATCH 06/10] docs/zh_CN: add LSM/tomoyo " Yan Zhu
2026-11-15 15:20 ` Yan Zhu [this message]
2026-11-15 15:20 ` [PATCH 08/10] docs/zh_CN: add LSM/SafeSetID " Yan Zhu
2026-11-15 15:20 ` [PATCH 09/10] docs/zh_CN: add LSM/ipe " Yan Zhu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tencent_58599B779D476D63C80830EF7C2E66968508@qq.com \
--to=zhuyan2015@qq.com \
--cc=alexs@kernel.org \
--cc=corbet@lwn.net \
--cc=dzm91@hust.edu.cn \
--cc=gnoack@google.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=mic@digikod.net \
--cc=si.yanteng@linux.dev \
--cc=skhan@linuxfoundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox