autofs: make disc device user accessible
authorIan Kent <raven@themaw.net>
Fri, 8 Sep 2017 23:16:27 +0000 (16:16 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 9 Sep 2017 01:26:50 +0000 (18:26 -0700)
The autofs miscellanous device ioctls that shouldn't require
CAP_SYS_ADMIN need to be accessible to user space applications in order
to be able to get information about autofs mounts.

The module checks capabilities so the miscelaneous device should be fine
with broad permissions.

Link: http://lkml.kernel.org/r/150216641928.11652.7388977863125547969.stgit@pluto.themaw.net
Signed-off-by: Ian Kent <raven@themaw.net>
Cc: Colin Walters <walters@redhat.com>
Cc: Ondrej Holy <oholy@redhat.com>
Cc: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/autofs4/dev-ioctl.c

index dd9f1bebb5a3a980b55e5d0fb758c93e4f694722..218a4ecc75cc4b849fbecf5565c4772e2cb94e0d 100644 (file)
@@ -733,7 +733,8 @@ static const struct file_operations _dev_ioctl_fops = {
 static struct miscdevice _autofs_dev_ioctl_misc = {
        .minor          = AUTOFS_MINOR,
        .name           = AUTOFS_DEVICE_NAME,
-       .fops           = &_dev_ioctl_fops
+       .fops           = &_dev_ioctl_fops,
+       .mode           = 0644,
 };
 
 MODULE_ALIAS_MISCDEV(AUTOFS_MINOR);