From: deraadt Date: Mon, 13 Aug 2018 20:31:38 +0000 (+0000) Subject: The first panic in pledge_namei should only be for ni_pledge == 0 X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=ee41fe2bb2c8bc9d81f39d8aac0222e6dcd3bf74;p=openbsd The first panic in pledge_namei should only be for ni_pledge == 0 (the other cause is implausible, and crashes with a nice *NULL) --- diff --git a/sys/kern/kern_pledge.c b/sys/kern/kern_pledge.c index 546d9389ad4..659e789ba45 100644 --- a/sys/kern/kern_pledge.c +++ b/sys/kern/kern_pledge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_pledge.c,v 1.240 2018/08/11 16:16:07 beck Exp $ */ +/* $OpenBSD: kern_pledge.c,v 1.241 2018/08/13 20:31:38 deraadt Exp $ */ /* * Copyright (c) 2015 Nicholas Marriott @@ -568,8 +568,8 @@ pledge_namei(struct proc *p, struct nameidata *ni, char *origpath) (p->p_p->ps_flags & PS_COREDUMP)) return (0); - if (!ni || (ni->ni_pledge == 0)) - panic("ni_pledge"); + if (ni->ni_pledge == 0) + panic("pledge_namei: ni_pledge"); /* * We set the BYPASSUNVEIL flag to skip unveil checks