git: 2a4b8fd1dc07 - main - unix: Fix a socket refcount leak in uipc_sendfile_wait()
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 01 Jul 2026 15:35:50 UTC
The branch main has been updated by markj:
URL: https://cgit.FreeBSD.org/src/commit/?id=2a4b8fd1dc070e71fbaab6f12c1c9e4452652aa7
commit 2a4b8fd1dc070e71fbaab6f12c1c9e4452652aa7
Author: Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2026-07-01 15:35:10 +0000
Commit: Mark Johnston <markj@FreeBSD.org>
CommitDate: 2026-07-01 15:35:16 +0000
unix: Fix a socket refcount leak in uipc_sendfile_wait()
Fixes: d15792780760 ("unix: new implementation of unix/stream & unix/seqpacket")
Reviewed by: glebius
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D57967
---
sys/kern/uipc_usrreq.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c
index ad6d546afa25..0b4e49c7db55 100644
--- a/sys/kern/uipc_usrreq.c
+++ b/sys/kern/uipc_usrreq.c
@@ -2446,8 +2446,10 @@ uipc_sendfile_wait(struct socket *so, off_t need, int *space)
SOCK_RECVBUF_UNLOCK(so2);
return (EAGAIN);
}
- if (!sockref)
+ if (!sockref) {
soref(so2);
+ sockref = true;
+ }
error = uipc_stream_sbwait(so2, so->so_snd.sb_timeo);
if (error == 0 &&
__predict_false(sb->sb_state & SBS_CANTRCVMORE))