linux_old1/net/mptcp
Paolo Abeni 6aeed90450 mptcp: fix race on unaccepted mptcp sockets
When the listener socket owning the relevant request is closed,
it frees the unaccepted subflows and that causes later deletion
of the paired MPTCP sockets.

The mptcp socket's worker can run in the time interval between such delete
operations. When that happens, any access to msk->first will cause an UaF
access, as the subflow cleanup did not cleared such field in the mptcp
socket.

Address the issue explicitly traversing the listener socket accept
queue at close time and performing the needed cleanup on the pending
msk.

Note that the locking is a bit tricky, as we need to acquire the msk
socket lock, while still owning the subflow socket one.

Fixes: 86e39e0448 ("mptcp: keep track of local endpoint still available for each msk")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2022-06-28 20:45:42 -07:00
..
Kconfig kunit: mptcp: adhere to KUNIT formatting standard 2021-04-16 17:10:40 -07:00
Makefile Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2022-05-23 16:07:14 -07:00
bpf.c bpf: Add bpf_skc_to_mptcp_sock_proto 2022-05-20 15:29:00 -07:00
crypto.c kunit: mptcp: adhere to KUNIT formatting standard 2021-04-16 17:10:40 -07:00
crypto_test.c mptcp: move crypto test to KUNIT 2020-06-26 16:21:39 -07:00
ctrl.c mptcp: Add a per-namespace sysctl to set the default path manager type 2022-04-29 17:25:14 -07:00
diag.c mptcp: allow dumping subflow context to userspace 2020-03-29 22:14:48 -07:00
mib.c mptcp: add more offered MIBs counter 2022-05-05 19:00:16 -07:00
mib.h mptcp: add more offered MIBs counter 2022-05-05 19:00:16 -07:00
mptcp_diag.c net: inet: Retire port only listening_hash 2022-05-12 16:52:18 -07:00
options.c mptcp: fix shutdown vs fallback race 2022-06-28 20:45:42 -07:00
pm.c mptcp: invoke MP_FAIL response when needed 2022-06-28 20:45:42 -07:00
pm_netlink.c mptcp: netlink: allow userspace-driven subflow establishment 2022-05-04 10:49:32 +01:00
pm_userspace.c mptcp: netlink: allow userspace-driven subflow establishment 2022-05-04 10:49:32 +01:00
protocol.c mptcp: fix race on unaccepted mptcp sockets 2022-06-28 20:45:42 -07:00
protocol.h mptcp: fix race on unaccepted mptcp sockets 2022-06-28 20:45:42 -07:00
sockopt.c mptcp: sockopt: add TCP_DEFER_ACCEPT support 2022-05-16 13:11:31 -07:00
subflow.c mptcp: fix race on unaccepted mptcp sockets 2022-06-28 20:45:42 -07:00
syncookies.c mptcp: don't return sockets in foreign netns 2021-09-24 10:51:36 +01:00
token.c mptcp: full disconnect implementation 2022-01-07 11:27:06 +00:00
token_test.c mptcp: don't return sockets in foreign netns 2021-09-24 10:51:36 +01:00