Closed cpaasch closed 3 years ago
mptcp_incoming_options+0x1c00/0x1e20 net/mptcp/options.c:1064
This is: if (mp_opt.data_fin && mp_opt.data_len == 1 && mptcp_update_rcv_data_fin(msk, mp_opt.data_seq, mp_opt.dsn64) && schedule_work(&msk->work)) sock_hold(subflow->conn); // ^^^^^^^^^ here
The subflow is not in CLOSED, SYN_SENT or SYN_RECV state, because the caller is tcp_rcv_state_process():
case TCP_ESTABLISHED:
tcp_data_queue(sk, skb);
queued = 1;
And there are a few 'fallback' statement above from the non mentioned status possibly leading to that call.
The reference to subflow->conn held by the subflow is released via ulp_release by inet_csk_destroy_sock(), which in turn can happen only if the ssk is in CLOSE state.
Additionally the msk memory is touched just before the reported splat, by schedule_work, apparently without KASAN complain for UaF.
@cpaasch: any luck for reproducer here? How easily could you trigger this one?
No, no reproducer yet
From the weekly meeting we just had:
HEAD: f4cf537c3f63 ("mptcp: init mptcp request socket earlier") (HEAD) (5 days ago)
10f1569c7d9b ("mptcp: fix spurious retransmissions") (5 days ago)
92eab0bc98bc ("DO-NOT-MERGE: mptcp: enabled by default") (tag: export/20210203T131132, mptcp_net-next/export) (5 days ago)
6cf73008bc8e ("DO-NOT-MERGE: mptcp: add GitHub Actions") (5 days ago)
26c89a55761f ("DO-NOT-MERGE: mptcp: use kmalloc on kasan build") (5 days ago)
6fd2b70123c3 ("mptcp: fix poll after shutdown") (5 days ago)
624d226e9b65 ("mptcp: deliver ssk errors to msk") (5 days ago)
8e1559ffe592 ("mptcp: add netlink event support") (5 days ago)
68f9ec0be460 ("genetlink: add CAP_NET_ADMIN test for multicast bind") (5 days ago)
049f222a9341 ("mptcp: avoid lock_fast usage in accept path") (5 days ago)
c9997603655d ("mptcp: pass subflow socket to a few helpers") (5 days ago)
18bcdcc18477 ("mptcp: split __mptcp_close_ssk helper") (5 days ago)
8e7a8bb523ae ("mptcp: move pm netlink work into pm_netlink") (5 days ago)
2317a88153e3 ("mptcp: pm: add lockdep assertions") (5 days ago)
e257fdaa8f30 ("selftests: mptcp: add command line arguments for mptcp_join.sh") (5 days ago)
518108eb812b ("bpf:selftests: add bpf_mptcp_sock() verifier tests") (5 days ago)
e739cc369933 ("bpf:selftests: add MPTCP test base") (5 days ago)
9e0cb69ba779 ("bpf: add 'bpf_mptcp_sock' structure and helper") (5 days ago)
31bcc185a353 ("bpf: expose is_mptcp flag to bpf_tcp_sock") (5 days ago)
4b4b5dc1f318 ("linux: handle MPTCP consistently with TCP") (5 days ago)
32d1bbb1d609 ("net: fec: Silence M5272 build warnings") (mptcp_net-next/net-next) (6 days ago)
fca23f37f3a7 ("inet: do not export inetgro{receive|complete}") (6 days ago)
0256317a6151 ("Merge tag 'mac80211-next-for-net-next-2021-02-02' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next") (6 days ago)
CONFIG-file: CONFIG.txt