]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
atm: fix info leak in getsockopt(SO_ATMPVC)
authorMathias Krause <minipli@googlemail.com>
Wed, 15 Aug 2012 11:31:44 +0000 (11:31 +0000)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 19 Sep 2012 14:04:50 +0000 (15:04 +0100)
[ Upstream commit e862f1a9b7df4e8196ebec45ac62295138aa3fc2 ]

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>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
net/atm/common.c

index 14ff9fe399896c024630c3bced79de195cd5dd54..0ca06e851e7c4ef43403b17f926c7f8457e2fe42 100644 (file)
@@ -784,6 +784,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;