From nobody Thu May 16 21:31:51 2024 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 99A0E626AC for ; Thu, 1 Feb 2024 16:09:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706803778; cv=none; b=esSaFlyTZTlHqA+HRR3cIwqa6ECyfNGJu9Lni8QlvOMrtHmGm1BoB9aKAfrsbMEGFEvvQXZ7cI0s36Ux+L7DBSvzkO9yGKhEGykI+cP2uQY9m183PaQOpNYu1WvM4aMM7NXeozEjC1TCLDqBvO3oWbdO+gVHKNO42LWQYhD1DCY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706803778; c=relaxed/simple; bh=uCboPJ0LRaDIGMdWuBXqejhsmk8WqCnmSpXCIwZJHFI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=m+eWpuRtO39DWlWFBs61qmlRNwPD999WpceW243utSHPtgpHWfaJrWiq6dwQgL39pRI/C3ikYYjUitTZTZErTtC6AGJpqQjY/daPFTvMFpSIWFWjazAAbTzH/rr7W7ofswZEiaIED3m2KQD6rsZ07dUOt6erYrEKczOi+filQXM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=YBf1Q8bn; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="YBf1Q8bn" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6BC14C43394; Thu, 1 Feb 2024 16:09:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706803778; bh=uCboPJ0LRaDIGMdWuBXqejhsmk8WqCnmSpXCIwZJHFI=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=YBf1Q8bnTMPiKmXMXlU+ZZfRT/uXdaloYZWo3vGT25yX0UOip71RyPx6uzvwejXOf BeeP0/WaKLw1eo7K7SYY5biGcZ2/RRXK7SEIcmRo4q+W/IgZEUBJdAVursZ4DSeeqJ wILlTx7bzMxn4sKch5tzEma4L8IS5fjaav98v2s5CrB2KdDPDgPzfarhJIJiq8ygIW frLrousqBXn/dmPOuNVSQgf8IKQlSnMpLlKKILq/wvepvDItsVxR0bj77DCyFPKcLT kDBk++OujjUQvuBE8+RUICKYqI+lpBIjgu6f5oiP6s1amFwfe0J5ODHeh5+brfpFza MY86w4GGbawpQ== From: "Matthieu Baerts (NGI0)" Date: Thu, 01 Feb 2024 17:09:29 +0100 Subject: [PATCH mptcp-next v2 1/3] mptcp: token kunit: set protocol Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240201-mptcp-check-protocol-v2-1-1e253ef51990@kernel.org> References: <20240201-mptcp-check-protocol-v2-0-1e253ef51990@kernel.org> In-Reply-To: <20240201-mptcp-check-protocol-v2-0-1e253ef51990@kernel.org> To: mptcp@lists.linux.dev Cc: Paolo Abeni , "Matthieu Baerts (NGI0)" X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=1184; i=matttbe@kernel.org; h=from:subject:message-id; bh=uCboPJ0LRaDIGMdWuBXqejhsmk8WqCnmSpXCIwZJHFI=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBlu8I/H/aveBrOlUw5UxsKxNVdUKGdJ6hQHGXtV eID7dRzQBaJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZbvCPwAKCRD2t4JPQmmg c3ntD/9m+LmhmgUdspE3pZYISK91yp73IG3g+RvQhqK6OpAD5O9DkQE3QZqE/LmG3GX09GqBghW QhZ2MjxRtai8gIACmy3zlcXXcwdqrLJB5qC7occGc3HSoNKHzAoPMO1pqSb/iHer1GZ8FWAX/kH UAvspLon9CQlWacoo/QHgLTTdyR6f3lzIDXqAnxwKaSxDWdtW71fn5NsVRfQVme03yspc2k/Yxo wAD6lzcEyp/F2i4xjCj9la4JVqHDxYy9YcyewqxCsbpefh5hXkHq+Di+wVeTvLZue0RmdrmGyzk TuKqqx2HkCG4nZD29NpQFfa6KfZfp4i8SJtRY3DMsGdRZSy931Z1CeALKXaf+bJQJ0gXx0o4Cu7 i0zRLHhH1WUngO1aLusx6T7JpA7Tc+VUuWL7lrlFTgVFfdq91KRYiGJgKh2oSniSqG2isuTFhOO 1yc3FoXDpqxh31F+JMOP+/wtekRWk10lRuSfQi/M2WQ1g7NuyNF8NQ9KqVOY6SiTHXNSpzsDgGz Kiwx2+CO8z0+s7bI7z2QjeMaoPX4kCFejIQS29gKJxmILqdtYekMYvO5a6v2Z+JG67zwWFUtVxQ AhfTRKZDBXSHRy7am9cPCwHIBZ4V8tFfAqU0fRkuprFb5iWISCvu5YNe1Zd/57e0OhOrk9Gnxjz YtTnQnj8bCx+5ew== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 As it would be done when initiating an MPTCP sock. This is not strictly needed for this test, but it will be when a later patch will check if the right protocol is being used when calling mptcp_sk(). Signed-off-by: Matthieu Baerts (NGI0) --- net/mptcp/token_test.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/net/mptcp/token_test.c b/net/mptcp/token_test.c index bfff53e668da..4fc39fa2e262 100644 --- a/net/mptcp/token_test.c +++ b/net/mptcp/token_test.c @@ -52,14 +52,19 @@ static struct mptcp_subflow_context *build_ctx(struct k= unit *test) static struct mptcp_sock *build_msk(struct kunit *test) { struct mptcp_sock *msk; + struct sock *sk; =20 msk =3D kunit_kzalloc(test, sizeof(struct mptcp_sock), GFP_USER); KUNIT_EXPECT_NOT_ERR_OR_NULL(test, msk); refcount_set(&((struct sock *)msk)->sk_refcnt, 1); sock_net_set((struct sock *)msk, &init_net); =20 + sk =3D (struct sock *)msk; + /* be sure the token helpers can dereference sk->sk_prot */ - ((struct sock *)msk)->sk_prot =3D &tcp_prot; + sk->sk_prot =3D &tcp_prot; + sk->sk_protocol =3D IPPROTO_MPTCP; + return msk; } =20 --=20 2.43.0 From nobody Thu May 16 21:31:51 2024 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D711F626AC for ; Thu, 1 Feb 2024 16:09:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706803779; cv=none; b=hUNoXjpDfBXiy+b0yKRKmumMEwKS7xZw2Q+KN80W1JmuxKwgy/aC7GW8s+l8nkPHASLxetUamJE92N35zkkDupWyYC5uLlAeHLij2w9WW66MGA9jZe2pZvEZ9aaxO+hYhk9lqqhNSseuR+guCKfkgajqM/2mAwmvuc+i5h3cdHQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706803779; c=relaxed/simple; bh=2p0ikRhI653ZDIOjbhndPv7Hs64z5OCdoL0ZV+cAHtQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Y0DurBWjf3nG23ooGWrQYE5by6ULLvZ+bVPTHSLv2KXtg2me+3J09wnMFrU7TFhgLP6JXfG/uAkrZYMOc33ukE9jf78kLDMcFBPxvEamL8oebmeI2UIHtMDDtrjE1nD+MYNi5UVq8Jk5KE76e/OHMTuVMceQVyQpTrFqkVb8OWs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=cDV8qh8X; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="cDV8qh8X" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9DEE2C433C7; Thu, 1 Feb 2024 16:09:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706803779; bh=2p0ikRhI653ZDIOjbhndPv7Hs64z5OCdoL0ZV+cAHtQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=cDV8qh8XNVEE4sS54VI3a+3lQBMlvHJ5/9bW8mmD/DJa5tsV/vJ+iSUbEhdHuDpRS lG97aUAM6+ep0PThJ6aSgNIBM1E+KGHLBqDbc+G1RBNdaR1yXWBNFH4AyLtiT1LDD1 TWSoZnIThWsHR/we59bfyUhhyfGAduAikSYyaYO7qAr9vLoMB1R/pKFn7qf3cE74cf k3EHp5a3bbfYOEcgl5aDfEIrtjORNJtAGNwDKvSXZVfJvBwbtu+yku+8WN4OusS/rt vF9oxd3hb3KBRCt73Hgo49x9cAld9mvLmeAoQ3MmF9IZCk7wsbaDVFIR6ML2sCkR5b 0p8knxrkDfYrQ== From: "Matthieu Baerts (NGI0)" Date: Thu, 01 Feb 2024 17:09:30 +0100 Subject: [PATCH mptcp-next v2 2/3] mptcp: check the protocol in tcp_sk() with DEBUG_NET Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240201-mptcp-check-protocol-v2-2-1e253ef51990@kernel.org> References: <20240201-mptcp-check-protocol-v2-0-1e253ef51990@kernel.org> In-Reply-To: <20240201-mptcp-check-protocol-v2-0-1e253ef51990@kernel.org> To: mptcp@lists.linux.dev Cc: Paolo Abeni , "Matthieu Baerts (NGI0)" X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=1867; i=matttbe@kernel.org; h=from:subject:message-id; bh=2p0ikRhI653ZDIOjbhndPv7Hs64z5OCdoL0ZV+cAHtQ=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBlu8I/dJn/bwu+LWmim5q+gk4VGQK637VMGNSEx oA6j6XVyOWJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZbvCPwAKCRD2t4JPQmmg cxYwD/9STxoyUAQ+G8Wy+q7dF9RFKh9h4jfR1DOUb8/sYQkoJePWGF00QrmR9wM9E5gNr+JIZ3S bRp4e7GdhcqfWBlw53WUixjneMRoPRMaYlXymFe8kd98H74QG+SQkAI6SfdL54lU6JnkYqAI7b9 VUa1cjhwximhcDd21390b1Pjml7ANSVKj2nqTI6g223UaZnRE7TglekVZOqe3jDNWs1RtmvFkbw XwwD6wHSOiJgy87DzGBBvSDC7ztE/dxPV591EkTCXE59hB+Xn4wyOCWvutw3QEBcXG7GIZhBk4A FUNOgJBqXZDhcj5gwgfxcPvfj1NpJBOscz7EOZIOesrtdDN7UaOYQZiQO/ZuKHYIN9N5Vxp9hYJ ve4fECb3YfDvCKS8p5T7387AK9bcrQ4SxZxwTL1kfYLAwLUY2rSdfHRJ5E5o4rbWHSmRaTVQmPj ZwiAl+mNQQKldTjJIxh0RTi8irm1dQRx9YUWPdnxWO5U+FLM5UMgb/sFEH1kZX56Xks5Dw3Ixbo NZduBs405p1IIBDzcRYN7n4TgBqZ8bu4ztMOxqBLmeIbnkEHoDgkmiT0XVO9CivbtUSMQXpi8Z8 F8XYLo5wjG2tTS+HsvdsIC4fj6pWeiz5kFTwFwYWwm1nwUlXX7qPCpeS6kbmS+nqbnMe/kgpSDP OBr61iyF+W10Ykg== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 Fuzzers and static checkers might not detect when tcp_sk() is used with a non tcp_sock structure. This kind of mistake already happened a few times with MPTCP: when wrongly using TCP-specific helpers with mptcp_sock pointers. On the other hand, there are many 'tcp_xxx()' helpers that are taking a 'struct sock' pointer as arguments, and some of them are only looking at fields from 'struct sock', and nothing from 'struct tcp_sock'. It is then tempting to use them with a 'struct mptcp_sock'. So a new simple check is done when CONFIG_DEBUG_NET is enabled to tell kernel devs when a non-TCP socket is being used as a TCP one. 'tcp_sk()' macro is then re-defined to add a WARN when an unexpected socket is being used. Signed-off-by: Matthieu Baerts (NGI0) --- Notes: - v2: - Move from include/linux/tcp.h to net/mptcp/protocol.h: specific to TCP (Paolo) - Use a macro instead of an inlined function (Paolo) - Adapt the commit message after the recent changes. --- net/mptcp/protocol.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h index eefd1397106d..f2473d9acae6 100644 --- a/net/mptcp/protocol.h +++ b/net/mptcp/protocol.h @@ -348,6 +348,15 @@ static inline void msk_owned_by_me(const struct mptcp_= sock *msk) sock_owned_by_me((const struct sock *)msk); } =20 +#ifdef CONFIG_DEBUG_NET +/* MPTCP-specific: we might (indirectly) call this helper with the wrong s= k */ +#undef tcp_sk +#define tcp_sk(ptr) ({ \ + WARN_ON(ptr->sk_protocol !=3D IPPROTO_TCP); \ + container_of_const(ptr, struct tcp_sock, inet_conn.icsk_inet.sk); \ +}) +#endif + #define mptcp_sk(ptr) container_of_const(ptr, struct mptcp_sock, sk.icsk_i= net.sk) =20 /* the msk socket don't use the backlog, also account for the bulk --=20 2.43.0 From nobody Thu May 16 21:31:51 2024 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 068C6626BE for ; Thu, 1 Feb 2024 16:09:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706803781; cv=none; b=jN76Bf2MU4i8m+CrZQOeOPL8JJp9XvHOhtE475C48VDYWC8qZaga/7eYdLX58IK1U3KAoEXyttlIAgHkSOXghni86O87iiep0ekp120Gu33HlAbcS8f1PmsOSanFY7xNIF4UHYive4d+VFdLjXqfFWRMq6MIRBeathkfBAoC4FM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706803781; c=relaxed/simple; bh=8lytkz5ZediEVKO9v4YEKd6NPwx1gvUhp9XX5T3qsDo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Hy9+zMw7yZC8V85ZnZmvGkGJ2ziObvbZ4NV5BddOwdqZVd3zPLpP4ZipIpGuFwDwayxxE0QMgNkbBOU//bk+nQ4HSQhL1D9IOKJ/w/OrD8O7V+/s6ulIbTirLxPxuW31W2RplxtEpZ1FZSiS5K4mIH/FdxfxobiZB/X9/kSWLJs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=FsKkG5Xo; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="FsKkG5Xo" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C8102C433A6; Thu, 1 Feb 2024 16:09:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706803780; bh=8lytkz5ZediEVKO9v4YEKd6NPwx1gvUhp9XX5T3qsDo=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=FsKkG5XouZON9a17JDcbCqV33ketN35l59NeaUF5cJItCegw0EalaC5Dg8G9JOUQz srcvdMLatlR4Il/KUPsabN+utO+ym1jUmNeVOmgcHF1yMIwcyeuwQNqEuKXS48dLxW FBgSLDoYQLtM4G+QBtAp4/68EiwKSxGWyhBWVv6NC1dIgGP1qfqIhCVJ7TRZS9tMkn 8K9K5wyTdvCfkVE7OwyhU4nRVSmJ6v+tmEWP1ZxnfkbJcDT7Cw+RD93BfndX2xNWpt XlTyeaNrMhJw5OcWVjdlodF4awaB9ixDGYJCfhNBqoXM90TtRDj5gUEyQqStL6mJzC EOj3SEJk8pQ0g== From: "Matthieu Baerts (NGI0)" Date: Thu, 01 Feb 2024 17:09:31 +0100 Subject: [PATCH mptcp-next v2 3/3] mptcp: check the protocol in mptcp_sk() with DEBUG_NET Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240201-mptcp-check-protocol-v2-3-1e253ef51990@kernel.org> References: <20240201-mptcp-check-protocol-v2-0-1e253ef51990@kernel.org> In-Reply-To: <20240201-mptcp-check-protocol-v2-0-1e253ef51990@kernel.org> To: mptcp@lists.linux.dev Cc: Paolo Abeni , "Matthieu Baerts (NGI0)" X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=1482; i=matttbe@kernel.org; h=from:subject:message-id; bh=8lytkz5ZediEVKO9v4YEKd6NPwx1gvUhp9XX5T3qsDo=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBlu8I/EzanmmW+ai+Ih6dVpb7YU6+cXvYq/sTNc cYB69cggyWJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZbvCPwAKCRD2t4JPQmmg cxrfD/92+n8j7amrJYku8LNglk2PqJJ88D2LjUeOka8B4TxZRGbAjR9uFfF+4Q7Q4xbIcIsfELm KEOyp/1EMoyFv/0GhzqC7hY3hfutckgwYrjHgAQSBGBnKrNacTPJpa6duiuNk9krgqznLIpPZv7 NUr61HQm58ye47smtvNDPSOfcWPIYDY1gXNsdkI20eqIIF3FTG/NqRtaxEpRwx4Yl9houtrCRn6 UNn47fjzJ78pfyLqgSdWDprSq0eW0xcvRKSlbc8S/NUU09uKlYdJZlD1Pf9a7JM4UH3vxjI7AZg G7H1uKKN/t82DMlYAUUmIkpkth09rJwVfsrQjgxJojHUrMJbigF30WrT/Jdi+gtwz0NOnXMj1Pf 1uhuRU+SF/DqAnWuYdTP0QAzhm/SkBwKq+3jrR2wILP7a54wgpPJTIU9h7ZPilWRobMb0MvEQZR k81VqiYXxGQJCzhaXIfUoUz6zPnMms/023ZjhepE0ZSH8ydcLTSLBwYy1BmTBAbIF3VcddhEqUU YyMlO2v1JGW8vWhhWJuGZlUJ7MmZeF+yeorgG+z3itkha1Y5yJSWtkIqXxqwT1gatLDIs1Qn+cB KCgwM1NJ5KGIPAP03WCyWjRu4nSdCgJoaeKZ/WLBXLj95NzkQn9AZqh8AXWujHUhaJjzIC2MrAg ZAhBM2FLyIFNP4A== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 Fuzzers and static checkers might not detect when mptcp_sk() is used with a non mptcp_sock structure. This is similar to the parent commit, where it is easy to use mptcp_sk() with a TCP sock, e.g. with a subflow sk. So a new simple check is done when CONFIG_DEBUG_NET is enabled to tell kernel devs when a non-MPTCP socket is being used as an MPTCP one. 'mptcp_sk()' macro is then defined differently: with an extra WARN to complain when an unexpected socket is being used. Signed-off-by: Matthieu Baerts (NGI0) --- Notes: v2: - Use a macro instead of an inlined function (Paolo) --- net/mptcp/protocol.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h index f2473d9acae6..defccef59b3e 100644 --- a/net/mptcp/protocol.h +++ b/net/mptcp/protocol.h @@ -355,9 +355,14 @@ static inline void msk_owned_by_me(const struct mptcp_= sock *msk) WARN_ON(ptr->sk_protocol !=3D IPPROTO_TCP); \ container_of_const(ptr, struct tcp_sock, inet_conn.icsk_inet.sk); \ }) -#endif +#define mptcp_sk(ptr) ({ \ + WARN_ON(ptr->sk_protocol !=3D IPPROTO_MPTCP); \ + container_of_const(ptr, struct mptcp_sock, sk.icsk_inet.sk); \ +}) =20 +#else /* !CONFIG_DEBUG_NET */ #define mptcp_sk(ptr) container_of_const(ptr, struct mptcp_sock, sk.icsk_i= net.sk) +#endif =20 /* the msk socket don't use the backlog, also account for the bulk * free memory --=20 2.43.0