Commit 5a5246bb authored by Rusty Russell's avatar Rusty Russell Committed by David S. Miller

[NETFILTER]: Fix stack leakage in iptables

Found running netfilter code under valgrind: we return some
uninitialized stack to userspace (needs root).  Almost certainly
harmless, but this suppressed the valgrind complaint, and
doesn't hurt.
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a2d21502
...@@ -1292,7 +1292,7 @@ do_ipt_get_ctl(struct sock *sk, int cmd, void __user *user, int *len) ...@@ -1292,7 +1292,7 @@ do_ipt_get_ctl(struct sock *sk, int cmd, void __user *user, int *len)
sizeof(info.underflow)); sizeof(info.underflow));
info.num_entries = t->private->number; info.num_entries = t->private->number;
info.size = t->private->size; info.size = t->private->size;
strcpy(info.name, name); memcpy(info.name, name, sizeof(info.name));
if (copy_to_user(user, &info, *len) != 0) if (copy_to_user(user, &info, *len) != 0)
ret = -EFAULT; ret = -EFAULT;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment