summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmerigo Wang <amwang@redhat.com>2013-05-09 21:56:37 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-05-19 11:38:38 -0700
commit35dc0c576d03f49729e2429c43a96f0f09f9a1e9 (patch)
treec578b8079b7fb4fade328ad765b823497bcadd98
parent285665993541f4f9d8bf80db6d7d27b205aa78b9 (diff)
downloadlwn-35dc0c576d03f49729e2429c43a96f0f09f9a1e9.tar.gz
lwn-35dc0c576d03f49729e2429c43a96f0f09f9a1e9.zip
ipv6,gre: do not leak info to user-space
[ Upstream commit 5dbd5068430b8bd1c19387d46d6c1a88b261257f ] 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 <davem@davemloft.net> Signed-off-by: Cong Wang <amwang@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--net/ipv6/ip6_gre.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c
index e4efffe2522e..95d13c76d316 100644
--- a/net/ipv6/ip6_gre.c
+++ b/net/ipv6/ip6_gre.c
@@ -1135,6 +1135,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;
@@ -1182,6 +1183,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;