stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch "net: dsa: Do not destroy invalid network devices" has been added to the 4.9-stable tree
@ 2017-02-15  1:04 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2017-02-15  1:04 UTC (permalink / raw)
  To: f.fainelli, davem, gregkh; +Cc: stable, stable-commits


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

    net: dsa: Do not destroy invalid network devices

to the 4.9-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:
     net-dsa-do-not-destroy-invalid-network-devices.patch
and it can be found in the queue-4.9 subdirectory.

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


>From foo@baz Tue Feb 14 17:03:08 PST 2017
From: Florian Fainelli <f.fainelli@gmail.com>
Date: Tue, 7 Feb 2017 23:10:13 -0800
Subject: net: dsa: Do not destroy invalid network devices

From: Florian Fainelli <f.fainelli@gmail.com>


[ Upstream commit 382e1eea2d983cd2343482c6a638f497bb44a636 ]

dsa_slave_create() can fail, and dsa_user_port_unapply() will properly check
for the network device not being NULL before attempting to destroy it. We were
not setting the slave network device as NULL if dsa_slave_create() failed, so
we would later on be calling dsa_slave_destroy() on a now free'd and
unitialized network device, causing crashes in dsa_slave_destroy().

Fixes: 83c0afaec7b7 ("net: dsa: Add new binding implementation")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 net/dsa/dsa2.c |    1 +
 1 file changed, 1 insertion(+)

--- a/net/dsa/dsa2.c
+++ b/net/dsa/dsa2.c
@@ -273,6 +273,7 @@ static int dsa_user_port_apply(struct de
 	if (err) {
 		dev_warn(ds->dev, "Failed to create slave %d: %d\n",
 			 index, err);
+		ds->ports[index].netdev = NULL;
 		return err;
 	}
 


Patches currently in stable-queue which might be from f.fainelli@gmail.com are

queue-4.9/net-dsa-do-not-destroy-invalid-network-devices.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-02-15  1:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-15  1:04 Patch "net: dsa: Do not destroy invalid network devices" has been added to the 4.9-stable tree gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).