Documentation/translations/zh_CN/security/landlock.rst
Source file repositories/reference/linux-study-clean/Documentation/translations/zh_CN/security/landlock.rst
File Facts
- System
- Linux kernel
- Corpus path
Documentation/translations/zh_CN/security/landlock.rst- Extension
.rst- Size
- 5083 bytes
- Lines
- 124
- Domain
- Support Tooling And Documentation
- Bucket
- Documentation
- Inferred role
- Support Tooling And Documentation: documentation
- Status
- atlas-only
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
- No top-level syscall, struct, function, initcall, or export declaration detected by the generator.
Annotated Snippet
.. SPDX-License-Identifier: GPL-2.0
.. Copyright ? 2017-2020 Micka?l Salaün <mic@digikod.net>
.. Copyright ? 2019-2020 ANSSI
.. include:: ../disclaimer-zh_CN.rst
:Original: Documentation/security/landlock.rst
:翻译:
毛玉贤 Yuxian Mao <maoyuxian@cqsoftware.com.cn>
======================
Landlock LSM: 内核文档
======================
:作者: Mickaël Salaün
:日期: 2022年12月
Landlock的目标是创建有范围的访问控制(即沙箱机制)。为了增强整个
系统的安全性,此功能应适用于任何进程,包括非特权进程。因为这些进
程可能被攻击或植入后门(即不可信任的),所以从内核和其他进程的角
度来看,Landlock的功能必须安全可用。因此,Landlock 的接口设计应当
尽量减少可能的攻击点。
Landlock 旨在为非特权进程使用,同时遵循由其他访问控制机制(例如 DAC、LSM)
强制执行的系统安全策略。Landlock 规则不应与系统上强制执行的其他访问
控制相冲突,而只能添加额外的限制。
任何用户都可以在其进程上强制执行Landlock规则集。这些规则集会以一种
确保只能添加更多约束的方式与继承的规则集合并和评估。
用户空间文档如下:
Documentation/userspace-api/landlock.rst.
安全访问控制机制指导原则
========================
* Landlock规则应侧重于对内核对象的访问控制,而非系统调用过滤(即
系统调用参数),后者是seccomp-bpf要侧重的。
* 为了避免多种侧信道攻击(例如安全策略泄露、基于CPU的攻击),Landlock
规则不应与用户空间进行程序化通信。
* 内核访问检查不应降低未沙盒化进程的访问请求速度。
* 与 Landlock 操作相关的计算(例如强制执行规则集)应仅影响请求这些
操作的进程。
* 由沙盒化进程直接从内核中获得的资源(例如文件描述符)在被任何进程
使用时,都应保留其获取时的作用域访问权限。
Cf. `文件描述符访问权限`_.
设计选择
========
inode访问权限
-------------
所有访问权限都与inode以及通过inode所访问到的内容相关。读取目录的
内容并不意味着有权读取该目录中列出的 inode 所对应文件的内容。实际
上,文件名是相对于其父目录而言的 ,一个 inode 可以通过多个文件名
(通过硬链接)来引用。删除文件链接这一操作仅直接影响对应目录,而
对被移除链接的inode并无影响。这就是“LANDLOCK_ACCESS_FS_REMOVE_FILE”
(文件系统移除文件访问权限)或“LANDLOCK_ACCESS_FS_REFER” (文件系
统引用访问权限)不能与文件绑定,而只能与目录绑定的原因。
文件描述符访问权限
------------------
在打开文件时,会检查访问权限并将其与文件描述符绑定。其基本原则是,
当在相同的 Landlock 域下执行时,等效的操作序列会产生相同的结果。
以LANDLOCK_ACCESS_FS_TRUNCATE权限为例,如果相关的文件层次结构没有
授予该访问权限,那么可能允许打开一个文件进行写操作,但不允许使用
Annotation
- Atlas domain: Support Tooling And Documentation / Documentation.
- Implementation status: atlas-only.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.