Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2f43b9be authored by Dan Carpenter's avatar Dan Carpenter Committed by David S. Miller
Browse files

wan/fsl_ucc_hdlc: info leak in uhdlc_ioctl()



There is a 2 byte struct whole after line.loopback so we need to clear
that out to avoid disclosing stack information.

Fixes: c19b6d24 ('drivers/net: support hdlc function for QE-UCC')
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7a7d1d57
Loading
Loading
Loading
Loading
+1 −2
Original line number Original line Diff line number Diff line
@@ -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 */
			ifr->ifr_settings.size = size; /* data size wanted */
			return -ENOBUFS;
			return -ENOBUFS;
		}
		}
		memset(&line, 0, sizeof(line));
		line.clock_type = priv->clocking;
		line.clock_type = priv->clocking;
		line.clock_rate = 0;
		line.loopback = 0;


		if (copy_to_user(ifr->ifr_settings.ifs_ifsu.sync, &line, size))
		if (copy_to_user(ifr->ifr_settings.ifs_ifsu.sync, &line, size))
			return -EFAULT;
			return -EFAULT;