summaryrefslogtreecommitdiff
path: root/net/mptcp/bpf.c
diff options
context:
space:
mode:
authorPaolo Abeni <pabeni@redhat.com>2023-10-04 23:38:11 +0300
committerJakub Kicinski <kuba@kernel.org>2023-10-05 19:34:31 +0300
commita5efdbcece83af94180e8d7c0a6e22947318499d (patch)
tree5ff63443c2832ffd7b9b644e5fefbbbd22cf36d5 /net/mptcp/bpf.c
parent3eef8555891026628aa1cc6dbc01db86df88aa26 (diff)
downloadlinux-a5efdbcece83af94180e8d7c0a6e22947318499d.tar.xz
mptcp: fix delegated action races
The delegated action infrastructure is prone to the following race: different CPUs can try to schedule different delegated actions on the same subflow at the same time. Each of them will check different bits via mptcp_subflow_delegate(), and will try to schedule the action on the related per-cpu napi instance. Depending on the timing, both can observe an empty delegated list node, causing the same entry to be added simultaneously on two different lists. The root cause is that the delegated actions infra does not provide a single synchronization point. Address the issue reserving an additional bit to mark the subflow as scheduled for delegation. Acquiring such bit guarantee the caller to own the delegated list node, and being able to safely schedule the subflow. Clear such bit only when the subflow scheduling is completed, ensuring proper barrier in place. Additionally swap the meaning of the delegated_action bitmask, to allow the usage of the existing helper to set multiple bit at once. Fixes: bcd97734318d ("mptcp: use delegate action to schedule 3rd ack retrans") Cc: stable@vger.kernel.org Reviewed-by: Mat Martineau <martineau@kernel.org> Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Mat Martineau <martineau@kernel.org> Link: https://lore.kernel.org/r/20231004-send-net-20231004-v1-1-28de4ac663ae@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/mptcp/bpf.c')
0 files changed, 0 insertions, 0 deletions