summaryrefslogtreecommitdiffstats
path: root/sys/compat
diff options
context:
space:
mode:
authorgreen <green@FreeBSD.org>1999-08-07 05:33:35 +0000
committergreen <green@FreeBSD.org>1999-08-07 05:33:35 +0000
commitd0cd16077589e3d718b061c8ef94b00f7288123b (patch)
tree5adf4cae75aa13b0a25799f339f6577c1bd3e1e6 /sys/compat
parenta5df34bc5f92340902af4148b282bece258710c3 (diff)
downloadFreeBSD-src-d0cd16077589e3d718b061c8ef94b00f7288123b.zip
FreeBSD-src-d0cd16077589e3d718b061c8ef94b00f7288123b.tar.gz
We don't end up checking for a return value of EFAULT from the copyinstr()
in the pathname translation procedure. This proves fatal, and can be easily fixed. This or a similar change needs to be committed to svr4_util.h and ibcs2_util.h. I will update ibcs2_util.h, if noone else thinks of a better way to do this, in the same manner. I will leave svr4 to the respective maintainer. This closes the problem of the only crash I've been able to produce as a user recently, except for (currently not-in-the-source tree) fd table sharing fixes. Thanks goes to pho for his stress-testers.
Diffstat (limited to 'sys/compat')
-rw-r--r--sys/compat/linux/linux_util.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/sys/compat/linux/linux_util.h b/sys/compat/linux/linux_util.h
index 07a2d3c..2905f00 100644
--- a/sys/compat/linux/linux_util.h
+++ b/sys/compat/linux/linux_util.h
@@ -28,7 +28,7 @@
*
* from: svr4_util.h,v 1.5 1994/11/18 02:54:31 christos Exp
* from: linux_util.h,v 1.2 1995/03/05 23:23:50 fvdl Exp
- * $Id: linux_util.h,v 1.6 1998/06/30 08:40:33 jmg Exp $
+ * $Id: linux_util.h,v 1.7 1998/12/16 16:28:57 bde Exp $
*/
/*
@@ -83,10 +83,17 @@ stackgap_alloc(sgp, sz)
int linux_emul_find __P((struct proc *, caddr_t *, const char *, char *,
char **, int));
-#define CHECKALTEXIST(p, sgp, path) \
- linux_emul_find(p, sgp, linux_emul_path, path, &(path), 0)
+#define CHECKALT(p, sgp, path, i) \
+ do { \
+ int _error; \
+ \
+ _error = linux_emul_find(p, sgp, linux_emul_path, path, \
+ &path, i); \
+ if (_error == EFAULT) \
+ return (_error); \
+ } while (0)
-#define CHECKALTCREAT(p, sgp, path) \
- linux_emul_find(p, sgp, linux_emul_path, path, &(path), 1)
+#define CHECKALTEXIST(p, sgp, path) CHECKALT(p, sgp, path, 0)
+#define CHECKALTCREAT(p, sgp, path) CHECKALT(p, sgp, path, 1)
#endif /* !_LINUX_UTIL_H_ */
OpenPOWER on IntegriCloud