[PATCH 0/2] dlm: restrict userspace control devices to CAP_SYS_ADMIN
Haofeng Li <[email protected]> Thu, 16 Jul 2026 15:21:50 +0800
| Newsgroups | dev.linux.lists.gfs2,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
The DLM plock and monitor miscdevices are control interfaces intended for privileged userspace daemons, but neither currently checks the caller's capabilities when the device is opened. devtmpfs creates both device nodes with mode 0600 by default. Relying only on that mode, however, leaves the interfaces unprotected if a node is exposed through a changed udev rule, a container bind mount, or a passed file descriptor. An opener of dlm_plock can consume pending requests and submit forged results. An opener of dlm-monitor can alter the global monitor reference count; the last close stops all local lockspaces. Require CAP_SYS_ADMIN in both open paths and explicitly set the device mode to 0600. The individual patches contain reproduction details for each interface. Haofeng Li (2): dlm: gate dlm_plock device on CAP_SYS_ADMIN dlm: require CAP_SYS_ADMIN for dlm-monitor device fs/dlm/plock.c | 14 +++++++++++++- fs/dlm/user.c | 6 ++++++ 2 files changed, 19 insertions(+), 1 deletion(-) base-commit: a13c140cc289c0b7b3770bce5b3ad42ab35074aa -- 2.25.1