summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2009-08-06 20:27:04 +0000
committerGreg Kroah-Hartman <gregkh@suse.de>2009-09-08 20:17:32 -0700
commitbbe5cbd01823805a7cbba06b043c19b559e324c4 (patch)
tree17100eea23e59ebddf1079094be8a38156a4a704
parent3cee5ca317b5f0a0c2c62ad24dbe7f415ca45687 (diff)
can: Fix raw_getname() leak
commit e84b90ae5eb3c112d1f208964df1d8156a538289 upstream. raw_getname() can leak 10 bytes of kernel memory to user (two bytes hole between can_family and can_ifindex, 8 bytes at the end of sockaddr_can structure) Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Acked-by: Oliver Hartkopp <oliver@hartkopp.net> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--net/can/raw.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/can/raw.c b/net/can/raw.c
index 6e0663faaf9f..08f31d4c480d 100644
--- a/net/can/raw.c
+++ b/net/can/raw.c
@@ -396,6 +396,7 @@ static int raw_getname(struct socket *sock, struct sockaddr *uaddr,
if (peer)
return -EOPNOTSUPP;
+ memset(addr, 0, sizeof(*addr));
addr->can_family = AF_CAN;
addr->can_ifindex = ro->ifindex;