• Paolo Abeni's avatar
    mptcp: plug subflow context memory leak · 0597d0f8
    Paolo Abeni authored
    When a MPTCP listener socket is closed with unaccepted
    children pending, the ULP release callback will be invoked,
    but nobody will call into __mptcp_close_ssk() on the
    corresponding subflow.
    
    As a consequence, at ULP release time, the 'disposable' flag
    will be cleared and the subflow context memory will be leaked.
    
    This change addresses the issue always freeing the context if
    the subflow is still in the accept queue at ULP release time.
    
    Additionally, this fixes an incorrect code reference in the
    related comment.
    
    Note: this fix leverages the changes introduced by the previous
    commit.
    
    Fixes: e16163b6 ("mptcp: refactor shutdown and close")
    Reviewed-by: default avatarMatthieu Baerts <matthieu.baerts@tessares.net>
    Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    0597d0f8
subflow.c 38.6 KB