Skip to content

Commit

Permalink
macsec: fix validation failed in asynchronous operation.
Browse files Browse the repository at this point in the history
MACSec test failed when asynchronous crypto operations is used. It
encounters packet validation failed since macsec_skb_cb(skb)->valid
is always 'false'.

This patch adds missing "macsec_skb_cb(skb)->valid = true" in
macsec_decrypt_done() when "err == 0".

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
ryderlee1110 authored and davem330 committed Feb 21, 2017
1 parent 8ccde4c commit b3bdc3a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/net/macsec.c
Original file line number Diff line number Diff line change
Expand Up @@ -879,6 +879,9 @@ static void macsec_decrypt_done(struct crypto_async_request *base, int err)

aead_request_free(macsec_skb_cb(skb)->req);

if (!err)
macsec_skb_cb(skb)->valid = true;

rcu_read_lock_bh();
pn = ntohl(macsec_ethhdr(skb)->packet_number);
if (!macsec_post_decrypt(skb, &macsec->secy, pn)) {
Expand Down

0 comments on commit b3bdc3a

Please sign in to comment.