From: akpm@linux-foundation.org Subject: [patch 100/126] autofs: make disc device user accessible Date: Fri, 08 Sep 2017 16:16:27 -0700 Message-ID: <20170908231627.IYVmMElmR%akpm@linux-foundation.org> Reply-To: linux-kernel@vger.kernel.org Return-path: Received: from mail.linuxfoundation.org ([140.211.169.12]:53406 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757210AbdIHXQ2 (ORCPT ); Fri, 8 Sep 2017 19:16:28 -0400 Sender: mm-commits-owner@vger.kernel.org List-Id: mm-commits@vger.kernel.org To: akpm@linux-foundation.org, dhowells@redhat.com, mm-commits@vger.kernel.org, oholy@redhat.com, raven@themaw.net, torvalds@linux-foundation.org, walters@redhat.com From: Ian Kent Subject: autofs: make disc device user accessible 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 Cc: Colin Walters Cc: Ondrej Holy Cc: David Howells Signed-off-by: Andrew Morton --- fs/autofs4/dev-ioctl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff -puN fs/autofs4/dev-ioctl.c~autofs-make-disc-device-user-accessible fs/autofs4/dev-ioctl.c --- a/fs/autofs4/dev-ioctl.c~autofs-make-disc-device-user-accessible +++ a/fs/autofs4/dev-ioctl.c @@ -733,7 +733,8 @@ static const struct file_operations _dev 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); _