In the Linux kernel, the following vulnerability has been resolved:
mptcp: pm: only decrement addaddraccepted for MPJ req
Adding the following warning ...
WARNONONCE(msk->pm.addaddraccepted == 0)
... before decrementing the addaddraccepted counter helped to find a bug when running the "remove single subflow" subtest from the mptcp_join.sh selftest.
Removing a 'subflow' endpoint will first trigger a RMADDR, then the subflow closure. Before this patch, and upon the reception of the RMADDR, the other peer will then try to decrement this addaddraccepted. That's not correct because the attached subflows have not been created upon the reception of an ADD_ADDR.
A way to solve that is to decrement the counter only if the attached subflow was an MPJOIN to a remote id that was not 0, and initiated by the host receiving the RMADDR.