Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/rump/librump/rumpkern Make copyinstr/copyoutstr return E...
details: https://anonhg.NetBSD.org/src/rev/1467f3741a10
branches: trunk
changeset: 788872:1467f3741a10
user: njoly <njoly%NetBSD.org@localhost>
date: Fri Jul 26 16:07:51 2013 +0000
description:
Make copyinstr/copyoutstr return EFAULT for special NULL "user"
address.
Ok pooka@.
diffstat:
sys/rump/librump/rumpkern/rumpcopy.c | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
diffs (40 lines):
diff -r a21d4358e0fa -r 1467f3741a10 sys/rump/librump/rumpkern/rumpcopy.c
--- a/sys/rump/librump/rumpkern/rumpcopy.c Fri Jul 26 05:46:19 2013 +0000
+++ b/sys/rump/librump/rumpkern/rumpcopy.c Fri Jul 26 16:07:51 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rumpcopy.c,v 1.17 2011/01/18 22:21:23 haad Exp $ */
+/* $NetBSD: rumpcopy.c,v 1.18 2013/07/26 16:07:51 njoly Exp $ */
/*
* Copyright (c) 2009 Antti Kantee. All Rights Reserved.
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rumpcopy.c,v 1.17 2011/01/18 22:21:23 haad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rumpcopy.c,v 1.18 2013/07/26 16:07:51 njoly Exp $");
#include <sys/param.h>
#include <sys/lwp.h>
@@ -115,6 +115,10 @@
if (len == 0)
return 0;
+ if (__predict_false(uaddr == NULL)) {
+ return EFAULT;
+ }
+
if (RUMP_LOCALPROC_P(curproc))
return copystr(uaddr, kaddr, len, done);
@@ -144,6 +148,10 @@
size_t slen;
int error;
+ if (__predict_false(uaddr == NULL && len)) {
+ return EFAULT;
+ }
+
if (RUMP_LOCALPROC_P(curproc))
return copystr(kaddr, uaddr, len, done);
Home |
Main Index |
Thread Index |
Old Index