* [PATCH mptcp-net 1/2] mptcp: options: mpc: avoid printing uninit data
2026-09-08 17:07 [PATCH mptcp-net 0/2] mptcp: options: avoid printing uninit data Matthieu Baerts (NGI0)
@ 2026-09-08 17:07 ` Matthieu Baerts (NGI0)
2026-09-08 17:07 ` [PATCH mptcp-net 2/2] mptcp: options: dss: avoid printing uninit csum Matthieu Baerts (NGI0)
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Matthieu Baerts (NGI0) @ 2026-09-08 17:07 UTC (permalink / raw)
To: MPTCP Linux; +Cc: Matthieu Baerts (NGI0)
When parsing the MP_CAPABLE suboption, this pr_debug() might read and
print uninit values.
That's mostly harmless, but that's also confusing. Fixing that also
avoids some tools to complain about accessing unint data.
So read these fields only if they have been set.
Fixes: cc7972ea1932 ("mptcp: parse and emit MP_CAPABLE option according to v1 spec")
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
net/mptcp/options.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/net/mptcp/options.c b/net/mptcp/options.c
index f87707110c75..7f7ed4753100 100644
--- a/net/mptcp/options.c
+++ b/net/mptcp/options.c
@@ -126,8 +126,11 @@ static void mptcp_parse_option(const struct sk_buff *skb,
ptr += 2;
}
pr_debug("MP_CAPABLE version=%x, flags=%x, optlen=%d sndr=%llu, rcvr=%llu len=%d csum=%u\n",
- version, flags, opsize, mp_opt->sndr_key,
- mp_opt->rcvr_key, mp_opt->data_len, mp_opt->csum);
+ version, flags, opsize,
+ opsize >= TCPOLEN_MPTCP_MPC_SYNACK ? mp_opt->sndr_key : 0,
+ opsize >= TCPOLEN_MPTCP_MPC_ACK ? mp_opt->rcvr_key : 0,
+ opsize >= TCPOLEN_MPTCP_MPC_ACK_DATA ? mp_opt->data_len : 0,
+ opsize == TCPOLEN_MPTCP_MPC_ACK_DATA_CSUM ? mp_opt->csum : 0);
break;
case MPTCPOPT_MP_JOIN:
--
2.55.0
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH mptcp-net 2/2] mptcp: options: dss: avoid printing uninit csum
2026-09-08 17:07 [PATCH mptcp-net 0/2] mptcp: options: avoid printing uninit data Matthieu Baerts (NGI0)
2026-09-08 17:07 ` [PATCH mptcp-net 1/2] mptcp: options: mpc: " Matthieu Baerts (NGI0)
@ 2026-09-08 17:07 ` Matthieu Baerts (NGI0)
2026-09-08 18:00 ` [PATCH mptcp-net 0/2] mptcp: options: avoid printing uninit data MPTCP CI
2026-09-09 15:51 ` Mat Martineau
3 siblings, 0 replies; 5+ messages in thread
From: Matthieu Baerts (NGI0) @ 2026-09-08 17:07 UTC (permalink / raw)
To: MPTCP Linux; +Cc: Matthieu Baerts (NGI0)
When parsing the DSS suboption, this pr_debug() might read and print
uninit checksum value.
That's mostly harmless, but that's also confusing. Fixing that also
avoids some tools to complain about accessing unint data.
So read this csum field only if it has been set.
Fixes: 390b95a5fb84 ("mptcp: receive checksum for DSS")
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
net/mptcp/options.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/mptcp/options.c b/net/mptcp/options.c
index 7f7ed4753100..20490410fa22 100644
--- a/net/mptcp/options.c
+++ b/net/mptcp/options.c
@@ -259,7 +259,7 @@ static void mptcp_parse_option(const struct sk_buff *skb,
pr_debug("data_seq=%llu subflow_seq=%u data_len=%u csum=%d:%u\n",
mp_opt->data_seq, mp_opt->subflow_seq,
mp_opt->data_len, !!(mp_opt->suboptions & OPTION_MPTCP_CSUMREQD),
- mp_opt->csum);
+ (mp_opt->suboptions & OPTION_MPTCP_CSUMREQD) ? mp_opt->csum : 0);
}
break;
--
2.55.0
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH mptcp-net 0/2] mptcp: options: avoid printing uninit data
2026-09-08 17:07 [PATCH mptcp-net 0/2] mptcp: options: avoid printing uninit data Matthieu Baerts (NGI0)
2026-09-08 17:07 ` [PATCH mptcp-net 1/2] mptcp: options: mpc: " Matthieu Baerts (NGI0)
2026-09-08 17:07 ` [PATCH mptcp-net 2/2] mptcp: options: dss: avoid printing uninit csum Matthieu Baerts (NGI0)
@ 2026-09-08 18:00 ` MPTCP CI
2026-09-09 15:51 ` Mat Martineau
3 siblings, 0 replies; 5+ messages in thread
From: MPTCP CI @ 2026-09-08 18:00 UTC (permalink / raw)
To: Matthieu Baerts; +Cc: mptcp
Hi Matthieu,
Thank you for your modifications, that's great!
Our CI did some validations and here is its report:
- KVM Validation: normal (except selftest_mptcp_join): Success! ✅
- KVM Validation: normal (only selftest_mptcp_join): Success! ✅
- KVM Validation: debug (except selftest_mptcp_join): Success! ✅
- KVM Validation: debug (only selftest_mptcp_join): Success! ✅
- KVM Validation: btf-normal (only bpftest_all): Success! ✅
- KVM Validation: btf-debug (only bpftest_all): Success! ✅
- Perf:
- Task: https://github.com/multipath-tcp/mptcp_net-next/actions/runs/34255429754
Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/9f6eed5cbeb2
Patchwork: https://patchwork.kernel.org/project/mptcp/list/?series=1160710
If there are some issues, you can reproduce them using the same environment as
the one used by the CI thanks to a docker image, e.g.:
$ cd [kernel source code]
$ docker run -v "${PWD}:${PWD}:rw" -w "${PWD}" --privileged --rm -it \
--pull always mptcp/mptcp-upstream-virtme-docker:latest \
auto-normal
For more details:
https://github.com/multipath-tcp/mptcp-upstream-virtme-docker
Please note that despite all the efforts that have been already done to have a
stable tests suite when executed on a public CI like here, it is possible some
reported issues are not due to your modifications. Still, do not hesitate to
help us improve that ;-)
Cheers,
MPTCP GH Action bot
Bot operated by Matthieu Baerts (NGI0 Core)
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH mptcp-net 0/2] mptcp: options: avoid printing uninit data
2026-09-08 17:07 [PATCH mptcp-net 0/2] mptcp: options: avoid printing uninit data Matthieu Baerts (NGI0)
` (2 preceding siblings ...)
2026-09-08 18:00 ` [PATCH mptcp-net 0/2] mptcp: options: avoid printing uninit data MPTCP CI
@ 2026-09-09 15:51 ` Mat Martineau
3 siblings, 0 replies; 5+ messages in thread
From: Mat Martineau @ 2026-09-09 15:51 UTC (permalink / raw)
To: Matthieu Baerts (NGI0); +Cc: MPTCP Linux
On Tue, 8 Sep 2026, Matthieu Baerts (NGI0) wrote:
> When parsing the MPTCP suboptions, some pr_debug() might read and print
> uninit values.
>
> That's mostly harmless, but that's also confusing. Fixing that also
> avoids some tools to complain about accessing unint data.
>
> So read these fields only if they have been set.
>
> Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
> ---
> Matthieu Baerts (NGI0) (2):
> mptcp: options: mpc: avoid printing uninit data
> mptcp: options: dss: avoid printing uninit csum
>
> net/mptcp/options.c | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
> ---
> base-commit: a59eb98e30b7db5fa1cc7cd5343ad387bced3ae0
> change-id: 20260908-mptcp-opt-read-debug-d818ab97c05e
Thanks Matthieu, series LGTM:
Reviewed-by: Mat Martineau <martineau@kernel.org>
^ permalink raw reply [flat|nested] 5+ messages in thread