summaryrefslogtreecommitdiffstats
path: root/sys/isofs
diff options
context:
space:
mode:
authorbluhm <bluhm@openbsd.org>2016-03-27 11:39:37 +0000
committerbluhm <bluhm@openbsd.org>2016-03-27 11:39:37 +0000
commit4b1ae25e417844a3151b9680b90b3d8d5e1d6e5a (patch)
treed52d30ea0a0e012a8f1a6926c55ddfe965adc8f1 /sys/isofs
parentRename session_socket_blockmode() to session_socket_nonblockmode(), (diff)
downloadwireguard-openbsd-4b1ae25e417844a3151b9680b90b3d8d5e1d6e5a.tar.xz
wireguard-openbsd-4b1ae25e417844a3151b9680b90b3d8d5e1d6e5a.zip
When pulling and unmounting an umass USB stick, the file system
could end up in an inconsistent state. The fstype dependent mp->mnt_data was NULL, but the general mp was still listed as a valid mount point. Next access to the file system would crash with a NULL pointer dereference. If closing the device fails, the mount point must go away anyway. There is nothing we can do about it. Remove the workaround for the EIO error in the general unmount code, but do not generate any error in the file system specific unmount functions. OK natano@ beck@
Diffstat (limited to 'sys/isofs')
-rw-r--r--sys/isofs/cd9660/cd9660_vfsops.c6
-rw-r--r--sys/isofs/udf/udf_vfsops.c6
2 files changed, 5 insertions, 7 deletions
diff --git a/sys/isofs/cd9660/cd9660_vfsops.c b/sys/isofs/cd9660/cd9660_vfsops.c
index f1fcac5f3e4..43f612f0418 100644
--- a/sys/isofs/cd9660/cd9660_vfsops.c
+++ b/sys/isofs/cd9660/cd9660_vfsops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cd9660_vfsops.c,v 1.76 2016/03/19 12:04:15 natano Exp $ */
+/* $OpenBSD: cd9660_vfsops.c,v 1.77 2016/03/27 11:39:37 bluhm Exp $ */
/* $NetBSD: cd9660_vfsops.c,v 1.26 1997/06/13 15:38:58 pk Exp $ */
/*-
@@ -585,12 +585,12 @@ cd9660_unmount(mp, mntflags, p)
isomp->im_devvp->v_specmountpoint = NULL;
vn_lock(isomp->im_devvp, LK_EXCLUSIVE | LK_RETRY, p);
- error = VOP_CLOSE(isomp->im_devvp, FREAD, NOCRED, p);
+ (void)VOP_CLOSE(isomp->im_devvp, FREAD, NOCRED, p);
vput(isomp->im_devvp);
free((caddr_t)isomp, M_ISOFSMNT, 0);
mp->mnt_data = NULL;
mp->mnt_flag &= ~MNT_LOCAL;
- return (error);
+ return (0);
}
/*
diff --git a/sys/isofs/udf/udf_vfsops.c b/sys/isofs/udf/udf_vfsops.c
index 88a4dd3d7ee..aad3ccf17fe 100644
--- a/sys/isofs/udf/udf_vfsops.c
+++ b/sys/isofs/udf/udf_vfsops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: udf_vfsops.c,v 1.48 2016/03/19 12:04:15 natano Exp $ */
+/* $OpenBSD: udf_vfsops.c,v 1.49 2016/03/27 11:39:37 bluhm Exp $ */
/*
* Copyright (c) 2001, 2002 Scott Long <scottl@freebsd.org>
@@ -476,10 +476,8 @@ udf_unmount(struct mount *mp, int mntflags, struct proc *p)
vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, p);
vinvalbuf(devvp, V_SAVE, NOCRED, p, 0, 0);
- error = VOP_CLOSE(devvp, FREAD, NOCRED, p);
+ (void)VOP_CLOSE(devvp, FREAD, NOCRED, p);
VOP_UNLOCK(devvp, p);
- if (error)
- return (error);
devvp->v_specmountpoint = NULL;
vrele(devvp);