wan/fsl_ucc_hdlc: info leak in uhdlc_ioctl()
PATCH 1/1 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.
drivers/net/wan/fsl_ucc_hdlc.c +1 -0
@@ -635,6 +635,7 @@ 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 ;
Am 14.07.2016 12:34, schrieb Dan Carpenter:
Quoted 11 lines
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 <[email protected]>drivers/net/wan/fsl_ucc_hdlc.c +0
-0
drivers/net/wan/fsl_ucc_hdlc.c static int uhdlc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) · line 641
Quoted 7 lines
drivers/net/wan/fsl_ucc_hdlc.c +1
-0@@ -635,6 +635,7 @@ 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 ;
In this case
line.clock_rate = 0;
line.loopback = 0;
are not need any more and can be removed
except like them to have for documentation or so.
re,
wh
PATCH v2 1/1 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.
---
v2: remove the other initialization to zero
drivers/net/wan/fsl_ucc_hdlc.c +1 -2
@@ -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 ;
From: Dan Carpenter <[email protected]>
Date: Thu, 14 Jul 2016 14:16:53 +0300
Quoted 7 lines
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 <[email protected]>---
v2: remove the other initialization to zero
Applied.
Good point. Thanks.
regards,
dan carpenter