mirror of
https://github.com/adulau/aha.git
synced 2024-12-29 04:06:22 +00:00
net: dev_addr_init() fix
commit f001fde5ea
(net: introduce a list of device addresses dev_addr_list (v6))
added one regression Vegard Nossum found in its testings.
With kmemcheck help, Vegard found some uninitialized memory
was read and reported to user, potentialy leaking kernel data.
( thread can be found on http://lkml.org/lkml/2009/5/30/177 )
dev_addr_init() incorrectly uses sizeof() operator. We were
initializing one byte instead of MAX_ADDR_LEN bytes.
Reported-by: Vegard Nossum <vegard.nossum@gmail.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
ebc8d2ab61
commit
0c27922e49
1 changed files with 2 additions and 2 deletions
|
@ -3655,8 +3655,8 @@ static int dev_addr_init(struct net_device *dev)
|
||||||
/* rtnl_mutex must be held here */
|
/* rtnl_mutex must be held here */
|
||||||
|
|
||||||
INIT_LIST_HEAD(&dev->dev_addr_list);
|
INIT_LIST_HEAD(&dev->dev_addr_list);
|
||||||
memset(addr, 0, sizeof(*addr));
|
memset(addr, 0, sizeof(addr));
|
||||||
err = __hw_addr_add(&dev->dev_addr_list, NULL, addr, sizeof(*addr),
|
err = __hw_addr_add(&dev->dev_addr_list, NULL, addr, sizeof(addr),
|
||||||
NETDEV_HW_ADDR_T_LAN);
|
NETDEV_HW_ADDR_T_LAN);
|
||||||
if (!err) {
|
if (!err) {
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue