[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20191109.194019.359068420637293689.davem@davemloft.net>
Date: Sat, 09 Nov 2019 19:40:19 -0800 (PST)
From: David Miller <davem@...emloft.net>
To: jiri@...nulli.us
Cc: netdev@...r.kernel.org, jakub.kicinski@...ronome.com,
idosch@...lanox.com, mlxsw@...lanox.com
Subject: Re: [patch net] devlink: disallow reload operation during device
cleanup
From: Jiri Pirko <jiri@...nulli.us>
Date: Sat, 9 Nov 2019 11:29:46 +0100
> From: Jiri Pirko <jiri@...lanox.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 "0000:00:10.0" >/sys/bus/pci/drivers/mlxsw_spectrum2/bind
> devlink dev reload pci/0000:00:10.0 &
> echo "0000:00:10.0" >/sys/bus/pci/drivers/mlxsw_spectrum2/unbind
> 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@...lanox.com>
> Fixes: 2d8dc5bbf4e7 ("devlink: Add support for reload")
> Signed-off-by: Jiri Pirko <jiri@...lanox.com>
> ---
> This is -net version of fix, net-next fix was sent and is already applied.
> Also note that unlike net-next, in -net this is not reproducible with
> netdevsim, so the reproducer uses mlxsw driver instead. That is the only
> difference in the patch desctiption.
Applied and queued up for -stable.
Powered by blists - more mailing lists