02 Aug, 2020

1 commit

  • kernel test robot says:
    net/mptcp/syncookies.c: In function 'mptcp_join_cookie_init':
    include/linux/kernel.h:47:38: warning: division by zero [-Wdiv-by-zero]
    #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))

    I forgot that spinock_t size is 0 on UP, so ARRAY_SIZE cannot be used.

    Fixes: 9466a1ccebbe54 ("mptcp: enable JOIN requests even if cookies are in use")
    Reported-by: kernel test robot
    Signed-off-by: Florian Westphal
    Signed-off-by: David S. Miller

    Florian Westphal
     

01 Aug, 2020

1 commit

  • JOIN requests do not work in syncookie mode -- for HMAC validation, the
    peers nonce and the mptcp token (to obtain the desired connection socket
    the join is for) are required, but this information is only present in the
    initial syn.

    So either we need to drop all JOIN requests once a listening socket enters
    syncookie mode, or we need to store enough state to reconstruct the request
    socket later.

    This adds a state table (1024 entries) to store the data present in the
    MP_JOIN syn request and the random nonce used for the cookie syn/ack.

    When a MP_JOIN ACK passed cookie validation, the table is consulted
    to rebuild the request socket from it.

    An alternate approach would be to "cancel" syn-cookie mode and force
    MP_JOIN to always use a syn queue entry.

    However, doing so brings the backlog over the configured queue limit.

    v2: use req->syncookie, not (removed) want_cookie arg

    Suggested-by: Paolo Abeni
    Signed-off-by: Florian Westphal
    Reviewed-by: Mat Martineau
    Signed-off-by: David S. Miller

    Florian Westphal