Skip to content

Commit bb50ddb

Browse files
author
Xin Long
committed
tipc: fix memory leak in tipc_link_xmit
JIRA: https://issues.redhat.com/browse/RHEL-115652 Tested: compile only commit 69ae947 Author: Tung Nguyen <tung.quang.nguyen@est.tech> Date: Thu Apr 3 09:24:31 2025 +0000 tipc: fix memory leak in tipc_link_xmit 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: 365ad35 ("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: Xin Long <lxin@redhat.com>
1 parent d470ccc commit bb50ddb

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

net/tipc/link.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1053,6 +1053,7 @@ int tipc_link_xmit(struct tipc_link *l, struct sk_buff_head *list,
10531053
if (unlikely(l->backlog[imp].len >= l->backlog[imp].limit)) {
10541054
if (imp == TIPC_SYSTEM_IMPORTANCE) {
10551055
pr_warn("%s<%s>, link overflow", link_rst_msg, l->name);
1056+
__skb_queue_purge(list);
10561057
return -ENOBUFS;
10571058
}
10581059
rc = link_schedule_user(l, hdr);

0 commit comments

Comments
 (0)