Module Name: src
Committed By: pooka
Date: Tue Sep 29 11:17:00 UTC 2009
Modified Files:
src/lib/libukfs: ukfs.c
Log Message:
Give rump_sys_unmount() in ukfs_release() a curlwp context. This
prevents use-after-free and should fix crashy cases reported by
Arnaud Ysmal.
To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/lib/libukfs/ukfs.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/lib/libukfs/ukfs.c
diff -u src/lib/libukfs/ukfs.c:1.35 src/lib/libukfs/ukfs.c:1.36
--- src/lib/libukfs/ukfs.c:1.35 Tue Aug 4 12:37:14 2009
+++ src/lib/libukfs/ukfs.c Tue Sep 29 11:17:00 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: ukfs.c,v 1.35 2009/08/04 12:37:14 pooka Exp $ */
+/* $NetBSD: ukfs.c,v 1.36 2009/09/29 11:17:00 pooka Exp $ */
/*
* Copyright (c) 2007, 2008 Antti Kantee. All Rights Reserved.
@@ -308,7 +308,9 @@
mntflag = 0;
if (flags & UKFS_RELFLAG_FORCE)
mntflag = MNT_FORCE;
+ rump_setup_curlwp(nextpid(fs), 1, 1);
rv = rump_sys_unmount(fs->ukfs_mountpath, mntflag);
+ rump_clear_curlwp();
if (rv) {
ukfs_chdir(fs, fs->ukfs_mountpath);
errno = rv;