Skip to contentSkip to conversation

tipc: Fix kfree_skb() of uninitialised pointer

PATCH Applied Ben Hutchings 2 participants 2 messages Dec 15, 2015 – Dec 17, 2015

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tipc: Fix kfree_skb() of uninitialised pointer

Commit 7098356baca7 ("tipc: fix error handling of expanding buffer headroom") added a "goto tx_error". This is fine upstream, but when backported to 4.3 it results in attempting to free the clone before it has been allocated. In this early error case, no cleanup is needed.

---
 net/tipc/udp_media.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/tipc/udp_media.c +1 -1
index 86f2e7c..73bdf1b 100644
@@ -162,7 +162,7 @@ static int tipc_udp_send_msg(struct net *net, struct sk_buff *skb,
 	if (skb_headroom(skb) < UDP_MIN_HEADROOM) {
 		err = pskb_expand_head(skb, UDP_MIN_HEADROOM, 0, GFP_ATOMIC);
 		if (err)
-			goto tx_error;
+			return err;
 	}
 
 	clone = skb_clone(skb, GFP_ATOMIC);
maintainer Applied
#1 lore raw

Patch "tipc: Fix kfree_skb() of uninitialised pointer" has been added to the 4.3-stable tree

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

tipc: Fix kfree_skb() of uninitialised pointer

to the 4.3-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:
tipc-fix-kfree_skb-of-uninitialised-pointer.patch
and it can be found in the queue-4.3 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 [email protected] Thu Dec 17 14:16:22 2015

From: Ben Hutchings <[email protected]>
Date: Tue, 15 Dec 2015 21:21:57 +0000
Subject: tipc: Fix kfree_skb() of uninitialised pointer
To: Greg Kroah-Hartman <[email protected]>
Cc: [email protected], [email protected], "David S. Miller" <[email protected]>
Message-ID: <[email protected]>
Content-Disposition: inline

From: Ben Hutchings <[email protected]>

Commit 7098356baca7 ("tipc: fix error handling of expanding buffer headroom") added a "goto tx_error". This is fine upstream, but when backported to 4.3 it results in attempting to free the clone before it has been allocated. In this early error case, no cleanup is needed.

---
 net/tipc/udp_media.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/tipc/udp_media.c +1 -1
@@ -162,7 +162,7 @@ static int tipc_udp_send_msg(struct net
 	if (skb_headroom(skb) < UDP_MIN_HEADROOM) {
 		err = pskb_expand_head(skb, UDP_MIN_HEADROOM, 0, GFP_ATOMIC);
 		if (err)
-			goto tx_error;
+			return err;
 	}
 
 	clone = skb_clone(skb, GFP_ATOMIC);

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

queue-4.3/tipc-fix-kfree_skb-of-uninitialised-pointer.patch queue-4.3/revert-vrf-fix-double-free-and-memory-corruption-on-register_netdevice-failure.patch queue-4.3/vrf-fix-double-free-and-memory-corruption-on-register_netdevice-failure.patch