diff options
author | Andreas Steinmetz <ast@domdv.de> | 2019-06-30 22:46:42 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-07-02 14:12:29 -0700 |
commit | 095c02da80a41cf6d311c504d8955d6d1c2add10 (patch) | |
tree | 1b6afb475f0c060e5c0390025d8cd1e19ef1f0ff /drivers/net/macsec.c | |
parent | e835ada07091f40dcfb1bc735082bd0a7c005e59 (diff) | |
download | linux-riscv-095c02da80a41cf6d311c504d8955d6d1c2add10.tar.gz linux-riscv-095c02da80a41cf6d311c504d8955d6d1c2add10.tar.bz2 linux-riscv-095c02da80a41cf6d311c504d8955d6d1c2add10.zip |
macsec: fix use-after-free of skb during RX
Fix use-after-free of skb when rx_handler returns RX_HANDLER_PASS.
Signed-off-by: Andreas Steinmetz <ast@domdv.de>
Acked-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/macsec.c')
-rw-r--r-- | drivers/net/macsec.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/net/macsec.c b/drivers/net/macsec.c index 75aebf65cd09..8ec73d677123 100644 --- a/drivers/net/macsec.c +++ b/drivers/net/macsec.c @@ -1099,10 +1099,9 @@ static rx_handler_result_t macsec_handle_frame(struct sk_buff **pskb) } skb = skb_unshare(skb, GFP_ATOMIC); - if (!skb) { - *pskb = NULL; + *pskb = skb; + if (!skb) return RX_HANDLER_CONSUMED; - } pulled_sci = pskb_may_pull(skb, macsec_extra_len(true)); if (!pulled_sci) { |