Skip to content

mptcp: disallow setting the MPTCP ULP from userspace

Davide Caratti mptcp 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 2 repliesIn review
  2. v12 patches 8 repliesSuperseded

Changes in v2 from the cover letter

- don't redirect the selftest output to /dev/null
- test output depends on the value of 'errno', to avoid false negative in case kernel is built without CONFIG_MPTCP

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2mptcp: subflow: disallow setsockopt(... TCP_ULP, "mptcp")net/mptcp/subflow.c+7 -00 replies
2/2selftests: test setsockopt(..., TCP_ULP, "mptcp", ...)tools/testing/selftests/net/mptcp/mptcp_connect.c tools/testing/selftests/net/mptcp/mptcp_connect.sh+68 -30 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [MPTCP] [PATCH v2 0/2] mptcp: disallow setting the MPTCP ULP from userspace

with this series we make

setscokopt(..., IPPROTO_TCP, TCP_ULP, "mptcp", sizeof("mptcp"));

return -1 and set errno to -EOPNOPSUPPORT.

this allows attaching MPTCP ULP only to a TCP socket that has been created through sock_create_kern().

- Patch 1/2 lets subflow_init() fail with -EOPNOTSUPPORT in case users try to setsockopt(..., TCP_ULP) on a TCP socket that has been created by a userspace program. I suggest squashing this patch in "mptcp:
Associate MPTCP context with TCP socket".
- Patch 2/2 includes kselftest code. I suggest squashing it with "mptcp:
add basic kselftest for mptcp".

Changes since v1:
- don't redirect the selftest output to /dev/null
- test output depends on the value of 'errno', to avoid false negative in case kernel is built without CONFIG_MPTCP

Davide Caratti (2):
mptcp: subflow: disallow setsockopt(... TCP_ULP, "mptcp")
selftests: test setsockopt(..., TCP_ULP, "mptcp", ...)

 net/mptcp/subflow.c                           |  7 +++
 .../selftests/net/mptcp/mptcp_connect.c       | 52 +++++++++++++++++--
 .../selftests/net/mptcp/mptcp_connect.sh      | 19 +++++++
 3 files changed, 75 insertions(+), 3 deletions(-)
Signature · 1 line
2.21.0