Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Jun 2024 01:33:51 GMT
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: f70581ff7d55 - stable/14 - unix: use m_freemp() when disposing unix socket buffers
Message-ID:  <202406110133.45B1XpOC068727@gitrepo.freebsd.org>

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

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

commit f70581ff7d556aa49a130fa24c876e74b877278c
Author:     Gleb Smirnoff <glebius@FreeBSD.org>
AuthorDate: 2024-06-11 01:31:08 +0000
Commit:     Gleb Smirnoff <glebius@FreeBSD.org>
CommitDate: 2024-06-11 01:31:08 +0000

    unix: use m_freemp() when disposing unix socket buffers
    
    The new unix/dgram uses m_nextpkt linkage, while the old unix/stream
    uses m_next linkage.  This fixes memory leak.
    
    Diagnosed by:           khng
    Reviewed by:            khng, markj
    PR:                     279467
    Fixes:                  458f475df8e5912609c14208c189414a8255c738
    Differential Revision:  https://reviews.freebsd.org/D45478
    
    (cherry picked from commit a9b55a66440ce67e545b60f2861badbfc5ec6327)
---
 sys/kern/uipc_usrreq.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c
index e54cd01956bf..87b82763b5f1 100644
--- a/sys/kern/uipc_usrreq.c
+++ b/sys/kern/uipc_usrreq.c
@@ -2189,7 +2189,7 @@ unp_disconnect(struct unpcb *unp, struct unpcb *unp2)
 
 	if (m != NULL) {
 		unp_scan(m, unp_freerights);
-		m_freem(m);
+		m_freemp(m);
 	}
 }
 
@@ -3276,7 +3276,7 @@ unp_dispose(struct socket *so)
 
 	if (m != NULL) {
 		unp_scan(m, unp_freerights);
-		m_freem(m);
+		m_freemp(m);
 	}
 }
 



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