You've already forked linux-rockchip
mirror of
https://github.com/armbian/linux-rockchip.git
synced 2026-01-06 11:08:10 -08:00
net/x25: Fix skb leak in x25_lapb_receive_frame()
[ Upstream commit2929cceb2f] 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:cb101ed2c3("x25: Handle undersized/fragmented skbs") Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Acked-by: Martin Schiller <ms@dev.tdt.de> Link: https://lore.kernel.org/r/20221114110519.514538-1-weiyongjun@huaweicloud.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
94822d2331
commit
9f00da9c86
@@ -117,7 +117,7 @@ int x25_lapb_receive_frame(struct sk_buff *skb, struct net_device *dev,
|
|||||||
|
|
||||||
if (!pskb_may_pull(skb, 1)) {
|
if (!pskb_may_pull(skb, 1)) {
|
||||||
x25_neigh_put(nb);
|
x25_neigh_put(nb);
|
||||||
return 0;
|
goto drop;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (skb->data[0]) {
|
switch (skb->data[0]) {
|
||||||
|
|||||||
Reference in New Issue
Block a user