Patch "macsec: clear encryption keys from the stack after setting up offload" has been added to the 6.0-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    macsec: clear encryption keys from the stack after setting up offload

to the 6.0-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     macsec-clear-encryption-keys-from-the-stack-after-se.patch
and it can be found in the queue-6.0 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit e7e771d76f6b96ecdcd71cc31bb1425b2c0a5f19
Author: Sabrina Dubroca <sd@xxxxxxxxxxxxxxx>
Date:   Wed Nov 2 22:33:16 2022 +0100

    macsec: clear encryption keys from the stack after setting up offload
    
    [ Upstream commit aaab73f8fba4fd38f4d2617440d541a1c334e819 ]
    
    macsec_add_rxsa and macsec_add_txsa copy the key to an on-stack
    offloading context to pass it to the drivers, but leaves it there when
    it's done. Clear it with memzero_explicit as soon as it's not needed
    anymore.
    
    Fixes: 3cf3227a21d1 ("net: macsec: hardware offloading infrastructure")
    Signed-off-by: Sabrina Dubroca <sd@xxxxxxxxxxxxxxx>
    Reviewed-by: Antoine Tenart <atenart@xxxxxxxxxx>
    Reviewed-by: Leon Romanovsky <leonro@xxxxxxxxxx>
    Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/macsec.c b/drivers/net/macsec.c
index 2add76c8064b..ddfa853ec9b5 100644
--- a/drivers/net/macsec.c
+++ b/drivers/net/macsec.c
@@ -1861,6 +1861,7 @@ static int macsec_add_rxsa(struct sk_buff *skb, struct genl_info *info)
 		       secy->key_len);
 
 		err = macsec_offload(ops->mdo_add_rxsa, &ctx);
+		memzero_explicit(ctx.sa.key, secy->key_len);
 		if (err)
 			goto cleanup;
 	}
@@ -2103,6 +2104,7 @@ static int macsec_add_txsa(struct sk_buff *skb, struct genl_info *info)
 		       secy->key_len);
 
 		err = macsec_offload(ops->mdo_add_txsa, &ctx);
+		memzero_explicit(ctx.sa.key, secy->key_len);
 		if (err)
 			goto cleanup;
 	}



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux