]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
macsec: ensure rx_sa is set when validation is disabled
authorBeniamino Galvani <bgalvani@redhat.com>
Tue, 26 Jul 2016 10:24:53 +0000 (12:24 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 26 Jul 2016 21:27:48 +0000 (14:27 -0700)
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>
drivers/net/macsec.c

index d8b2b49d6d5fc57239d0b76a0e96e6be9c6dd464..2d0beb1b801c0f0a3c27db7b1156c48697b0fdf4 100644 (file)
@@ -944,7 +944,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);
 
@@ -1172,6 +1171,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)