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

    Revert "vrf: fix double free and memory corruption on register_netdevice 
failure"

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:
     
revert-vrf-fix-double-free-and-memory-corruption-on-register_netdevice-failure.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.


>From [email protected]  Thu Dec 17 14:12:57 2015
From: Ben Hutchings <[email protected]>
Date: Tue, 15 Dec 2015 15:31:49 +0000
Subject: Revert "vrf: fix double free and memory corruption on 
register_netdevice failure"
To: Greg Kroah-Hartman <[email protected]>
Cc: David Ahern <[email protected]>, [email protected], 
[email protected], Nikolay Aleksandrov <[email protected]>, 
"David S. Miller" <[email protected]>
Message-ID: <[email protected]>

From: Ben Hutchings <[email protected]>

This reverts commit b3abad339f8e268bb261e5844ab68b18a7797c29, which
was an attempt to backport commit 7f109f7cc37108cba7243bc832988525b0d85909
upstream.  The backport introduced a deadlock and other bugs.

Signed-off-by: Ben Hutchings <[email protected]>
Acked-by: David S. Miller <[email protected]>
Acked-by: David Ahern <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
 drivers/net/vrf.c |   15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

--- a/drivers/net/vrf.c
+++ b/drivers/net/vrf.c
@@ -581,6 +581,7 @@ static int vrf_newlink(struct net *src_n
 {
        struct net_vrf *vrf = netdev_priv(dev);
        struct net_vrf_dev *vrf_ptr;
+       int err;
 
        if (!data || !data[IFLA_VRF_TABLE])
                return -EINVAL;
@@ -589,16 +590,26 @@ static int vrf_newlink(struct net *src_n
 
        dev->priv_flags |= IFF_VRF_MASTER;
 
+       err = -ENOMEM;
        vrf_ptr = kmalloc(sizeof(*dev->vrf_ptr), GFP_KERNEL);
        if (!vrf_ptr)
-               return -ENOMEM;
+               goto out_fail;
 
        vrf_ptr->ifindex = dev->ifindex;
        vrf_ptr->tb_id = vrf->tb_id;
 
+       err = register_netdevice(dev);
+       if (err < 0)
+               goto out_fail;
+
        rcu_assign_pointer(dev->vrf_ptr, vrf_ptr);
 
-       return register_netdev(dev);
+       return 0;
+
+out_fail:
+       kfree(vrf_ptr);
+       free_netdev(dev);
+       return err;
 }
 
 static size_t vrf_nl_getsize(const struct net_device *dev)


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
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to