public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <erdnetdev@gmail.com>
To: Ben Hutchings <bhutchings@solarflare.com>
Cc: Tom Parkin <tparkin@katalix.com>,
	David Miller <davem@davemloft.net>,
	netdev <netdev@vger.kernel.org>
Subject: Re: NULL pointer dereference in veth_stats_one
Date: Fri, 04 Jan 2013 11:23:26 -0800	[thread overview]
Message-ID: <1357327406.1678.2139.camel@edumazet-glaptop> (raw)
In-Reply-To: <1357323443.2693.9.camel@bwh-desktop.uk.solarflarecom.com>

On Fri, 2013-01-04 at 18:17 +0000, Ben Hutchings wrote:

> This possibly needs some memory barriers to properly synchronise with
> veth_newlink().  But can you not move initialisation of the peer
> pointers before registration of the devices in veth_newlink(), so that
> veth_get_stats64() cannot be called before they are initialised?

The ->peer pointer cannot change once set. ( its never cleared )

So the problem would not be in veth_newlink(), but might be in
veth_dellink()

It seems we would have a problem in veth_get_ethtool_stats() already...

More generally, what prevents a get_stats() being called while a
dellink() (-> veth_dev_free() -> free_percpu()) is done ?

(Same thing is done for tunnel/dummy stats percpu data)

  reply	other threads:[~2013-01-04 19:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-04 10:59 NULL pointer dereference in veth_stats_one Tom Parkin
2013-01-04 15:45 ` Eric Dumazet
2013-01-04 16:17   ` Eric Dumazet
2013-01-04 18:17     ` Ben Hutchings
2013-01-04 19:23       ` Eric Dumazet [this message]
2013-01-04 20:25         ` Ben Hutchings
2013-01-05  1:42           ` Eric Dumazet
2013-01-08  3:43             ` 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=1357327406.1678.2139.camel@edumazet-glaptop \
    --to=erdnetdev@gmail.com \
    --cc=bhutchings@solarflare.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=tparkin@katalix.com \
    /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