Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

atm: fix info leak via getsockname()

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>

authored by

Mathias Krause and committed by
David S. Miller
3c0c5cfd e862f1a9

+1
+1
net/atm/pvc.c
··· 95 95 return -ENOTCONN; 96 96 *sockaddr_len = sizeof(struct sockaddr_atmpvc); 97 97 addr = (struct sockaddr_atmpvc *)sockaddr; 98 + memset(addr, 0, sizeof(*addr)); 98 99 addr->sap_family = AF_ATMPVC; 99 100 addr->sap_addr.itf = vcc->dev->number; 100 101 addr->sap_addr.vpi = vcc->vpi;