From patchwork Fri Oct 11 09:50:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 282557 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 484B62C00E7 for ; Fri, 11 Oct 2013 20:50:36 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757440Ab3JKJuW (ORCPT ); Fri, 11 Oct 2013 05:50:22 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:42400 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757327Ab3JKJuT (ORCPT ); Fri, 11 Oct 2013 05:50:19 -0400 Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by aserp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r9B9o4Zu018804 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 11 Oct 2013 09:50:05 GMT Received: from aserz7022.oracle.com (aserz7022.oracle.com [141.146.126.231]) by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r9B9o2PZ025539 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 11 Oct 2013 09:50:03 GMT Received: from abhmt113.oracle.com (abhmt113.oracle.com [141.146.116.65]) by aserz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r9B9o2cY014906; Fri, 11 Oct 2013 09:50:02 GMT Received: from mwanda (/41.202.233.186) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 11 Oct 2013 02:50:02 -0700 Date: Fri, 11 Oct 2013 12:50:03 +0300 From: Dan Carpenter To: Kevin Curtis Cc: Salva =?iso-8859-1?Q?Peir=F3?= , security@kernel.org, netdev@vger.kernel.org Subject: [patch] farsync: fix info leak in ioctl Message-ID: <20131011095003.GD6247@mwanda> References: <5257BFBA.7030405@ai2.upv.es> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <5257BFBA.7030405@ai2.upv.es> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: ucsinet22.oracle.com [156.151.31.94] Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Salva Peiró The fst_get_iface() code fails to initialize the two padding bytes of struct sync_serial_settings after the ->loopback member. Add an explicit memset(0) before filling the structure to avoid the info leak. Signed-off-by: Dan Carpenter --- linux-3.4-xm/drivers/net/wan/farsync.c | 1 + 1 file changed, 1 insertion(+) diff --git a/linux-3.4-xm/drivers/net/wan/farsync.c b/linux-3.4-xm/drivers/net/wan/farsync.c index 1a62318..3710427 100644 --- a/drivers/net/wan/farsync.c +++ b/drivers/net/wan/farsync.c @@ -1972,6 +1972,7 @@ fst_get_iface(struct fst_card_info *card, struct fst_port_info *port, } i = port->index; + memset(&sync, 0, sizeof(sync)); sync.clock_rate = FST_RDL(card, portConfig[i].lineSpeed); /* Lucky card and linux use same encoding here */ sync.clock_type = FST_RDB(card, portConfig[i].internalClock) ==