Skip to content

Commit f5b7769

Browse files
committed
Revert "debugfs: inode: debugfs_create_dir uses mode permission from parent"
This reverts commit 95cde3c. The commit had good intentions, but it breaks kvm-tool and qemu-kvm. With it in place, "lkvm run" just fails with Error: KVM_CREATE_VM ioctl Warning: Failed init: kvm__init which isn't a wonderful error message, but bisection pinpointed the problematic commit. The problem is almost certainly due to the special kvm debugfs entries created dynamically by kvm under /sys/kernel/debug/kvm/. See kvm_create_vm_debugfs() Bisected-and-reported-by: Linus Torvalds <[email protected]> Cc: Wanpeng Li <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Thomas Richter <[email protected]> Cc: Kees Cook <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent dbee3d0 commit f5b7769

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

fs/debugfs/inode.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -512,9 +512,7 @@ struct dentry *debugfs_create_dir(const char *name, struct dentry *parent)
512512
if (unlikely(!inode))
513513
return failed_creating(dentry);
514514

515-
if (!parent)
516-
parent = debugfs_mount->mnt_root;
517-
inode->i_mode = S_IFDIR | ((d_inode(parent)->i_mode & 0770));
515+
inode->i_mode = S_IFDIR | S_IRWXU | S_IRUGO | S_IXUGO;
518516
inode->i_op = &simple_dir_inode_operations;
519517
inode->i_fop = &simple_dir_operations;
520518

0 commit comments

Comments
 (0)