Skip to content

Commit c1aa819

Browse files
oberpargregkh
authored andcommitted
s390/hypfs: Enable limited access during lockdown
[ Upstream 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 972d840 commit c1aa819

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

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)