Module Name:    src
Committed By:   christos
Date:           Sat May 14 17:04:10 UTC 2016

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

Log Message:
only print debugging info if we are actually going to change the permission.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/kern/kern_pax.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_pax.c
diff -u src/sys/kern/kern_pax.c:1.44 src/sys/kern/kern_pax.c:1.45
--- src/sys/kern/kern_pax.c:1.44	Fri May 13 13:33:43 2016
+++ src/sys/kern/kern_pax.c	Sat May 14 13:04:09 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_pax.c,v 1.44 2016/05/13 17:33:43 christos Exp $	*/
+/*	$NetBSD: kern_pax.c,v 1.45 2016/05/14 17:04:09 christos Exp $	*/
 
 /*
  * Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_pax.c,v 1.44 2016/05/13 17:33:43 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_pax.c,v 1.45 2016/05/14 17:04:09 christos Exp $");
 
 #include "opt_pax.h"
 
@@ -411,7 +411,7 @@ pax_mprotect_adjust(
 	if ((*prot & (VM_PROT_WRITE|VM_PROT_EXECUTE)) != VM_PROT_EXECUTE) {
 #ifdef PAX_MPROTECT_DEBUG
 		struct proc *p = l->l_proc;
-		if (pax_mprotect_debug) {
+		if ((*prot & VM_PROT_EXECUTE) && pax_mprotect_debug) {
 			printf("%s: %s,%zu: %d.%d (%s): -x\n",
 			    __func__, file, line,
 			    p->p_pid, l->l_lid, p->p_comm);
@@ -422,7 +422,7 @@ pax_mprotect_adjust(
 	} else {
 #ifdef PAX_MPROTECT_DEBUG
 		struct proc *p = l->l_proc;
-		if (pax_mprotect_debug) {
+		if ((*prot & VM_PROT_WRITE) && pax_mprotect_debug) {
 			printf("%s: %s,%zu: %d.%d (%s): -w\n",
 			    __func__, file, line,
 			    p->p_pid, l->l_lid, p->p_comm);

Reply via email to