Skip to content

Commit 69ae947

Browse files
Tung NguyenPaolo Abeni
authored andcommitted
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>
1 parent 04efcee commit 69ae947

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
@@ -1046,6 +1046,7 @@ int tipc_link_xmit(struct tipc_link *l, struct sk_buff_head *list,
10461046
if (unlikely(l->backlog[imp].len >= l->backlog[imp].limit)) {
10471047
if (imp == TIPC_SYSTEM_IMPORTANCE) {
10481048
pr_warn("%s<%s>, link overflow", link_rst_msg, l->name);
1049+
__skb_queue_purge(list);
10491050
return -ENOBUFS;
10501051
}
10511052
rc = link_schedule_user(l, hdr);

0 commit comments

Comments
 (0)