]> Git Repo - linux.git/commitdiff
Revert "debugfs: inode: debugfs_create_dir uses mode permission from parent"
authorLinus Torvalds <[email protected]>
Wed, 13 Jun 2018 03:52:16 +0000 (20:52 -0700)
committerLinus Torvalds <[email protected]>
Wed, 13 Jun 2018 03:52:16 +0000 (20:52 -0700)
This reverts commit 95cde3c59966f6371b6bcd9e4e2da2ba64ee9775.

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]>
fs/debugfs/inode.c

index a913b12fc7f8db787e7b63a488cfe18733b27212..13b01351dd1cb3f8381dbddd2ee70717792b9ac7 100644 (file)
@@ -512,9 +512,7 @@ struct dentry *debugfs_create_dir(const char *name, struct dentry *parent)
        if (unlikely(!inode))
                return failed_creating(dentry);
 
-       if (!parent)
-               parent = debugfs_mount->mnt_root;
-       inode->i_mode = S_IFDIR | ((d_inode(parent)->i_mode & 0770));
+       inode->i_mode = S_IFDIR | S_IRWXU | S_IRUGO | S_IXUGO;
        inode->i_op = &simple_dir_inode_operations;
        inode->i_fop = &simple_dir_operations;
 
This page took 0.092622 seconds and 4 git commands to generate.