diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2009-06-07 23:49:24 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-06-09 08:11:42 -0400 |
commit | 0c27922e4933ceb86644f4a9b1af212ffe5aad75 (patch) | |
tree | 41d2add3d419269c5802c0b22e7552c3fa677eb9 /net | |
parent | ebc8d2ab61dde6cf775ae7bb1ed9e38dfe12ca65 (diff) |
net: dev_addr_init() fix
commit f001fde5eadd915f4858d22ed70d7040f48767cf
(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>
Diffstat (limited to 'net')
-rw-r--r-- | net/core/dev.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 4913089c91dc..81b392ef5114 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -3655,8 +3655,8 @@ static int dev_addr_init(struct net_device *dev) | |||
3655 | /* rtnl_mutex must be held here */ | 3655 | /* rtnl_mutex must be held here */ |
3656 | 3656 | ||
3657 | INIT_LIST_HEAD(&dev->dev_addr_list); | 3657 | INIT_LIST_HEAD(&dev->dev_addr_list); |
3658 | memset(addr, 0, sizeof(*addr)); | 3658 | memset(addr, 0, sizeof(addr)); |
3659 | err = __hw_addr_add(&dev->dev_addr_list, NULL, addr, sizeof(*addr), | 3659 | err = __hw_addr_add(&dev->dev_addr_list, NULL, addr, sizeof(addr), |
3660 | NETDEV_HW_ADDR_T_LAN); | 3660 | NETDEV_HW_ADDR_T_LAN); |
3661 | if (!err) { | 3661 | if (!err) { |
3662 | /* | 3662 | /* |