net-sysfs: take the rtnl lock when accessing xps_rxqs_map and num_tc
authorAntoine Tenart <atenart@kernel.org>
Wed, 23 Dec 2020 21:23:23 +0000 (22:23 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Jan 2021 19:18:11 +0000 (20:18 +0100)
commite4535dbb721d0346f6a7ee6b6cbaf517cb96dbcb
tree06fe4ec277b6ed8ed92cda10f3d3e87c42ec9b48
parent90297553d870bd103687bd802d117c8a06808a49
net-sysfs: take the rtnl lock when accessing xps_rxqs_map and num_tc

[ Upstream commit 4ae2bb81649dc03dfc95875f02126b14b773f7ab ]

Accesses to dev->xps_rxqs_map (when using dev->num_tc) should be
protected by the rtnl lock, like we do for netif_set_xps_queue. I didn't
see an actual bug being triggered, but let's be safe here and take the
rtnl lock while accessing the map in sysfs.

Fixes: 8af2c06ff4b1 ("net-sysfs: Add interface for Rx queue(s) map per Tx queue")
Signed-off-by: Antoine Tenart <atenart@kernel.org>
Reviewed-by: Alexander Duyck <alexanderduyck@fb.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/core/net-sysfs.c