git: DragonFly_RELEASE_6_4 if_tun: Fix mbuf chain leak in tunwrite()
Aaron LI
aly at crater.dragonflybsd.org
Tue Sep 1 22:49:05 PDT 2026
commit 7e88ea5e3bc9753810b9ac173d9bfcd924bd46bd
Author: Nathan Sapwell <nathan at dreamfast.solutions>
Date: Thu Jul 2 09:43:02 2026 +0000
if_tun: Fix mbuf chain leak in tunwrite()
tunwrite() builds an mbuf chain headed by 'top' in its read loop;
on the final iteration the local 'm' points at the chain tail.
Then the subsequent EAFNOSUPPORT default case of the family switch calls
m_freem(m), freeing only that tail mbuf and leaking the chain head and
all intermediates.
Fix the m_freem() to free from 'top' instead to free the whole mbuf
chain, matching the earlier error path.
While there, fix one indentation. (aly)
GitHub-PR: #39
Assisted-with: Zhipu GLM-5.2
Summary of changes:
sys/net/tun/if_tun.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/7e88ea5e3bc9753810b9ac173d9bfcd924bd46bd
--
DragonFly BSD source repository
More information about the Commits
mailing list