Netdev List
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: jiri@resnulli.us
Cc: netdev@vger.kernel.org, xemul@virtuozzo.com, edumazet@google.com,
	pabeni@redhat.com, idosch@mellanox.com, petrm@mellanox.com,
	sd@queasysnail.net, f.fainelli@gmail.com,
	stephen@networkplumber.org, mlxsw@mellanox.com,
	jiri@mellanox.com
Subject: Re: [patch net] net: fix ifindex collision during namespace removal
Date: Mon, 29 Jul 2019 11:08:07 -0700 (PDT)	[thread overview]
Message-ID: <20190729.110807.1476818178420042682.davem@davemloft.net> (raw)
In-Reply-To: <20190728125636.13895-1-jiri@resnulli.us>

From: Jiri Pirko <jiri@resnulli.us>
Date: Sun, 28 Jul 2019 14:56:36 +0200

> From: Jiri Pirko <jiri@mellanox.com>
> 
> Commit aca51397d014 ("netns: Fix arbitrary net_device-s corruptions
> on net_ns stop.") introduced a possibility to hit a BUG in case device
> is returning back to init_net and two following conditions are met:
> 1) dev->ifindex value is used in a name of another "dev%d"
>    device in init_net.
> 2) dev->name is used by another device in init_net.
> 
> Under real life circumstances this is hard to get. Therefore this has
> been present happily for over 10 years. To reproduce:
 ...
> Fix this by checking if a device with the same name exists in init_net
> and fallback to original code - dev%d to allocate name - in case it does.
> 
> This was found using syzkaller.
> 
> Fixes: aca51397d014 ("netns: Fix arbitrary net_device-s corruptions on net_ns stop.")
> Signed-off-by: Jiri Pirko <jiri@mellanox.com>

Very interesting :)

Applied and queued up for -stable, thanks.

      reply	other threads:[~2019-07-29 18:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-28 12:56 [patch net] net: fix ifindex collision during namespace removal Jiri Pirko
2019-07-29 18:08 ` David Miller [this message]

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=20190729.110807.1476818178420042682.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=idosch@mellanox.com \
    --cc=jiri@mellanox.com \
    --cc=jiri@resnulli.us \
    --cc=mlxsw@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=petrm@mellanox.com \
    --cc=sd@queasysnail.net \
    --cc=stephen@networkplumber.org \
    --cc=xemul@virtuozzo.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