]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
tipc: fix memory leak in tipc_link_xmit
authorTung Nguyen <tung.quang.nguyen@est.tech>
Thu, 3 Apr 2025 09:24:31 +0000 (09:24 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 May 2025 05:43:52 +0000 (07:43 +0200)
commited06675d3b8cd37120b447646d53f7cd3e6fcd63
tree890a69369da7f3a9a95dd03eb83ff779846f55fb
parentd0d720f9282839b9db625a376c02a1426a16b0ae
tipc: fix memory leak in tipc_link_xmit

[ Upstream commit 69ae94725f4fc9e75219d2d69022029c5b24bc9a ]

In case the backlog transmit queue for system-importance messages is overloaded,
tipc_link_xmit() returns -ENOBUFS but the skb list is not purged. This leads to
memory leak and failure when a skb is allocated.

This commit fixes this issue by purging the skb list before tipc_link_xmit()
returns.

Fixes: 365ad353c256 ("tipc: reduce risk of user starvation during link congestion")
Signed-off-by: Tung Nguyen <tung.quang.nguyen@est.tech>
Link: https://patch.msgid.link/20250403092431.514063-1-tung.quang.nguyen@est.tech
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/tipc/link.c