summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authormvs <mvs@cvs.openbsd.org>2021-06-02 11:30:24 +0000
committermvs <mvs@cvs.openbsd.org>2021-06-02 11:30:24 +0000
commit472e7d73c56f47463291163e43d1033f3451c6f9 (patch)
tree6ebda4b93df5e64db640f275bf6857159b596b8b /sys/kern
parent047cdaae00fee504e79b4bb49d2600e6eafe4aa5 (diff)
Unlock setrtable(2). Local copy of `ps_rtableid' used to make checks
consistent. ok mpi@
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/syscalls.master4
-rw-r--r--sys/kern/uipc_syscalls.c7
2 files changed, 6 insertions, 5 deletions
diff --git a/sys/kern/syscalls.master b/sys/kern/syscalls.master
index 63d8bf01377..8d45940ac62 100644
--- a/sys/kern/syscalls.master
+++ b/sys/kern/syscalls.master
@@ -1,4 +1,4 @@
-; $OpenBSD: syscalls.master,v 1.216 2021/05/12 15:04:48 mpi Exp $
+; $OpenBSD: syscalls.master,v 1.217 2021/06/02 11:30:23 mvs Exp $
; $NetBSD: syscalls.master,v 1.32 1996/04/23 10:24:21 mycroft Exp $
; @(#)syscalls.master 8.2 (Berkeley) 1/13/94
@@ -533,7 +533,7 @@
307 OBSOL statfs53
308 OBSOL fstatfs53
309 OBSOL fhstatfs53
-310 STD { int sys_setrtable(int rtableid); }
+310 STD NOLOCK { int sys_setrtable(int rtableid); }
311 STD NOLOCK { int sys_getrtable(void); }
312 OBSOL t32_getdirentries
313 STD { int sys_faccessat(int fd, const char *path, \
diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c
index b28c66ac69b..2221798eba5 100644
--- a/sys/kern/uipc_syscalls.c
+++ b/sys/kern/uipc_syscalls.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_syscalls.c,v 1.191 2021/05/28 16:24:53 visa Exp $ */
+/* $OpenBSD: uipc_syscalls.c,v 1.192 2021/06/02 11:30:23 mvs Exp $ */
/* $NetBSD: uipc_syscalls.c,v 1.19 1996/02/09 19:00:48 christos Exp $ */
/*
@@ -1171,13 +1171,14 @@ sys_setrtable(struct proc *p, void *v, register_t *retval)
struct sys_setrtable_args /* {
syscallarg(int) rtableid;
} */ *uap = v;
+ u_int ps_rtableid = p->p_p->ps_rtableid;
int rtableid, error;
rtableid = SCARG(uap, rtableid);
- if (p->p_p->ps_rtableid == (u_int)rtableid)
+ if (ps_rtableid == rtableid)
return (0);
- if (p->p_p->ps_rtableid != 0 && (error = suser(p)) != 0)
+ if (ps_rtableid != 0 && (error = suser(p)) != 0)
return (error);
if (rtableid < 0 || !rtable_exists((u_int)rtableid))
return (EINVAL);