Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f5b7769e authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Revert "debugfs: inode: debugfs_create_dir uses mode permission from parent"



This reverts commit 95cde3c5.

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: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Cc: Wanpeng Li <kernellwp@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Thomas Richter <tmricht@linux.ibm.com>
Cc: Kees Cook <keescook@chromium.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent dbee3d02
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -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;