All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: bpoirier@suse.com
Cc: pmenzel@molgen.mpg.de, jeffrey.t.kirsher@intel.com,
	netdev@vger.kernel.org, intel-wired-lan@lists.osuosl.org,
	s.priebe@profihost.ag
Subject: Re: [Intel-wired-lan] [PATCH 1/2] e1000e: Don't return uninitialized stats
Date: Mon, 24 Apr 2017 15:15:32 -0400 (EDT)	[thread overview]
Message-ID: <20170424.151532.982765506323365908.davem@davemloft.net> (raw)
In-Reply-To: <20170424190151.cbmbbeyjspoolpho@f1.synalogic.ca>

From: Benjamin Poirier <bpoirier@suse.com>
Date: Mon, 24 Apr 2017 12:01:51 -0700

> On 2017/04/24 10:23, Paul Menzel wrote:
>> Dear Benjamin,
>> 
>> 
>> Thank you for your fix.
>> 
>> On 04/21/17 23:20, Benjamin Poirier wrote:
>> > 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.
>> 
>> Could you please give specific examples to reproduce the issue? That way
>> your fix can also be tested.
>> 
> 
> Some fields in e1000_get_ethtool_stats()'s net_stats are not initialized
> by e1000e_get_stats64(). The structure is allocated on the stack,
> therefore, the value of those fields depends on previous stack content;
> that in turns depends on kernel version, compiler and previous execution
> path.

I agree.

I read over these code paths earlier today and came to the same exact
conclusion.

WARNING: multiple messages have this Message-ID (diff)
From: David Miller <davem@davemloft.net>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [PATCH 1/2] e1000e: Don't return uninitialized stats
Date: Mon, 24 Apr 2017 15:15:32 -0400 (EDT)	[thread overview]
Message-ID: <20170424.151532.982765506323365908.davem@davemloft.net> (raw)
In-Reply-To: <20170424190151.cbmbbeyjspoolpho@f1.synalogic.ca>

From: Benjamin Poirier <bpoirier@suse.com>
Date: Mon, 24 Apr 2017 12:01:51 -0700

> On 2017/04/24 10:23, Paul Menzel wrote:
>> Dear Benjamin,
>> 
>> 
>> Thank you for your fix.
>> 
>> On 04/21/17 23:20, Benjamin Poirier wrote:
>> > 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.
>> 
>> Could you please give specific examples to reproduce the issue? That way
>> your fix can also be tested.
>> 
> 
> Some fields in e1000_get_ethtool_stats()'s net_stats are not initialized
> by e1000e_get_stats64(). The structure is allocated on the stack,
> therefore, the value of those fields depends on previous stack content;
> that in turns depends on kernel version, compiler and previous execution
> path.

I agree.

I read over these code paths earlier today and came to the same exact
conclusion.

  reply	other threads:[~2017-04-24 19:15 UTC|newest]

Thread overview: 31+ 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 ` [Intel-wired-lan] " Benjamin Poirier
2017-04-21 21:20 ` [PATCH 2/2] igb: Remove useless argument Benjamin Poirier
2017-04-21 21:20   ` [Intel-wired-lan] " 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  8:17     ` Neftin, Sasha
2017-04-24 19:10     ` Benjamin Poirier
2017-04-24 19:10       ` Benjamin Poirier
2017-04-25  7:10       ` Brown, Aaron F
2017-04-25  7:10         ` Brown, Aaron F
2017-04-25  9:07         ` Jeff Kirsher
2017-04-25  9:07           ` Jeff Kirsher
2017-04-25 17:54           ` Stephen Hemminger
2017-04-25 18:44             ` Benjamin Poirier
2017-04-25 18:44               ` Benjamin Poirier
2017-04-25 17:54           ` Benjamin Poirier
2017-04-25 17:54             ` Benjamin Poirier
2017-05-17 20:24             ` [PATCH v2] " Benjamin Poirier
2017-05-17 20:24               ` [Intel-wired-lan] " Benjamin Poirier
2017-05-18 14:46               ` David Miller
2017-05-18 14:46                 ` [Intel-wired-lan] " David Miller
2017-05-19  8:16                 ` Jeff Kirsher
2017-05-19  8:16                   ` [Intel-wired-lan] " Jeff Kirsher
2017-05-19 21:12                   ` Brown, Aaron F
2017-05-19 21:12                     ` [Intel-wired-lan] " Brown, Aaron F
2017-04-24  8:23 ` [Intel-wired-lan] [PATCH 1/2] " Paul Menzel
2017-04-24  8:23   ` Paul Menzel
2017-04-24 19:01   ` Benjamin Poirier
2017-04-24 19:01     ` Benjamin Poirier
2017-04-24 19:15     ` David Miller [this message]
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=20170424.151532.982765506323365908.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=bpoirier@suse.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 \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.