Module Name: src Committed By: christos Date: Mon Apr 4 16:47:39 UTC 2016
Modified Files: src/sys/kern: kern_pax.c Log Message: Add some diagnostic printf's when we reset permissions. To generate a diff of this commit: cvs rdiff -u -r1.36 -r1.37 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.36 src/sys/kern/kern_pax.c:1.37 --- src/sys/kern/kern_pax.c:1.36 Sun Mar 20 12:39:36 2016 +++ src/sys/kern/kern_pax.c Mon Apr 4 12:47:39 2016 @@ -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 @@ pax_mprotect(struct lwp *l, vm_prot_t *p 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; }