diff options
author | Beniamino Galvani <bgalvani@redhat.com> | 2016-07-26 12:24:53 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-08-16 09:33:16 +0200 |
commit | 3b52ddfbb978c791ef830924f9cfa30de715e97c (patch) | |
tree | 00109a52ed16b57ee543437f84f02d05006ee45b | |
parent | e6ec788ea5bc4195f792b5e4d5d84c15ac7b899d (diff) | |
download | linux-stable-3b52ddfbb978c791ef830924f9cfa30de715e97c.tar.gz linux-stable-3b52ddfbb978c791ef830924f9cfa30de715e97c.tar.bz2 linux-stable-3b52ddfbb978c791ef830924f9cfa30de715e97c.zip |
macsec: ensure rx_sa is set when validation is disabled
[ Upstream commit e3a3b626010a14fe067f163c2c43409d5afcd2a9 ]
macsec_decrypt() is not called when validation is disabled and so
macsec_skb_cb(skb)->rx_sa is not set; but it is used later in
macsec_post_decrypt(), ensure that it's always initialized.
Fixes: c09440f7dcb3 ("macsec: introduce IEEE 802.1AE driver")
Signed-off-by: Beniamino Galvani <bgalvani@redhat.com>
Acked-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/net/macsec.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/macsec.c b/drivers/net/macsec.c index 8f3c55d03d5d..f58858b7972c 100644 --- a/drivers/net/macsec.c +++ b/drivers/net/macsec.c @@ -914,7 +914,6 @@ static struct sk_buff *macsec_decrypt(struct sk_buff *skb, } macsec_skb_cb(skb)->req = req; - macsec_skb_cb(skb)->rx_sa = rx_sa; skb->dev = dev; aead_request_set_callback(req, 0, macsec_decrypt_done, skb); @@ -1141,6 +1140,8 @@ static rx_handler_result_t macsec_handle_frame(struct sk_buff **pskb) } } + macsec_skb_cb(skb)->rx_sa = rx_sa; + /* Disabled && !changed text => skip validation */ if (hdr->tci_an & MACSEC_TCI_C || secy->validate_frames != MACSEC_VALIDATE_DISABLED) |