ipv4: netfilter: ip_tables: fix information leak to userland
authorVasiliy Kulikov <segooon@gmail.com>
Wed, 3 Nov 2010 07:45:06 +0000 (08:45 +0100)
committerPatrick McHardy <kaber@trash.net>
Wed, 3 Nov 2010 07:45:06 +0000 (08:45 +0100)
Structure ipt_getinfo is copied to userland with the field "name"
that has the last elements unitialized.  It leads to leaking of
contents of kernel stack memory.

Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
net/ipv4/netfilter/ip_tables.c

index d31b007a6d80dcda45f7f7913ec72af7556b79bf..a846d633b3b6f04a3ed72be1d884e484d3efa030 100644 (file)
@@ -1124,6 +1124,7 @@ static int get_info(struct net *net, void __user *user,
                        private = &tmp;
                }
 #endif
+               memset(&info, 0, sizeof(info));
                info.valid_hooks = t->valid_hooks;
                memcpy(info.hook_entry, private->hook_entry,
                       sizeof(info.hook_entry));