Skip to contentSkip to conversation

ipv4: netfilter: ip_tables: fix information leak to userland

PATCH In review Vasiliy Kulikov 2 participants 2 messages Oct 30, 2010 – Nov 3, 2010

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ipv4: netfilter: ip_tables: fix information leak to userland

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.

---
Compile tested.

 net/ipv4/netfilter/ip_tables.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
net/ipv4/netfilter/ip_tables.c +1 -0
index d31b007..a846d63 100644
@@ -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));
Signature · 1 line
1.7.0.4
#1 lore raw
Quoted 3 lines · Vasiliy Kulikov

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.

Also applied, thanks.