From nobody Tue May 17 17:11:56 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 7DFC81AD9327; Tue, 17 May 2022 17:11:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4L2jMw38Fnz3Lgw; Tue, 17 May 2022 17:11:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1652807516; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QYd5GNGAT79hq/BdIMdctCnt5u7hsihX0JRIobP4XjU=; b=mInvBn9jbr+0vRWj6QIuPIqWZy1B7sjgWk6D6b/lAhLCOgv6BATr3CYToHI4Q1v79f65ps 3jofeHJRoG2OvezkMM9enfToQ3d5gQmAGd/xDbQY7oj1ubds0s3xXPwa0Q3lwWwSgr5QM4 0GnMn4TvOiIvA0oUur9oVau393OVJSHAGyTMkuwhkk0/iNprNJFoSrQkLEBqeLxoGqSBeI J0tiEg1c2jegB6kw7tpuO6l3uXjDWHfXhnFtXQ6eJfOU8XXtd4bNMPYj2s944GVsGMbDML HTLvq7eHBI5/5pZ3uzntY7ZWMaXog9mTZA4nd1+RtP2MwRMXMf72Rcrv82EjDg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4CA8918CA4; Tue, 17 May 2022 17:11:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 24HHBueB094415; Tue, 17 May 2022 17:11:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 24HHBu0R094414; Tue, 17 May 2022 17:11:56 GMT (envelope-from git) Date: Tue, 17 May 2022 17:11:56 GMT Message-Id: <202205171711.24HHBu0R094414@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 2e5bf7c49fd2 - main - unix: fix mbuf leak on close of socket with data List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2e5bf7c49fd2b6440ac49dbfe80d4384d3f645f1 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1652807516; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QYd5GNGAT79hq/BdIMdctCnt5u7hsihX0JRIobP4XjU=; b=HttV9eph3XKOZ2raftW1fACwZA1g0v+jGQAtDm2WVg1Lwo/JbXuez1bctiQxNN6ii5TKSu IHRYYmXzV30eOZB/qm+fm+3Hjztwza8TuJQQ2q6SgVSTw2483NRUlYUohK6YogbgIi+vZJ AKPI/1L2otM2VXGc8fnyxmC0L+cdn5AfHqP8vz/sSDgpiBkGhLW1NONJNySFs55AxMsMFA FGkeDgTG8zfwcG7Z2WSFCALwYNU30XnEA0p8BOzDknDuXnrW7+GljItd9cP6DyvBAItf2p 64b3px5VguL2ECOFo05dn3kFEQ0tIsj/KEFlZzqR/hvmZSI0vJ+9+8M3DjCFoQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1652807516; a=rsa-sha256; cv=none; b=MV1E4s6O9HhfQ/vO1/EXIneJvd4pe/z714S8AtF/gXczZQCR3bnri+M6GTDI3rypSw/j7N iK+6fexzrpcSGLlX7+Hj3igw2oqarBnHUj5DE+itgGVJcxXl7/2esa+Qj9SDd2IgVlAL7d ZA825353GjdRwHbRbI7gpTvWTjNpNyY+nvY59ksma4uQXQkjT7K0fE45KSJLxIgTay2ljc qDSoUfDqdH5VlXV/Qb/237D1Mmow5FHMNz5fLqgarKDI4zC6ODgkwXp7NVKBynXDa9itc+ 9YFvdhXo1oT0kW0qL0YJa0RpC3dy6zHt9FxbqDkIoh/Vi7tV3xowwQvfSr3dwg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=2e5bf7c49fd2b6440ac49dbfe80d4384d3f645f1 commit 2e5bf7c49fd2b6440ac49dbfe80d4384d3f645f1 Author: Gleb Smirnoff AuthorDate: 2022-05-17 17:10:41 +0000 Commit: Gleb Smirnoff 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