]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net-sysfs: take the rtnl lock when accessing xps_cpus_map and num_tc
authorAntoine Tenart <atenart@kernel.org>
Wed, 23 Dec 2020 21:23:21 +0000 (22:23 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Jan 2021 19:10:18 +0000 (20:10 +0100)
commitbd7233f43b4526ccf7ef34e9e244dd56926f32c6
tree7c44818897008d1017e6588b373a29ce8bf0318a
parentbbebd73855f1778b8fd0e6f76aa627b9448c3dad
net-sysfs: take the rtnl lock when accessing xps_cpus_map and num_tc

[ Upstream commit fb25038586d0064123e393cadf1fadd70a9df97a ]

Accesses to dev->xps_cpus_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: 184c449f91fe ("net: Add support for XPS with QoS via traffic classes")
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