diff options
author | Ian Kent <raven@themaw.net> | 2021-04-18 07:46:36 +0800 |
---|---|---|
committer | Ian Kent <raven@themaw.net> | 2021-04-19 09:36:04 +0800 |
commit | 26a458b14161bc629ae198754e7e6cd2d3c09b9a (patch) | |
tree | 508a87da40d16e851c9be1df55c6b1d24acec496 | |
parent | 90c6a905c94da0bfdb89a0d6f8b54b875dc0c52d (diff) | |
download | autofs-26a458b14161bc629ae198754e7e6cd2d3c09b9a.tar.gz |
autofs-5.1.7 - dont use AUTOFS_DEV_IOCTL_CLOSEMOUNT
Using an ioctl (AUTOFS_DEV_IOCTL_CLOSEMOUNT) to close an autofs mount
file handle can race with copy_to_user() so the file handle needs to
be closed using close(2) instead.
Signed-off-by: Ian Kent <raven@themaw.net>
-rw-r--r-- | CHANGELOG | 1 | ||||
-rw-r--r-- | lib/dev-ioctl-lib.c | 10 |
2 files changed, 2 insertions, 9 deletions
@@ -68,6 +68,7 @@ - add ext_mount_hash_mutex lock helpers. - fix amd section mounts map reload. - fix dandling symlink creation if nis support is not available. +- dont use AUTOFS_DEV_IOCTL_CLOSEMOUNT. 25/01/2021 autofs-5.1.7 - make bind mounts propagation slave by default. diff --git a/lib/dev-ioctl-lib.c b/lib/dev-ioctl-lib.c index e7a1b42a..6b549d73 100644 --- a/lib/dev-ioctl-lib.c +++ b/lib/dev-ioctl-lib.c @@ -404,15 +404,7 @@ err: /* Close */ static int dev_ioctl_close(unsigned int logopt, int ioctlfd) { - struct autofs_dev_ioctl param; - - init_autofs_dev_ioctl(¶m); - param.ioctlfd = ioctlfd; - - if (ioctl(ctl.devfd, AUTOFS_DEV_IOCTL_CLOSEMOUNT, ¶m) == -1) - return -1; - - return 0; + return close(ioctlfd); } static int ioctl_close(unsigned int logopt, int ioctlfd) |