From: Tung N. <tun...@de...> - 2020-10-05 10:35:14
|
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. Reported-by: Thang Hoang Ngo <tha...@de...> Signed-off-by: Tung Nguyen <tun...@de...> --- net/tipc/link.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/tipc/link.c b/net/tipc/link.c index cef38a910107..ca0bb09482d0 100644 --- a/net/tipc/link.c +++ b/net/tipc/link.c @@ -1028,6 +1028,7 @@ int tipc_link_xmit(struct tipc_link *l, struct sk_buff_head *list, if (unlikely(l->backlog[imp].len >= l->backlog[imp].limit)) { if (imp == TIPC_SYSTEM_IMPORTANCE) { pr_warn("%s<%s>, link overflow", link_rst_msg, l->name); + __skb_queue_purge(list); return -ENOBUFS; } rc = link_schedule_user(l, hdr); -- 2.17.1 |