Skip to content

Commit 2929cce

Browse files
Wei Yongjunkuba-moo
authored andcommitted
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: cb101ed ("x25: Handle undersized/fragmented skbs") Signed-off-by: Wei Yongjun <[email protected]> Acked-by: Martin Schiller <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent c9b895c commit 2929cce

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/x25/x25_dev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ int x25_lapb_receive_frame(struct sk_buff *skb, struct net_device *dev,
117117

118118
if (!pskb_may_pull(skb, 1)) {
119119
x25_neigh_put(nb);
120-
return 0;
120+
goto drop;
121121
}
122122

123123
switch (skb->data[0]) {

0 commit comments

Comments
 (0)