Module Name: src
Committed By: reinoud
Date: Fri Aug 26 09:29:17 UTC 2011
Modified Files:
src/sys/kern: kern_exec.c
Log Message:
Provide a better fix for the checks
To generate a diff of this commit:
cvs rdiff -u -r1.322 -r1.323 src/sys/kern/kern_exec.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/kern/kern_exec.c
diff -u src/sys/kern/kern_exec.c:1.322 src/sys/kern/kern_exec.c:1.323
--- src/sys/kern/kern_exec.c:1.322 Fri Aug 26 09:13:08 2011
+++ src/sys/kern/kern_exec.c Fri Aug 26 09:29:16 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_exec.c,v 1.322 2011/08/26 09:13:08 reinoud Exp $ */
+/* $NetBSD: kern_exec.c,v 1.323 2011/08/26 09:29:16 reinoud Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.322 2011/08/26 09:13:08 reinoud Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.323 2011/08/26 09:29:16 reinoud Exp $");
#include "opt_ktrace.h"
#include "opt_modular.h"
@@ -371,33 +371,31 @@
if (!newerror) {
/* Seems ok: check that entry point is not too high */
- if (epp->ep_entry > VM_MAXUSER_ADDRESS) {
+ if (epp->ep_entry > epp->ep_vm_maxaddr) {
#ifdef DIAGNOSTIC
- printf("check_exec: rejecting due to "
- "too high entry address\n");
+ printf("%s: rejecting due to "
+ "too high entry address\n", __func__);
#endif
error = ENOEXEC;
break;
}
-#ifdef VM_CHECK_MIN_ADDRESS
/* Seems ok: check that entry point is not too low */
- if (epp->ep_entry < VM_MIN_ADDRESS) {
+ if (epp->ep_entry < epp->ep_vm_minaddr) {
#ifdef DIAGNOSTIC
- printf("check_exec: rejecting due to "
- "too low entry address\n");
+ printf("%s: rejecting due to "
+ "too low entry address\n", __func__);
#endif
error = ENOEXEC;
break;
}
-#endif
/* check limits */
if ((epp->ep_tsize > MAXTSIZ) ||
(epp->ep_dsize > (u_quad_t)l->l_proc->p_rlimit
[RLIMIT_DATA].rlim_cur)) {
#ifdef DIAGNOSTIC
- printf("check_exec: rejecting due to "
- "limits\n");
+ printf("%s: rejecting due to "
+ "limits\n", __func__);
#endif
error = ENOMEM;
break;