diff options
author | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2017-10-12 15:04:34 +0000 |
---|---|---|
committer | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2017-10-12 15:04:34 +0000 |
commit | 4a3ec5c1272c33883087c30cab8513605224b0d2 (patch) | |
tree | 9b95cb890ce87d4ae482413bb9340e9c665e4cdf /sys/kern | |
parent | 204c288b2993fdfea4f691880e78c53f59e3fada (diff) |
Print the word pledge in the kernel log when there is a violation.
This should make it easier to figure out what is going on. Note
that the pledgecode it shows is only a guess which pledge(2) might
help.
OK deraadt@ semarie@
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_pledge.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/kern_pledge.c b/sys/kern/kern_pledge.c index 7cf81613b47..4a5541db373 100644 --- a/sys/kern/kern_pledge.c +++ b/sys/kern/kern_pledge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_pledge.c,v 1.222 2017/10/07 06:06:26 deraadt Exp $ */ +/* $OpenBSD: kern_pledge.c,v 1.223 2017/10/12 15:04:33 bluhm Exp $ */ /* * Copyright (c) 2015 Nicholas Marriott <nicm@openbsd.org> @@ -489,8 +489,8 @@ pledge_fail(struct proc *p, int error, uint64_t code) codes = pledgenames[i].name; break; } - log(LOG_ERR, "%s(%d): syscall %d \"%s\"\n", - p->p_p->ps_comm, p->p_p->ps_pid, p->p_pledge_syscall, codes); + log(LOG_ERR, "%s[%d]: pledge \"%s\", syscall %d\n", + p->p_p->ps_comm, p->p_p->ps_pid, codes, p->p_pledge_syscall); p->p_p->ps_acflag |= APLEDGE; #ifdef KTRACE if (KTRPOINT(p, KTR_PLEDGE)) |