Skip to contentSkip to conversation

autofs-make-dev-ioctl-version-and-ismountpoint-user-accessible.patch removed from -mm tree

merged [email protected] 1 participant 1 message Sep 11, 2017

lore
Share & tools
lore

[email protected]

author tree notice Applied
#0 lore raw

The patch titled
Subject: autofs: make dev ioctl version and ismountpoint user accessible
has been removed from the -mm tree. Its filename was
autofs-make-dev-ioctl-version-and-ismountpoint-user-accessible.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Ian Kent <[email protected]>
Subject: autofs: make dev ioctl version and ismountpoint user accessible

Some of the autofs miscellaneous device ioctls need to be accessable to user space applications without CAP_SYS_ADMIN to get information about autofs mounts.

---

 fs/autofs4/dev-ioctl.c              |   12 ++++++++----
 include/uapi/linux/auto_dev-ioctl.h |    2 +-
 2 files changed, 9 insertions(+), 5 deletions(-)
fs/autofs4/dev-ioctl.c renamed from fs/autofs4/dev-ioctl.c~autofs-make-dev-ioctl-version-and-ismountpoint-user-accessible +8 -4
diff -puN fs/autofs4/dev-ioctl.c~autofs-make-dev-ioctl-version-and-ismountpoint-user-accessible fs/autofs4/dev-ioctl.c
@@ -628,10 +628,6 @@ static int _autofs_dev_ioctl(unsigned in
 	ioctl_fn fn = NULL;
 	int err = 0;
 
-	/* only root can play with this */
-	if (!capable(CAP_SYS_ADMIN))
-		return -EPERM;
-
 	cmd_first = _IOC_NR(AUTOFS_DEV_IOCTL_IOC_FIRST);
 	cmd = _IOC_NR(command);
 
@@ -640,6 +636,14 @@ static int _autofs_dev_ioctl(unsigned in
 		return -ENOTTY;
 	}
 
+	/* Only root can use ioctls other than AUTOFS_DEV_IOCTL_VERSION_CMD
+	 * and AUTOFS_DEV_IOCTL_ISMOUNTPOINT_CMD
+	 */
+	if (cmd != AUTOFS_DEV_IOCTL_VERSION_CMD &&
+	    cmd != AUTOFS_DEV_IOCTL_ISMOUNTPOINT_CMD &&
+	    !capable(CAP_SYS_ADMIN))
+		return -EPERM;
+
 	/* Copy the parameters into kernel space. */
 	param = copy_dev_ioctl(user);
 	if (IS_ERR(param))
include/uapi/linux/auto_dev-ioctl.h renamed from include/uapi/linux/auto_dev-ioctl.h~autofs-make-dev-ioctl-version-and-ismountpoint-user-accessible +1 -1
diff -puN include/uapi/linux/auto_dev-ioctl.h~autofs-make-dev-ioctl-version-and-ismountpoint-user-accessible include/uapi/linux/auto_dev-ioctl.h
@@ -16,7 +16,7 @@
 #define AUTOFS_DEVICE_NAME		"autofs"
 
 #define AUTOFS_DEV_IOCTL_VERSION_MAJOR	1
-#define AUTOFS_DEV_IOCTL_VERSION_MINOR	0
+#define AUTOFS_DEV_IOCTL_VERSION_MINOR	1
 
 #define AUTOFS_DEV_IOCTL_SIZE		sizeof(struct autofs_dev_ioctl)
 

_

Patches currently in -mm which might be from [email protected] are