From 3501c2db69755857fc2bc936b7f84ba74deb8d22 Mon Sep 17 00:00:00 2001 From: groveer Date: Wed, 11 Nov 2026 14:51:02 +0800 Subject: [PATCH] fix: keep ddm in the init mount namespace MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. ProtectKernelModules and PrivateIPC both make systemd create a private (slave) mount namespace for the unit: the former hides /usr/lib/modules, the latter needs its own mqueuefs on /dev/mqueue. Every child of ddm inherits that namespace, so mounts made in the PAM session stage, such as the dlnfs long-file-name mount, never propagate to the rest of the system. lightdm.service sets neither option and runs in the init namespace. ProtectClock only installs a seccomp filter and is kept. Log: Fix dlnfs mounts made during login being invisible to the desktop Influence: 1. Enable the long-file-name feature, log in through ddm and check that findmnt shows the dlnfs mount on the home directory 2. Verify the mount is visible to a newly started desktop application 3. Verify readlink /proc/$(pgrep -x ddm)/ns/mnt equals /proc/1/ns/mnt 4. Check that modprobe and pam_mount style mounts work inside a session fix: 让 ddm 运行在 init 挂载命名空间,与 lightdm 保持一致 1. ProtectKernelModules 和 PrivateIPC 都会让 systemd 为 unit 创建私有 (slave)挂载命名空间:前者把 /usr/lib/modules 隐藏,后者需要在 /dev/mqueue 上挂自己的 mqueuefs。ddm 的所有子进程都继承该命名空间, 于是在 PAM session 阶段做的挂载(如 dlnfs 长文件名挂载)不会传播到 系统其它部分。lightdm.service 没有这两个选项,运行在 init 命名空间。 ProtectClock 只安装 seccomp 过滤,故保留 Log: 修复登录时挂载的 dlnfs 文件系统对桌面应用不可见的问题 Influence: 1. 开启长文件名功能后用 ddm 登录,确认 findmnt 能看到主目录上的 dlnfs 挂载 2. 确认新启动的桌面应用能访问该挂载 3. 确认 readlink /proc/$(pgrep -x ddm)/ns/mnt 与 /proc/1/ns/mnt 相同 4. 确认会话内 modprobe 及 pam_mount 类挂载正常 PMS: BUG-346181 --- services/ddm.service.in | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/services/ddm.service.in b/services/ddm.service.in index ea254d6..af44ae1 100644 --- a/services/ddm.service.in +++ b/services/ddm.service.in @@ -21,9 +21,16 @@ CPUWeight=10000 IOWeight=10000 IOSchedulingClass=best-effort IOSchedulingPriority=0 -PrivateIPC=true + +# PrivateIPC and ProtectKernelModules are deliberately disabled: both make +# systemd create a private (slave) mount namespace for this unit (one for its +# own mqueuefs on /dev/mqueue, the other to hide /usr/lib/modules), and every +# session process inherits it. Mounts made in the PAM session stage, such as +# the dlnfs long-file-name mount, then never propagate to the rest of the +# system, so desktop applications cannot see them. +#PrivateIPC=true ProtectClock=true -ProtectKernelModules=true +#ProtectKernelModules=true [Install] Alias=display-manager.service