You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
pppoe: Fix socket leak.
Move SKB trim before we lookup the socket so we don't have to put it on failure. Based upon an initial patch by Jarek Poplawski and suggestions from Herbert Xu. Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
+3
-3
@@ -399,11 +399,11 @@ static int pppoe_rcv(struct sk_buff *skb,
|
||||
if (skb->len < len)
|
||||
goto drop;
|
||||
|
||||
po = get_item(ph->sid, eth_hdr(skb)->h_source, dev->ifindex);
|
||||
if (!po)
|
||||
if (pskb_trim_rcsum(skb, len))
|
||||
goto drop;
|
||||
|
||||
if (pskb_trim_rcsum(skb, len))
|
||||
po = get_item(ph->sid, eth_hdr(skb)->h_source, dev->ifindex);
|
||||
if (!po)
|
||||
goto drop;
|
||||
|
||||
return sk_receive_skb(sk_pppox(po), skb, 0);
|
||||
|
||||
Reference in New Issue
Block a user