Skip to contentSkip to conversation

Patch "macsec: fix memory leaks when skb_to_sgvec fails" has been added to the 4.13-stable tree

PATCH [email protected] 1 participant 1 message Nov 15, 2017

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

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

macsec: fix memory leaks when skb_to_sgvec fails

to the 4.13-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-fix-memory-leaks-when-skb_to_sgvec-fails.patch
and it can be found in the queue-4.13 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From foo@baz Wed Nov 15 17:25:34 CET 2017

From: Sabrina Dubroca <[email protected]>
Date: Tue, 10 Oct 2017 17:07:12 +0200
Subject: macsec: fix memory leaks when skb_to_sgvec fails

From: Sabrina Dubroca <[email protected]>

[ Upstream commit 5aba2ba5030b66a6f8c93049b718556f9aacd7c6 ]

Fixes cda7ea690350 ("macsec: check return value of skb_to_sgvec always")
---
 drivers/net/macsec.c |    2 ++
 1 file changed, 2 insertions(+)
drivers/net/macsec.c +2 -0
@@ -742,6 +742,7 @@ static struct sk_buff *macsec_encrypt(st
 	sg_init_table(sg, ret);
 	ret = skb_to_sgvec(skb, sg, 0, skb->len);
 	if (unlikely(ret < 0)) {
+		aead_request_free(req);
 		macsec_txsa_put(tx_sa);
 		kfree_skb(skb);
 		return ERR_PTR(ret);
@@ -954,6 +955,7 @@ static struct sk_buff *macsec_decrypt(st
 	sg_init_table(sg, ret);
 	ret = skb_to_sgvec(skb, sg, 0, skb->len);
 	if (unlikely(ret < 0)) {
+		aead_request_free(req);
 		kfree_skb(skb);
 		return ERR_PTR(ret);
 	}

Patches currently in stable-queue which might be from [email protected] are

queue-4.13/macsec-fix-memory-leaks-when-skb_to_sgvec-fails.patch