diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-11-02 15:33:41 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-11-02 15:33:41 +0000 |
commit | 750e29e0f675c40a0342d2c01f64a9274b993680 (patch) | |
tree | 5cb952607ad393cbf7051a9dc92e0a76fedfbdf9 /sys/kern | |
parent | ed56f60751b67f892583c70b725e4c063422a403 (diff) |
also handle the kill(self) case for threads; from Theo Buehler
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_pledge.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/kern_pledge.c b/sys/kern/kern_pledge.c index 85c5be6c962..95d090a049b 100644 --- a/sys/kern/kern_pledge.c +++ b/sys/kern/kern_pledge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_pledge.c,v 1.97 2015/11/01 19:03:33 semarie Exp $ */ +/* $OpenBSD: kern_pledge.c,v 1.98 2015/11/02 15:33:40 deraadt Exp $ */ /* * Copyright (c) 2015 Nicholas Marriott <nicm@openbsd.org> @@ -1355,7 +1355,7 @@ pledge_kill(struct proc *p, pid_t pid) return 0; if (p->p_p->ps_pledge & PLEDGE_PROC) return 0; - if (pid == 0 || pid == p->p_pid) + if (pid == 0 || pid == p->p_pid || pid == p->p_pid + THREAD_PID_OFFSET) return 0; return pledge_fail(p, EPERM, PLEDGE_PROC); } |