ipv6,gre: do not leak info to user-space
Subsystems (3)
PATCH 1/1 ipv6,gre: do not leak info to user-space
There is a hole in struct ip6_tnl_parm2, so we have to zero the struct on stack before copying it to user-space.
Cc David S. Miller <[email protected]>
Signed-off-by Cong Wang <[email protected]>
---
net/ipv6/ip6_gre.c +2 -0
@@ -1081,6 +1081,7 @@ static int ip6gre_tunnel_ioctl(struct net_device *dev, }if (t ==NULL ) t =netdev_priv (dev); +memset (&p,0 ,sizeof (p));ip6gre_tnl_parm_to_user (&p, &t->parms);if (copy_to_user (ifr->ifr_ifru.ifru_data, &p,sizeof (p))) err = -EFAULT ;
@@ -1128,6 +1129,7 @@ static int ip6gre_tunnel_ioctl(struct net_device *dev,if (t) { err =0 ; +memset (&p,0 ,sizeof (p));ip6gre_tnl_parm_to_user (&p, &t->parms);if (copy_to_user (ifr->ifr_ifru.ifru_data, &p,sizeof (p))) err = -EFAULT ;
From: Cong Wang <[email protected]>
Date: Fri, 10 May 2013 15:56:37 +0800
Quoted 5 lines
There is a hole in struct
ip6_tnl_parm2, so we have to zero the struct on stack before copying it to user-space.Cc David S. Miller <[email protected]>Signed-off-by Cong Wang <[email protected]>
Applied, and queued up for -stable.