v2
2026-11-04
系统映射封存在启动选择 · v2
mseal 系统映射增加 no_mseal_sys_mappings 启动参数,并在 __install_special_mapping 中实现封装且兼容 uprobes。
原始补丁链接
子 Patch(8)
1/8
selftests/mm: Move sysmap_is_sealed into mm
System mapping sealing is an mm feature, but its test has its own directory under tools/testing/selftests rather than living with the other mm tests. Let’s move it into tools/testing/selftests/mm and
2/8
selftests/mm: Skip sysmap_is_sealed when system mappings aren't sealed
Now that sysmap_is_sealed runs with the other mm tests, it also runs on kernels built without CONFIG_MSEAL_SYSTEM_MAPPINGS, where it fails. Userspace can’t tell whether the option is enabled, but a se
3/8
selftests/mm: Test that the seal on system mappings is enforced
sysmap_is_sealed checks that system mappings are marked as sealed in smaps, but not that the seal is actually enforced. The rest of this series changes how system mappings get sealed, so let’s make su
4/8
mm/mseal: Move MSEAL_SYSTEM_MAPPINGS to mm/Kconfig
MSEAL_SYSTEM_MAPPINGS is in security/Kconfig, but it’s an mm feature, it’s implemented in mm, and changes to it need to go past mm. Let’s move it to mm/Kconfig, next to the other VMA features. No fun
5/8
uprobes/x86: Leave sealed trampolines in place on optimisation failure
If swbp_optimize() fails, __arch_uprobe_optimize() unmaps the trampoline it has just created. The next patch seals all special mappings when CONFIG_MSEAL_SYSTEM_MAPPINGS is enabled, which includes upr
6/8
mm/mseal: Seal system mappings in __install_special_mapping()
VM_SEALED_SYSMAP isn’t really a VMA flag, it’s an alias for VM_SEALED or VM_NONE depending on CONFIG_MSEAL_SYSTEM_MAPPINGS. Every caller of _install_special_mapping() on an architecture which supports
7/8
mm/mseal: Add no_mseal_sys_mappings boot parameter
CONFIG_MSEAL_SYSTEM_MAPPINGS seals each process’ system mappings, such as the vDSO, when they are created. These are read-only or execute-only mappings which every process trusts, so sealing them mean
8/8
selftests/mm: Check that no_mseal_sys_mappings unseals system mappings
Booting with no_mseal_sys_mappings currently makes check_sealed skip and expect_sealed fail, so nothing checks that the parameter actually turns sealing off. So let’s check /proc/cmdline for it, and