mptcp: subflow context lifetime fixes
Get series with b4
b4 am pm-mptcp-objects-candidate-0010-v3-14c229ea28a7d31f60a0-0@gmail.comVersions newest first
- v1 Latest2 patches 0 repliesNew
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | mptcp: keep delegated subflow contexts alive until socket releasenet/ net/ net/ | +64 | 0 replies | |
| 2/2 | mptcp: release the parent socket reference with the subflow contextnet/ | +5 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH net 0/2] mptcp: subflow context lifetime fixes
Two use-after-free fixes around the lifetime of the MPTCP subflow context, both found with KASAN.
The delegated-action queue pins the TCP subflow socket, but its queue entry is embedded in the separately allocated subflow context, which the ULP release frees on its own. Patch 1 keeps a retired context attached to its socket until the socket is destroyed, and lets NAPI free a context that the plain-TCP fallback dropped while it was still queued.
That context also owns the only reference a holder of the TCP child has on the MPTCP parent. Patch 2 moves that release to the same socket destructor. This covers a BPF program that converted a TCP child with bpf_skc_to_mptcp_sock() as well as a delegated action that updates the parent after the ULP was released. It depends on patch 1, also for stable backports.
Cen Zhang (2):
mptcp: keep delegated subflow contexts alive until socket release
mptcp: release the parent socket reference with the subflow context
net/mptcp/protocol.c | 18 +++++++++++++++- net/mptcp/protocol.h | 8 +++++-- net/mptcp/subflow.c | 51 +++++++++++++++++++++++++++++++++++++++----- 3 files changed, 69 insertions(+), 8 deletions(-)
---