]> git.baikalelectronics.ru Git - kernel.git/commit
netdevsim: take rtnl_lock when assigning num_vfs
authorJakub Kicinski <kuba@kernel.org>
Sat, 30 Oct 2021 23:15:01 +0000 (16:15 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 1 Nov 2021 13:29:41 +0000 (13:29 +0000)
commit9ed65b7b5f39373043b5dd6f011bdabdffbf45ea
treef74f0aacd8288855cdcbc2a3fba5739f0892d682
parentac27d1f23517e4e9dc39e81ea1f149c44161849e
netdevsim: take rtnl_lock when assigning num_vfs

Legacy VF NDOs look at num_vfs and then based on that
index into vfconfig. If we don't rtnl_lock() num_vfs
may get set to 0 and vfconfig freed/replaced while
the NDO is running.

We don't need to protect replacing vfconfig since it's
only done when num_vfs is 0.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/netdevsim/bus.c