Skip to content

Commit

Permalink
atm: fix info leak in getsockopt(SO_ATMPVC)
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
minipli authored and davem330 committed Aug 16, 2012
1 parent e3bc4ff commit e862f1a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/atm/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,7 @@ int vcc_getsockopt(struct socket *sock, int level, int optname,

if (!vcc->dev || !test_bit(ATM_VF_ADDR, &vcc->flags))
return -ENOTCONN;
memset(&pvc, 0, sizeof(pvc));
pvc.sap_family = AF_ATMPVC;
pvc.sap_addr.itf = vcc->dev->number;
pvc.sap_addr.vpi = vcc->vpi;
Expand Down

0 comments on commit e862f1a

Please sign in to comment.