netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Poirier <bpoirier@suse.com>
To: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Cc: Stefan Priebe <s.priebe@profihost.ag>,
	intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org,
	Paul Menzel <pmenzel@molgen.mpg.de>,
	"Neftin, Sasha" <sasha.neftin@intel.com>,
	"Brown, Aaron F" <aaron.f.brown@intel.com>,
	Stephen Hemminger <stephen@networkplumber.org>
Subject: [PATCH v2] e1000e: Don't return uninitialized stats
Date: Wed, 17 May 2017 16:24:13 -0400	[thread overview]
Message-ID: <20170517202413.18321-1-bpoirier@suse.com> (raw)
In-Reply-To: <20170425175433.ykc6ilm6uo7e6my2@f1.synalogic.ca>

Some statistics passed to ethtool are garbage because e1000e_get_stats64()
doesn't write them, for example: tx_heartbeat_errors. This leaks kernel
memory to userspace and confuses users.

Do like ixgbe and use dev_get_stats() which first zeroes out
rtnl_link_stats64.

Fixes: 5944701df90d ("net: remove useless memset's in drivers get_stats64")
Reported-by: Stefan Priebe <s.priebe@profihost.ag>
Signed-off-by: Benjamin Poirier <bpoirier@suse.com>
---

Notes:
    Changes v1->v2:
    * add the Fixes tag

 drivers/net/ethernet/intel/e1000e/ethtool.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/e1000e/ethtool.c b/drivers/net/ethernet/intel/e1000e/ethtool.c
index e23dbd9190d6..5b4d97570896 100644
--- a/drivers/net/ethernet/intel/e1000e/ethtool.c
+++ b/drivers/net/ethernet/intel/e1000e/ethtool.c
@@ -2072,7 +2072,7 @@ static void e1000_get_ethtool_stats(struct net_device *netdev,
 
 	pm_runtime_get_sync(netdev->dev.parent);
 
-	e1000e_get_stats64(netdev, &net_stats);
+	dev_get_stats(netdev, &net_stats);
 
 	pm_runtime_put_sync(netdev->dev.parent);
 
-- 
2.12.2

  reply	other threads:[~2017-05-17 20:24 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-21 21:20 [PATCH 1/2] e1000e: Don't return uninitialized stats Benjamin Poirier
2017-04-21 21:20 ` [PATCH 2/2] igb: Remove useless argument Benjamin Poirier
     [not found] ` <630A6B92B7EDEB45A87E20D3D286660171182EED@hasmsx109.ger.corp.intel.com>
2017-04-24  8:17   ` [Intel-wired-lan] [PATCH 1/2] e1000e: Don't return uninitialized stats Neftin, Sasha
2017-04-24 19:10     ` Benjamin Poirier
2017-04-25  7:10       ` Brown, Aaron F
2017-04-25  9:07         ` Jeff Kirsher
2017-04-25 17:54           ` Benjamin Poirier
2017-05-17 20:24             ` Benjamin Poirier [this message]
2017-05-18 14:46               ` [PATCH v2] " David Miller
2017-05-19  8:16                 ` Jeff Kirsher
2017-05-19 21:12                   ` Brown, Aaron F
     [not found]           ` <20170425105405.01541742@xeon-e3>
2017-04-25 18:44             ` [Intel-wired-lan] [PATCH 1/2] " Benjamin Poirier
2017-04-24  8:23 ` Paul Menzel
2017-04-24 19:01   ` Benjamin Poirier
2017-04-24 19:15     ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170517202413.18321-1-bpoirier@suse.com \
    --to=bpoirier@suse.com \
    --cc=aaron.f.brown@intel.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=pmenzel@molgen.mpg.de \
    --cc=s.priebe@profihost.ag \
    --cc=sasha.neftin@intel.com \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).