From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vasiliy Kulikov Subject: [PATCH] ipv4: netfilter: ip_tables: fix information leak to userland Date: Sat, 30 Oct 2010 18:26:50 +0400 Message-ID: <1288448810-6628-1-git-send-email-segooon@gmail.com> Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer; bh=gf6Nau6xtX3NvYO8+Guq6xDc8wfhA/s/ZroUGcWN2TM=; b=JWAyBXIzy5AKKYo3eDtxtprLaBy0bYeGEomQeODdlrnEw0m7v2lmbmrYqbq/ZvPrDa LqbwXCDpWo+h22utHL13lDD0o/aX8teJaAw0b2wvDcvT/dVBjjLBZCo3/0D+AjJBDd33 AoHnumTrs7rBMOJ3gOmhwy/R7dxHq4JcskBSk= Sender: linux-kernel-owner@vger.kernel.org List-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: kernel-janitors@vger.kernel.org Cc: Patrick McHardy , "David S. Miller" , Alexey Kuznetsov , "Pekka Savola (ipv6)" , James Morris , Hideaki YOSHIFUJI , netfilter-devel@vger.kernel.org, netfilter@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org 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 --- Compile tested. net/ipv4/netfilter/ip_tables.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c index d31b007..a846d63 100644 --- a/net/ipv4/netfilter/ip_tables.c +++ b/net/ipv4/netfilter/ip_tables.c @@ -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)); -- 1.7.0.4