提交 2929cceb 编写于 作者: W Wei Yongjun 提交者: Jakub Kicinski

net/x25: Fix skb leak in x25_lapb_receive_frame()

x25_lapb_receive_frame() using skb_copy() to get a private copy of
skb, the new skb should be freed in the undersized/fragmented skb
error handling path. Otherwise there is a memory leak.

Fixes: cb101ed2 ("x25: Handle undersized/fragmented skbs")
Signed-off-by: NWei Yongjun <weiyongjun1@huawei.com>
Acked-by: NMartin Schiller <ms@dev.tdt.de>
Link: https://lore.kernel.org/r/20221114110519.514538-1-weiyongjun@huaweicloud.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
上级 c9b895c6
......@@ -117,7 +117,7 @@ int x25_lapb_receive_frame(struct sk_buff *skb, struct net_device *dev,
if (!pskb_may_pull(skb, 1)) {
x25_neigh_put(nb);
return 0;
goto drop;
}
switch (skb->data[0]) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册