atm: fix info leak in getsockopt(SO_ATMPVC)

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>
This commit is contained in:
Mathias Krause 2012-08-15 11:31:44 +00:00 committed by David S. Miller
parent e3bc4ffb81
commit e862f1a9b7
1 changed files with 1 additions and 0 deletions

View File

@ -812,6 +812,7 @@ int vcc_getsockopt(struct socket *sock, int level, int optname,
if (!vcc->dev || !test_bit(ATM_VF_ADDR, &vcc->flags)) if (!vcc->dev || !test_bit(ATM_VF_ADDR, &vcc->flags))
return -ENOTCONN; return -ENOTCONN;
memset(&pvc, 0, sizeof(pvc));
pvc.sap_family = AF_ATMPVC; pvc.sap_family = AF_ATMPVC;
pvc.sap_addr.itf = vcc->dev->number; pvc.sap_addr.itf = vcc->dev->number;
pvc.sap_addr.vpi = vcc->vpi; pvc.sap_addr.vpi = vcc->vpi;