From patchwork Fri Jul 13 16:55:29 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Duyck, Alexander H" X-Patchwork-Id: 170934 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 4F3F02C0305 for ; Sat, 14 Jul 2012 02:55:13 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933344Ab2GMQzK (ORCPT ); Fri, 13 Jul 2012 12:55:10 -0400 Received: from mga09.intel.com ([134.134.136.24]:41699 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757109Ab2GMQzI (ORCPT ); Fri, 13 Jul 2012 12:55:08 -0400 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 13 Jul 2012 09:55:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.67,351,1309762800"; d="scan'208";a="171525963" Received: from gitlad.jf.intel.com ([10.23.153.32]) by orsmga002.jf.intel.com with ESMTP; 13 Jul 2012 09:55:07 -0700 Received: from gitlad.jf.intel.com (gitlad.jf.intel.com [127.0.0.1]) by gitlad.jf.intel.com (8.14.2/8.14.2) with ESMTP id q6DGtTYB028178; Fri, 13 Jul 2012 09:55:29 -0700 From: Alexander Duyck Subject: [ethtool PATCH] ethtool: Resolve use of uninitialized memory in rxclass_get_dev_info To: netdev@vger.kernel.org, bhutchings@solarflare.com Cc: jeffrey.t.kirsher@intel.com Date: Fri, 13 Jul 2012 09:55:29 -0700 Message-ID: <20120713165221.28140.92681.stgit@gitlad.jf.intel.com> User-Agent: StGIT/0.14.2 MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The ethtool function for getting the rule count was not zeroing out the data field before passing it to the kernel. As a result the value started uninitialized and was incorrectly returning a result indicating that devices supported setting new rule indexes. In order to correct this I am adding a one line fix that sets data to zero before we pass the command to the kernel. Signed-off-by: Alexander Duyck --- I am resending this since I didn't see any notification that it had been seen. I also realized that I had not clearly identified that this is an ethtool user space patch and not an ethtool kernel space patch. rxclass.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/rxclass.c b/rxclass.c index 4d49aa6..e1633a8 100644 --- a/rxclass.c +++ b/rxclass.c @@ -207,6 +207,7 @@ static int rxclass_get_dev_info(struct cmd_context *ctx, __u32 *count, int err; nfccmd.cmd = ETHTOOL_GRXCLSRLCNT; + nfccmd.data = 0; err = send_ioctl(ctx, &nfccmd); *count = nfccmd.rule_cnt; if (driver_select)