]> git.baikalelectronics.ru Git - kernel.git/commit
ethtool: handle info/flash data copying outside rtnl_lock
authorJakub Kicinski <kuba@kernel.org>
Sat, 30 Oct 2021 17:18:49 +0000 (10:18 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 1 Nov 2021 13:26:07 +0000 (13:26 +0000)
commite6b162dfcf4a3bf85f36dc69190e0d3d90ea6cde
tree28b02c6b4d14e41257ee0d8883d774e17a8d290c
parent331f46b0245e87fd78d17b04cdc005c1c2071db5
ethtool: handle info/flash data copying outside rtnl_lock

We need to increase the lifetime of the data for .get_info
and .flash_update beyond their handlers inside rtnl_lock.

Allocate a union on the heap and use it instead.

Note that we now copy the ethcmd before we lookup dev,
hopefully there is no crazy user space depending on error
codes.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ethtool/ioctl.c