Skip to content

Commit

Permalink
atm: fix info leak via getsockname()
Browse files Browse the repository at this point in the history
The ATM code fails to initialize the two padding bytes of struct
sockaddr_atmpvc inserted for alignment. Add an explicit memset(0)
before filling the structure to avoid the info leak.

Signed-off-by: Mathias Krause <minipli@googlemail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Mathias Krause authored and David S. Miller committed Aug 16, 2012
1 parent e862f1a commit 3c0c5cf
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/atm/pvc.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ static int pvc_getname(struct socket *sock, struct sockaddr *sockaddr,
return -ENOTCONN;
*sockaddr_len = sizeof(struct sockaddr_atmpvc);
addr = (struct sockaddr_atmpvc *)sockaddr;
memset(addr, 0, sizeof(*addr));
addr->sap_family = AF_ATMPVC;
addr->sap_addr.itf = vcc->dev->number;
addr->sap_addr.vpi = vcc->vpi;
Expand Down

0 comments on commit 3c0c5cf

Please sign in to comment.