RE: [064/152] driver/net/benet: fix be_cmd_multicast_set() memcpybug

From: Sathya.Perla
Date: Thu Jan 06 2011 - 00:29:58 EST


The patch below is fine. Thanks.

-Sathya

-----Original Message-----
From: Greg KH [mailto:gregkh@xxxxxxx]
Sent: Thursday, January 06, 2011 5:53 AM
To: linux-kernel@xxxxxxxxxxxxxxx; stable@xxxxxxxxxx
Cc: stable-review@xxxxxxxxxx; torvalds@xxxxxxxxxxxxxxxxxxxx; akpm@xxxxxxxxxxxxxxxxxxxx; alan@xxxxxxxxxxxxxxxxxxx; Perla, Sathya; Seetharaman, Subramanian; Bandi, Sarveshwar; Khaparde, Ajit; Joe Jin; David S. Miller
Subject: [064/152] driver/net/benet: fix be_cmd_multicast_set() memcpy bug

2.6.36-stable review patch. If anyone has any objections, please let us know.

------------------


From: Joe Jin <joe.jin@xxxxxxxxxx>

[ Upstream commit 3fd40d0ceac9c234243730f4d7a6ffdb2fd3023a ]

Regarding benet be_cmd_multicast_set() function, now using
netdev_for_each_mc_addr() helper for mac address copy, but
when copying to req->mac[] did not increase of the index.

Cc: Sathya Perla <sathyap@xxxxxxxxxxxxxxxxx>
Cc: Subbu Seetharaman <subbus@xxxxxxxxxxxxxxxxx>
Cc: Sarveshwar Bandi <sarveshwarb@xxxxxxxxxxxxxxxxx>
Cc: Ajit Khaparde <ajitk@xxxxxxxxxxxxxxxxx>
Signed-off-by: Joe Jin <joe.jin@xxxxxxxxxx>
Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>
---
drivers/net/benet/be_cmds.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/net/benet/be_cmds.c
+++ b/drivers/net/benet/be_cmds.c
@@ -1179,7 +1179,7 @@ int be_cmd_multicast_set(struct be_adapt

i = 0;
netdev_for_each_mc_addr(ha, netdev)
- memcpy(req->mac[i].byte, ha->addr, ETH_ALEN);
+ memcpy(req->mac[i++].byte, ha->addr, ETH_ALEN);
} else {
req->promiscuous = 1;
}


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/