All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH mptcp-next] Squash to "bpf: Add mptcp_subflow bpf_iter"
@ 2025-02-26 18:07 Matthieu Baerts (NGI0)
  2025-02-26 19:17 ` MPTCP CI
  2025-02-27  2:03 ` Geliang Tang
  0 siblings, 2 replies; 10+ messages in thread
From: Matthieu Baerts (NGI0) @ 2025-02-26 18:07 UTC (permalink / raw)
  To: MPTCP Upstream; +Cc: Matthieu Baerts (NGI0), Geliang Tang, Mat Martineau

From what we understood, when being used from a CG [gs]etsockopt hook,
the socket lock will be held. It seems that the BPF infra will make sure
in this case. Mat will try to get the confirmation.

The idea is then to add this msk_owned_by_me() check to make sure the
assumption is correct, and will continue to be: the new selftest should
complain if not when used with a debug kconfig. In other words, if the
tests continue to pass with this patch, the Squash-to series can
probably be applied.

Note that this is just a debug check, hoping that the selftest will
cover all cases. We can then not use this check to return an error if it
is not held.

Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
Based-on: <cover.1740368110.git.tanggeliang@kylinos.cn>
Cc: Geliang Tang <geliang@kernel.org>
Cc: Mat Martineau <martineau@kernel.org>
---
 net/mptcp/bpf.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/mptcp/bpf.c b/net/mptcp/bpf.c
index ac7744c6006f..9e8c24c88022 100644
--- a/net/mptcp/bpf.c
+++ b/net/mptcp/bpf.c
@@ -252,6 +252,9 @@ bpf_iter_mptcp_subflow_new(struct bpf_iter_mptcp_subflow *it,
 		return -EINVAL;
 
 	msk = mptcp_sk(sk);
+
+	msk_owned_by_me(msk);
+
 	kit->msk = msk;
 	kit->pos = &msk->conn_list;
 	return 0;
-- 
2.47.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2025-03-05 15:14 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-26 18:07 [PATCH mptcp-next] Squash to "bpf: Add mptcp_subflow bpf_iter" Matthieu Baerts (NGI0)
2025-02-26 19:17 ` MPTCP CI
2025-02-27  2:03 ` Geliang Tang
2025-02-27  8:32   ` Matthieu Baerts
2025-03-01  1:37     ` Mat Martineau
2025-03-01 10:37       ` Matthieu Baerts
2025-03-04  1:42         ` Mat Martineau
2025-03-04  9:22           ` Matthieu Baerts
2025-03-05  1:35             ` Mat Martineau
2025-03-05 15:14               ` Matthieu Baerts

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.