wan/fsl_ucc_hdlc: info leak in uhdlc_ioctl()
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 14 Jul 2016 11:16:53 +0000 (14:16 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 15 Jul 2016 18:42:42 +0000 (11:42 -0700)
There is a 2 byte struct whole after line.loopback so we need to clear
that out to avoid disclosing stack information.

Fixes: c19b6d246a35 ('drivers/net: support hdlc function for QE-UCC')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/wan/fsl_ucc_hdlc.c

index 19174ac1e33800efef1386307d444a1f21a5434d..6edd48afc248230d08a504fcd33dc56750ca1f40 100644 (file)
@@ -635,9 +635,8 @@ static int uhdlc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
                        ifr->ifr_settings.size = size; /* data size wanted */
                        return -ENOBUFS;
                }
+               memset(&line, 0, sizeof(line));
                line.clock_type = priv->clocking;
-               line.clock_rate = 0;
-               line.loopback = 0;
 
                if (copy_to_user(ifr->ifr_settings.ifs_ifsu.sync, &line, size))
                        return -EFAULT;