linux-stable/include
Jiri Pirko a0c76345e3 devlink: disallow reload operation during device cleanup
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: 2d8dc5bbf4 ("devlink: Add support for reload")
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-11-08 14:11:47 -08:00
..
acpi cpufreq: Use per-policy frequency QoS 2019-10-21 02:05:21 +02:00
asm-generic Merge branch 'next-lockdown' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security 2019-09-28 08:14:15 -07:00
clocksource
crypto Merge branch 'next-integrity' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity 2019-09-27 19:37:27 -07:00
drm drm: Measure Self Refresh Entry/Exit times to avoid thrashing 2019-09-19 10:03:32 -04:00
dt-bindings dt-bindings: net: phy: Add support for AT803X 2019-11-06 21:42:06 -08:00
keys
kvm
linux net: add a READ_ONCE() in skb_peek_tail() 2019-11-07 20:08:14 -08:00
math-emu
media
misc
net devlink: disallow reload operation during device cleanup 2019-11-08 14:11:47 -08:00
pcmcia
ras
rdma RDMA/uverbs: Prevent potential underflow 2019-10-22 15:05:36 -03:00
scsi SCSI fixes on 20191015 2019-10-15 12:19:08 -07:00
soc dpaa_eth: register a device link for the qman portal used 2019-10-31 12:13:34 -07:00
sound ASoC: Fixes for v5.4 2019-10-21 14:05:26 +02:00
target
trace Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-11-02 13:54:56 -07:00
uapi tipc: add support for AEAD key setting via netlink 2019-11-08 14:01:59 -08:00
vdso
video
xen xen: fixes and cleanups for 5.4-rc2 2019-10-04 11:13:09 -07:00
Kbuild - New Drivers 2019-09-23 19:37:49 -07:00