From patchwork Sat Oct 30 14:26:50 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kulikov Vasiliy X-Patchwork-Id: 69660 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 09EA4B70A8 for ; Sun, 31 Oct 2010 01:27:51 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754643Ab0J3O1F (ORCPT ); Sat, 30 Oct 2010 10:27:05 -0400 Received: from mail-ey0-f174.google.com ([209.85.215.174]:51790 "EHLO mail-ey0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754221Ab0J3O04 (ORCPT ); Sat, 30 Oct 2010 10:26:56 -0400 Received: by mail-ey0-f174.google.com with SMTP id 27so2633732eye.19 for ; Sat, 30 Oct 2010 07:26:54 -0700 (PDT) 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= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=YoVNYYr62GRSbk38ZCNjqJ7yYULcDzYu3qbyPeKJ/1o2hClQeyp/kznYO3kLovDCKP iL3CDmit+A5IwtbZ2a8C1lcVZX1y/xWBIHlRIvDwQlAWk7fOFBdNM2Y5znIuk7pR01By VJL++4yerDL2gqEXgpDKGpDnGGVyFUF4yu/qQ= Received: by 10.14.37.6 with SMTP id x6mr10872600eea.13.1288448814586; Sat, 30 Oct 2010 07:26:54 -0700 (PDT) Received: from localhost (ppp91-78-210-135.pppoe.mtu-net.ru [91.78.210.135]) by mx.google.com with ESMTPS id v56sm2615265eeh.14.2010.10.30.07.26.52 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 30 Oct 2010 07:26:54 -0700 (PDT) From: Vasiliy Kulikov 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 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> X-Mailer: git-send-email 1.7.0.4 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@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));