Commit b5abbf61 authored by Jakub Kicinski's avatar Jakub Kicinski
Browse files

Merge branch 'mptcp-sched-fix-some-lock-issues'

Matthieu Baerts says:

====================
mptcp: sched: fix some lock issues

Two small fixes related to the MPTCP packets scheduler:

- Patch 1: add missing rcu_read_(un)lock(). A fix for >= 6.6.

And some modifications in the MPTCP selftests:

- Patch 2: a small addition to the MPTCP selftests to cover more code.
====================

Link: https://patch.msgid.link/20241021-net-mptcp-sched-lock-v1-0-637759cf061c@kernel.org


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents b935252c 5513dc1d
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -2864,8 +2864,10 @@ static int mptcp_init_sock(struct sock *sk)
	if (unlikely(!net->mib.mptcp_statistics) && !mptcp_mib_alloc(net))
		return -ENOMEM;

	rcu_read_lock();
	ret = mptcp_init_sched(mptcp_sk(sk),
			       mptcp_sched_find(mptcp_get_scheduler(net)));
	rcu_read_unlock();
	if (ret)
		return ret;

+9 −0
Original line number Diff line number Diff line
@@ -259,6 +259,15 @@ check_mptcp_disabled()
	mptcp_lib_ns_init disabled_ns

	print_larger_title "New MPTCP socket can be blocked via sysctl"

	# mainly to cover more code
	if ! ip netns exec ${disabled_ns} sysctl net.mptcp >/dev/null; then
		mptcp_lib_pr_fail "not able to list net.mptcp sysctl knobs"
		mptcp_lib_result_fail "not able to list net.mptcp sysctl knobs"
		ret=${KSFT_FAIL}
		return 1
	fi

	# net.mptcp.enabled should be enabled by default
	if [ "$(ip netns exec ${disabled_ns} sysctl net.mptcp.enabled | awk '{ print $3 }')" -ne 1 ]; then
		mptcp_lib_pr_fail "net.mptcp.enabled sysctl is not 1 by default"