diff mbox

[3.16.y-ckt,stable] Patch "net: dsa: Fix off-by-one in switch address parsing" has been added to staging queue

Message ID 1439297755-30489-1-git-send-email-luis.henriques@canonical.com
State New
Headers show

Commit Message

Luis Henriques Aug. 11, 2015, 12:55 p.m. UTC
This is a note to let you know that I have just added a patch titled

    net: dsa: Fix off-by-one in switch address parsing

to the linux-3.16.y-queue branch of the 3.16.y-ckt extended stable tree 
which can be found at:

    http://kernel.ubuntu.com/git/ubuntu/linux.git/log/?h=linux-3.16.y-queue

This patch is scheduled to be released in version 3.16.7-ckt16.

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.16.y-ckt tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Luis

------

From 0e1b541ba2e8c13a0711d62d21eaea2b1aed869f Mon Sep 17 00:00:00 2001
From: Florian Fainelli <f.fainelli@gmail.com>
Date: Sat, 11 Jul 2015 18:02:11 -0700
Subject: net: dsa: Fix off-by-one in switch address parsing

commit c8cf89f73f3d9ecbdea479778f0ac714be79be33 upstream.

cd->sw_addr is used as a MDIO bus address, which cannot exceed
PHY_MAX_ADDR (32), our check was off-by-one.

Fixes: 5e95329b701c ("dsa: add device tree bindings to register DSA switches")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/dsa/dsa.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c
index d3ca32dc167f..a3c70870448f 100644
--- a/net/dsa/dsa.c
+++ b/net/dsa/dsa.c
@@ -418,7 +418,7 @@  static int dsa_of_probe(struct platform_device *pdev)
 			continue;

 		cd->sw_addr = be32_to_cpup(sw_addr);
-		if (cd->sw_addr > PHY_MAX_ADDR)
+		if (cd->sw_addr >= PHY_MAX_ADDR)
 			continue;

 		for_each_available_child_of_node(child, port) {