diff options
author | Jiri Pirko <jiri@mellanox.com> | 2019-11-09 11:29:46 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-11-20 16:48:57 +0100 |
commit | 56e6647acb69d3da9a6abe2d227bdcf6e0251146 (patch) | |
tree | fbd43a6d3e6475af3928f017b3e9875b9b4274d9 /net/ipv4/ipmr.c | |
parent | 02d391358185ac9ea51a7522561804db2fb46057 (diff) |
devlink: disallow reload operation during device cleanup
[ Upstream commit 5a508a254bed9a2e36a5fb96c9065532a6bf1e9c ]
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@mellanox.com>
Fixes: 2d8dc5bbf4e7 ("devlink: Add support for reload")
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/ipv4/ipmr.c')
0 files changed, 0 insertions, 0 deletions