diff options
author | Ross Lagerwall <ross.lagerwall@citrix.com> | 2019-01-17 16:34:38 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-01-18 23:05:14 +0100 |
commit | 6c57f0458022298e4da1729c67bd33ce41c14e7a (patch) | |
tree | c56bc8518423b39cabbda138327a313262ea1e9e /drivers/net/ppp/pppoe.c | |
parent | net: phy: mdio_bus: add missing device_del() in mdiobus_register() error hand... (diff) | |
download | linux-6c57f0458022298e4da1729c67bd33ce41c14e7a.tar.xz linux-6c57f0458022298e4da1729c67bd33ce41c14e7a.zip |
net: Fix usage of pskb_trim_rcsum
In certain cases, pskb_trim_rcsum() may change skb pointers.
Reinitialize header pointers afterwards to avoid potential
use-after-frees. Add a note in the documentation of
pskb_trim_rcsum(). Found by KASAN.
Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ppp/pppoe.c')
-rw-r--r-- | drivers/net/ppp/pppoe.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/ppp/pppoe.c b/drivers/net/ppp/pppoe.c index 62dc564b251d..f22639f0116a 100644 --- a/drivers/net/ppp/pppoe.c +++ b/drivers/net/ppp/pppoe.c @@ -445,6 +445,7 @@ static int pppoe_rcv(struct sk_buff *skb, struct net_device *dev, if (pskb_trim_rcsum(skb, len)) goto drop; + ph = pppoe_hdr(skb); pn = pppoe_pernet(dev_net(dev)); /* Note that get_item does a sock_hold(), so sk_pppox(po) |