Skip to content

net: Backport data race annotations in the networking stack (part 1).

Guillaume Nault requested to merge gnault/centos-stream-9:bz2149949 into main

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2149949 Upstream Status: linux.git Conflicts: Few minor conflicts, see description in affected commits.

Properly mark concurent reads and writes with READ_ONCE() and WRITE_ONCE() in various parts of the networking stack. This is a backport of the following upstream patch series:

  • Patch set A: merge commit e97e68b56e78 ("Merge branch 'sk_bound_dev_if-annotations'")
  • Patch set B: merge commit 32b3ad1418ea ("Merge branch 'sysctl-data-races'")
  • Patch set C: merge commit 7d5424b26f17 ("Merge branch 'net-sysctl-races'")
  • Patch set D: merge commit 782d86fe44e3 ("Merge branch 'net-sysctl-races-round2'")
  • Patch set E: merge commit c9f21106d97b ("Merge branch 'net-ipv4-sysctl-races-part-3'")

Patch 1 is a standalone READ_ONCE() annotation for sk->sk_bound_dev_if. It's a prerequisite for correctly backporting patch set A.

Patches 2-9 are backports of patch set A. The following upstream patches have been omitted since they're already in Centos Stream:

  • Upstream commit a20ea298071f ("sctp: read sk->sk_bound_dev_if once
    in sctp_rcv()"), backported by Centos Stream commit 5d539b85.

  • Upstream commit 70f87de9fa0d ("net_sched: em_meta: add READ_ONCE()
    in var_sk_bound_if()"), backported by Centos Stream commit 866ca288.

Patch 10 was in the original upstream series of patch set B, but was resubmitted independently as that series was reworked before being applied. Therefore, it doesn't strictly belong to patch set B, but is closely related to it and is thus backported here.

Patches 11-21 are backports of patch set B. The following upstream patch has been omitted since it's already in Centos Stream:

  • Upstream commit 310731e2f161 ("net: Fix data-races around
    sysctl_mem.", backported by Centos Stream commit a99b2cb4.

Patches 22-36 are backports corresponding to patch set C.

Patches 37-51 are backports corresponding to patch set D.

Patches 52-66 are backports corresponding to patch set E.

Signed-off-by: Guillaume Nault gnault@redhat.com

Edited by Guillaume Nault

Merge request reports