Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern Add some diagnostic printf's when we reset permissi...



details:   https://anonhg.NetBSD.org/src/rev/325491821259
branches:  trunk
changeset: 814703:325491821259
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Apr 04 16:47:39 2016 +0000

description:
Add some diagnostic printf's when we reset permissions.

diffstat:

 sys/kern/kern_pax.c |  14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diffs (38 lines):

diff -r 4aeb73ee0d94 -r 325491821259 sys/kern/kern_pax.c
--- a/sys/kern/kern_pax.c       Mon Apr 04 15:52:56 2016 +0000
+++ b/sys/kern/kern_pax.c       Mon Apr 04 16:47:39 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_pax.c,v 1.36 2016/03/20 16:39:36 christos Exp $   */
+/*     $NetBSD: kern_pax.c,v 1.37 2016/04/04 16:47:39 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.36 2016/03/20 16:39:36 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_pax.c,v 1.37 2016/04/04 16:47:39 christos Exp $");
 
 #include "opt_pax.h"
 
@@ -363,9 +363,19 @@
                return;
 
        if ((*prot & (VM_PROT_WRITE|VM_PROT_EXECUTE)) != VM_PROT_EXECUTE) {
+#ifdef DIAGNOSTIC
+               struct proc *p = l->l_proc;
+               printf("%s: %d.%d (%s): clearing execute bit\n", __func__,
+                   p->p_pid, l->l_lid, p->p_comm);
+#endif
                *prot &= ~VM_PROT_EXECUTE;
                *maxprot &= ~VM_PROT_EXECUTE;
        } else {
+#ifdef DIAGNOSTIC
+               struct proc *p = l->l_proc;
+               printf("%s: %d.%d (%s): clearing write bit\n", __func__,
+                   p->p_pid, l->l_lid, p->p_comm);
+#endif
                *prot &= ~VM_PROT_WRITE;
                *maxprot &= ~VM_PROT_WRITE;
        }



Home | Main Index | Thread Index | Old Index