Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 May 2022 17:11:56 GMT
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 2e5bf7c49fd2 - main - unix: fix mbuf leak on close of socket with data
Message-ID:  <202205171711.24HHBu0R094414@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by glebius:

URL: https://cgit.FreeBSD.org/src/commit/?id=2e5bf7c49fd2b6440ac49dbfe80d4384d3f645f1

commit 2e5bf7c49fd2b6440ac49dbfe80d4384d3f645f1
Author:     Gleb Smirnoff <glebius@FreeBSD.org>
AuthorDate: 2022-05-17 17:10:41 +0000
Commit:     Gleb Smirnoff <glebius@FreeBSD.org>
CommitDate: 2022-05-17 17:10:41 +0000

    unix: fix mbuf leak on close of socket with data
    
    Fixes:  1f32cef47189403e9e70b1893c731c68b97b964e
---
 sys/kern/uipc_usrreq.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c
index d4e3b25c5479..556a1de142d4 100644
--- a/sys/kern/uipc_usrreq.c
+++ b/sys/kern/uipc_usrreq.c
@@ -2782,7 +2782,10 @@ unp_dispose(struct socket *so)
 	if (SOCK_IO_RECV_OWNED(so))
 		SOCK_IO_RECV_UNLOCK(so);
 
-	unp_dispose_mbuf(m);
+	if (m != NULL) {
+		unp_dispose_mbuf(m);
+		m_freem(m);
+	}
 }
 
 static void



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202205171711.24HHBu0R094414>