Skip to content

Commit 3868f91

Browse files
oberparAlexander Gordeev
authored andcommitted
s390/hypfs: Enable limited access during lockdown
When kernel lockdown is active, debugfs_locked_down() blocks access to hypfs files that register ioctl callbacks, even if the ioctl interface is not required for a function. This unnecessarily breaks userspace tools that only rely on read operations. Resolve this by registering a minimal set of file operations during lockdown, avoiding ioctl registration and preserving access for affected tooling. Note that this change restores hypfs functionality when lockdown is active from early boot (e.g. via lockdown=integrity kernel parameter), but does not apply to scenarios where lockdown is enabled dynamically while Linux is running. Tested-by: Mete Durlu <[email protected]> Reviewed-by: Vasily Gorbik <[email protected]> Fixes: 5496197 ("debugfs: Restrict debugfs when the kernel is locked down") Signed-off-by: Peter Oberparleiter <[email protected]> Signed-off-by: Alexander Gordeev <[email protected]>
1 parent fec7bdf commit 3868f91

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

arch/s390/hypfs/hypfs_dbfs.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* Author(s): Michael Holzheu <[email protected]>
77
*/
88

9+
#include <linux/security.h>
910
#include <linux/slab.h>
1011
#include "hypfs.h"
1112

@@ -84,7 +85,7 @@ void hypfs_dbfs_create_file(struct hypfs_dbfs_file *df)
8485
{
8586
const struct file_operations *fops = &dbfs_ops;
8687

87-
if (df->unlocked_ioctl)
88+
if (df->unlocked_ioctl && !security_locked_down(LOCKDOWN_DEBUGFS))
8889
fops = &dbfs_ops_ioctl;
8990
df->dentry = debugfs_create_file(df->name, 0400, dbfs_dir, df, fops);
9091
mutex_init(&df->lock);

0 commit comments

Comments
 (0)