diff options
author | Ross Lagerwall <ross.lagerwall@citrix.com> | 2019-01-17 18:34:38 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-01-19 01:05:14 +0300 |
commit | 6c57f0458022298e4da1729c67bd33ce41c14e7a (patch) | |
tree | c56bc8518423b39cabbda138327a313262ea1e9e /drivers/net | |
parent | e40e2a2e78664fa90ea4b9bdf4a84efce2fea9d9 (diff) | |
download | linux-6c57f0458022298e4da1729c67bd33ce41c14e7a.tar.xz |
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')
-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) |