Netdev List
 help / color / mirror / Atom feed
From: Jakub Kicinski <jakub.kicinski@netronome.com>
To: Jiri Pirko <jiri@resnulli.us>
Cc: netdev@vger.kernel.org, davem@davemloft.net, idosch@mellanox.com,
	mlxsw@mellanox.com
Subject: Re: [patch net-next] devlink: disallow reload operation during device cleanup
Date: Fri, 8 Nov 2019 13:34:28 -0800	[thread overview]
Message-ID: <20191108133428.40f10fff@cakuba> (raw)
In-Reply-To: <20191108204243.7241-1-jiri@resnulli.us>

On Fri,  8 Nov 2019 21:42:43 +0100, Jiri Pirko wrote:
> From: Jiri Pirko <jiri@mellanox.com>
> 
> There is a race between driver code that does setup/cleanup of device
> and devlink reload operation that in some drivers works with the same
> code. Use after free could we easily obtained by running:
> 
> while true; do
>         echo 10 > /sys/bus/netdevsim/new_device
>         devlink dev reload netdevsim/netdevsim10 &
>         echo 10 > /sys/bus/netdevsim/del_device
> done
> 
> Fix this by enabling reload only after setup of device is complete and
> disabling it at the beginning of the cleanup process.
> 
> Reported-by: Ido Schimmel <idosch@mellanox.com>
> Fixes: 2d8dc5bbf4e7 ("devlink: Add support for reload")
> Signed-off-by: Jiri Pirko <jiri@mellanox.com>

I have no better ideas, so:

Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com>

  reply	other threads:[~2019-11-08 21:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-08 20:42 [patch net-next] devlink: disallow reload operation during device cleanup Jiri Pirko
2019-11-08 21:34 ` Jakub Kicinski [this message]
2019-11-08 22:12 ` 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=20191108133428.40f10fff@cakuba \
    --to=jakub.kicinski@netronome.com \
    --cc=davem@davemloft.net \
    --cc=idosch@mellanox.com \
    --cc=jiri@resnulli.us \
    --cc=mlxsw@mellanox.com \
    --cc=netdev@vger.kernel.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