From patchwork Tue Aug 8 04:26:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Kent X-Patchwork-Id: 9886519 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 43FD260352 for ; Tue, 8 Aug 2017 04:36:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3685B2846D for ; Tue, 8 Aug 2017 04:36:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2BA91286FF; Tue, 8 Aug 2017 04:36:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B32472846D for ; Tue, 8 Aug 2017 04:36:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752024AbdHHEgR (ORCPT ); Tue, 8 Aug 2017 00:36:17 -0400 Received: from icp-osb-irony-out3.external.iinet.net.au ([203.59.1.153]:63891 "EHLO icp-osb-irony-out3.external.iinet.net.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751974AbdHHEgO (ORCPT ); Tue, 8 Aug 2017 00:36:14 -0400 X-Greylist: delayed 555 seconds by postgrey-1.27 at vger.kernel.org; Tue, 08 Aug 2017 00:36:11 EDT X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AWAgD0PIlZ/3GhBzpcHAEBBAEBCgEBg1qBeI4PkAc5AQEBAQEGgQgzlgSCEhyFKwKEXD8YAQIBAQEBAQEBayiFGQYjVhAYAQwCGA4CAkcQBhOKIgysEYImIgKLPQEBCCiBC4IdggKBBYJghy+DSIJhBZB0gQ2ODYsliRCLV4Z2lgkfOIEKUy8Kh3AzNocjgkEBAQE X-IPAS-Result: A2AWAgD0PIlZ/3GhBzpcHAEBBAEBCgEBg1qBeI4PkAc5AQEBAQEGgQgzlgSCEhyFKwKEXD8YAQIBAQEBAQEBayiFGQYjVhAYAQwCGA4CAkcQBhOKIgysEYImIgKLPQEBCCiBC4IdggKBBYJghy+DSIJhBZB0gQ2ODYsliRCLV4Z2lgkfOIEKUy8Kh3AzNocjgkEBAQE X-IronPort-AV: E=Sophos;i="5.41,341,1498492800"; d="scan'208";a="411532776" Received: from unknown (HELO pluto.themaw.net) ([58.7.161.113]) by icp-osb-irony-out3.iinet.net.au with ESMTP; 08 Aug 2017 12:26:59 +0800 Subject: [PATCH 2/3] autofs - make disc device user accessible From: Ian Kent To: Andrew Morton Cc: autofs mailing list , Ondrej Holy , Colin Walters , Kernel Mailing List , David Howells , linux-fsdevel Date: Tue, 08 Aug 2017 12:26:59 +0800 Message-ID: <150216641928.11652.7388977863125547969.stgit@pluto.themaw.net> In-Reply-To: <150216641255.11652.4204561328197919771.stgit@pluto.themaw.net> References: <150216641255.11652.4204561328197919771.stgit@pluto.themaw.net> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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. Signed-off-by: Ian Kent Cc: Colin Walters Cc: Ondrej Holy --- fs/autofs4/dev-ioctl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/autofs4/dev-ioctl.c b/fs/autofs4/dev-ioctl.c index dd9f1bebb5a3..218a4ecc75cc 100644 --- a/fs/autofs4/dev-ioctl.c +++ b/fs/autofs4/dev-ioctl.c @@ -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);