atm: fix info leak in getsockopt(SO_ATMPVC)
authorMathias Krause <minipli@googlemail.com>
Wed, 15 Aug 2012 11:31:44 +0000 (11:31 +0000)
committerWilly Tarreau <w@1wt.eu>
Mon, 10 Jun 2013 09:43:41 +0000 (11:43 +0200)
commit e862f1a9b7df4e8196ebec45ac62295138aa3fc2 upstream.

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>
[bwh: Backported to 2.6.32: adjust context, indentation]
Signed-off-by: Willy Tarreau <w@1wt.eu>
net/atm/common.c

index 6c82d72687f943b480e1cca2d5f9725d07d9f86c..65737b81059e8e0248d19f36d6fa2d0fd39be6fc 100644 (file)
@@ -751,6 +751,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;