diff options
author | Vitaliy Makkoveev <mvs@cvs.openbsd.org> | 2024-04-11 08:33:38 +0000 |
---|---|---|
committer | Vitaliy Makkoveev <mvs@cvs.openbsd.org> | 2024-04-11 08:33:38 +0000 |
commit | 0e5b82794d8ea6eed1ca6b99ecee42a17b942986 (patch) | |
tree | 53464ceb4b10c3ab992fd27863214d56b23af074 /sys/kern | |
parent | 61eea4ebd40cd7120bb472acc3f79d27dd6cdf07 (diff) |
Take solock_shared() in soo_stat().
Only unix(4) and tcp(4) sockets set (*pru_sence)() handler. The rest of
soo_stat() is the read only access.
ok bluhm
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/sys_socket.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/sys_socket.c b/sys/kern/sys_socket.c index e3b1a894353..748be5a65ca 100644 --- a/sys/kern/sys_socket.c +++ b/sys/kern/sys_socket.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sys_socket.c,v 1.63 2024/03/31 13:50:00 mvs Exp $ */ +/* $OpenBSD: sys_socket.c,v 1.64 2024/04/11 08:33:37 mvs Exp $ */ /* $NetBSD: sys_socket.c,v 1.13 1995/08/12 23:59:09 mycroft Exp $ */ /* @@ -145,7 +145,7 @@ soo_stat(struct file *fp, struct stat *ub, struct proc *p) memset(ub, 0, sizeof (*ub)); ub->st_mode = S_IFSOCK; - solock(so); + solock_shared(so); mtx_enter(&so->so_rcv.sb_mtx); if ((so->so_rcv.sb_state & SS_CANTRCVMORE) == 0 || so->so_rcv.sb_cc != 0) @@ -156,7 +156,7 @@ soo_stat(struct file *fp, struct stat *ub, struct proc *p) ub->st_uid = so->so_euid; ub->st_gid = so->so_egid; (void)pru_sense(so, ub); - sounlock(so); + sounlock_shared(so); return (0); } |