Skip to content

net-sysfs: fix race conditions in the xps code

Antoine Tenart netdev 3 versions – Applied

Status from this message: Applied, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest4 patches 2 repliesApplied
  2. v23 patches 12 repliesSuperseded
  3. v14 patches 5 repliesSuperseded

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/4net-sysfs: take the rtnl lock when storing xps_cpusnet/core/net-sysfs.c+6 -00 replies
2/4net-sysfs: take the rtnl lock when accessing xps_cpus_map and num_tcnet/core/net-sysfs.c+22 -70 replies
3/4net-sysfs: take the rtnl lock when storing xps_rxqsnet/core/net-sysfs.c+7 -00 replies
4/4net-sysfs: take the rtnl lock when accessing xps_rxqs_map and num_tcnet/core/net-sysfs.c+18 -50 replies

Reviews trailers per patch

None of the 4 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchAlexander Duyck
SeriesR-b
1/4
2/4
3/4
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH net v3 0/4] net-sysfs: fix race conditions in the xps code

Hello all,

This series fixes race conditions in the xps code, where out of bound accesses can occur when dev->num_tc is updated, triggering oops. The root cause is linked to locking issues. An explanation is given in each of the commit logs.

We had a discussion on the v1 of this series about using the xps_map mutex instead of the rtnl lock. While that seemed a better compromise, v2 showed the added complexity wasn't best for fixes. So we decided to go back to v1 and use the rtnl lock.

Because of this, the only differences between v1 and v3 are improvements in the commit messages.

Thanks!
Antoine

Antoine Tenart (4):
net-sysfs: take the rtnl lock when storing xps_cpus
net-sysfs: take the rtnl lock when accessing xps_cpus_map and num_tc
net-sysfs: take the rtnl lock when storing xps_rxqs
net-sysfs: take the rtnl lock when accessing xps_rxqs_map and num_tc

 net/core/net-sysfs.c | 65 ++++++++++++++++++++++++++++++++++++--------
 1 file changed, 53 insertions(+), 12 deletions(-)
Signature · 1 line
2.29.2