• Paolo Abeni's avatar
    mptcp: fix rcv space initialization · 013e3179
    Paolo Abeni authored
    mptcp_rcv_space_init() is supposed to happen under the msk socket
    lock, but active msk socket does that without such protection.
    
    Leverage the existing mptcp_propagate_state() helper to that extent.
    We need to ensure mptcp_rcv_space_init will happen before
    mptcp_rcv_space_adjust(), and the release_cb does not assure that:
    explicitly check for such condition.
    
    While at it, move the wnd_end initialization out of mptcp_rcv_space_init(),
    it never belonged there.
    
    Note that the race does not produce ill effect in practice, but
    change allows cleaning-up and defying better the locking model.
    
    Fixes: a6b118fe ("mptcp: add receive buffer auto-tuning")
    Cc: stable@vger.kernel.org
    Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
    Reviewed-by: default avatarMat Martineau <martineau@kernel.org>
    Signed-off-by: default avatarMatthieu Baerts (NGI0) <matttbe@kernel.org>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    013e3179
protocol.h 35.2 KB