Module Name:    src
Committed By:   maxv
Date:           Fri Feb 23 19:43:08 UTC 2018

Modified Files:
        src/sys/kern: kern_exec.c

Log Message:
Fix off-by-one, we don't want the entry point to equal the maximum
address.


To generate a diff of this commit:
cvs rdiff -u -r1.455 -r1.456 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.455 src/sys/kern/kern_exec.c:1.456
--- src/sys/kern/kern_exec.c:1.455	Tue Jan  9 20:55:43 2018
+++ src/sys/kern/kern_exec.c	Fri Feb 23 19:43:08 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_exec.c,v 1.455 2018/01/09 20:55:43 maya Exp $	*/
+/*	$NetBSD: kern_exec.c,v 1.456 2018/02/23 19:43:08 maxv 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.455 2018/01/09 20:55:43 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.456 2018/02/23 19:43:08 maxv Exp $");
 
 #include "opt_exec.h"
 #include "opt_execfmt.h"
@@ -430,10 +430,10 @@ check_exec(struct lwp *l, struct exec_pa
 
 		if (!newerror) {
 			/* Seems ok: check that entry point is not too high */
-			if (epp->ep_entry > epp->ep_vm_maxaddr) {
+			if (epp->ep_entry >= epp->ep_vm_maxaddr) {
 #ifdef DIAGNOSTIC
 				printf("%s: rejecting %p due to "
-				    "too high entry address (> %p)\n",
+				    "too high entry address (>= %p)\n",
 					 __func__, (void *)epp->ep_entry,
 					 (void *)epp->ep_vm_maxaddr);
 #endif

Reply via email to