diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2024-11-05 09:14:20 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2024-11-05 09:14:20 +0000 |
commit | cd5ebed949f44173752c99b0c16268654b418c23 (patch) | |
tree | 575dfabcf61ca254d54a53c33fb0bd6f996450ae /sys/kern/uipc_syscalls.c | |
parent | 3110ac4bfc49bab60a720c3f34a32e9713f83d77 (diff) |
Unlock ptsignal by using the ps_mtx instead of KERNEL_LOCK to ensure
the process is not modified during signal delivery.
This also unlocks psignal and prsignal since those are simple wrappers
around ptsignal.
OK mpi@
Diffstat (limited to 'sys/kern/uipc_syscalls.c')
-rw-r--r-- | sys/kern/uipc_syscalls.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c index 1ad1b7941d6..6d8b5ff4da9 100644 --- a/sys/kern/uipc_syscalls.c +++ b/sys/kern/uipc_syscalls.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_syscalls.c,v 1.219 2024/04/25 17:32:53 bluhm Exp $ */ +/* $OpenBSD: uipc_syscalls.c,v 1.220 2024/11/05 09:14:19 claudio Exp $ */ /* $NetBSD: uipc_syscalls.c,v 1.19 1996/02/09 19:00:48 christos Exp $ */ /* @@ -788,11 +788,8 @@ sendit(struct proc *p, int s, struct msghdr *mp, int flags, register_t *retsize) if (auio.uio_resid != len && (error == ERESTART || error == EINTR || error == EWOULDBLOCK)) error = 0; - if (error == EPIPE && (flags & MSG_NOSIGNAL) == 0) { - KERNEL_LOCK(); + if (error == EPIPE && (flags & MSG_NOSIGNAL) == 0) ptsignal(p, SIGPIPE, STHREAD); - KERNEL_UNLOCK(); - } } if (error == 0) { *retsize = len - auio.uio_resid; |