Skip to content

Commit 81092f8

Browse files
committed
s390/hypfs: Enable limited access during lockdown
jira KERNEL-216 Rebuild_History Non-Buildable kernel-5.14.0-611.9.1.el9_7 commit-author Peter Oberparleiter <oberpar@linux.ibm.com> commit 3868f91 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 <meted@linux.ibm.com> Reviewed-by: Vasily Gorbik <gor@linux.ibm.com> Fixes: 5496197 ("debugfs: Restrict debugfs when the kernel is locked down") Signed-off-by: Peter Oberparleiter <oberpar@linux.ibm.com> Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com> (cherry picked from commit 3868f91) Signed-off-by: Jonathan Maple <jmaple@ciq.com>
1 parent ec7eb12 commit 81092f8

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 <holzheu@linux.vnet.ibm.com>
77
*/
88

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

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

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

0 commit comments

Comments
 (0)