public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: mptcp@lists.linux.dev
Cc: syzbot+ff020673c5e3d94d9478@syzkaller.appspotmail.com,
	Kuniyuki Iwashima <kuniyu@google.com>,
	syzkaller-bugs@googlegroups.com, linux-kernel@vger.kernel.org,
	Matthieu Baerts <matttbe@kernel.org>
Subject: Re: [PATCH] mptcp: fix KMSAN: uninit-value in mptcp_established_options
Date: Mon, 4 May 2026 18:22:54 +0200	[thread overview]
Message-ID: <5841afcc-13ea-4bee-8645-634a02e76c4f@redhat.com> (raw)
In-Reply-To: <67030b5e-0435-49fc-8adb-8dd8536ad853@kernel.org>

On 5/4/26 11:59 AM, Matthieu Baerts wrote:
> 
> Sorry for the noise: I forgot to add the syzbot instruction... (and I
> forgot to remove the MPTCP ML from the sendmail.to option).

I did not take in account all the possible corner cases.

Let's be a little more conservative.

#syz test
---
diff --git a/include/net/mptcp.h b/include/net/mptcp.h
index f7263fe2a2e4..0763fd6f7758 100644
--- a/include/net/mptcp.h
+++ b/include/net/mptcp.h
@@ -27,6 +27,9 @@ struct mptcp_ext {
 	u32		subflow_seq;
 	u16		data_len;
 	__sum16		csum;
+
+	struct_group(flags,
+
 	u8		use_map:1,
 			dsn64:1,
 			data_fin:1,
@@ -38,6 +41,8 @@ struct mptcp_ext {
 	u8		reset_reason:4,
 			csum_reqd:1,
 			infinite_map:1;
+
+	); /* end of flags group */
 };

 #define MPTCPOPT_HMAC_LEN	20
diff --git a/net/mptcp/options.c b/net/mptcp/options.c
index 8a1c5698983c..3fd40dbff82b 100644
--- a/net/mptcp/options.c
+++ b/net/mptcp/options.c
@@ -572,6 +572,11 @@ static bool mptcp_established_options_dss(struct
sock *sk, struct sk_buff *skb,
 	bool ret = false;
 	u64 ack_seq;

+	/* Zero `can_ack` and `use_map` flags with one shot. */
+	BUILD_BUG_ON(sizeof_field(struct mptcp_ext, flags) != sizeof(u16));
+	BUILD_BUG_ON(!IS_ALIGNED(offsetof(struct mptcp_ext, flags),
+				 sizeof(u16)));
+	*(u16 *)&opts->ext_copy.flags = 0;
 	opts->csum_reqd = READ_ONCE(msk->csum_enabled);
 	mpext = skb ? mptcp_get_ext(skb) : NULL;

@@ -595,7 +600,6 @@ static bool mptcp_established_options_dss(struct
sock *sk, struct sk_buff *skb,
 	/* passive sockets msk will set the 'can_ack' after accept(), even
 	 * if the first subflow may have the already the remote key handy
 	 */
-	opts->ext_copy.use_ack = 0;
 	if (!READ_ONCE(msk->can_ack)) {
 		*size = ALIGN(dss_size, 4);
 		return ret;


  parent reply	other threads:[~2026-05-04 16:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-01  6:15 [syzbot] [mptcp?] KMSAN: uninit-value in mptcp_established_options syzbot
2026-05-03 13:01 ` syzbot
2026-05-03 14:53 ` Forwarded: [PATCH] mptcp: zero opts->ext_copy on DATA_FIN-only path syzbot
2026-05-03 23:20 ` Forwarded: [PATCH] mptcp: zero opts->ext_copy in mptcp_established_options_dss() syzbot
2026-05-04  9:51 ` [PATCH] mptcp: fix KMSAN: uninit-value in mptcp_established_options Matthieu Baerts (NGI0)
2026-05-04  9:59   ` Matthieu Baerts
2026-05-04 11:14     ` [syzbot] [mptcp?] " syzbot
2026-05-04 16:22     ` Paolo Abeni [this message]
2026-05-04 17:14       ` syzbot
2026-05-04 17:31       ` [PATCH] mptcp: fix " Paolo Abeni
2026-05-04 18:20         ` [syzbot] [mptcp?] " syzbot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5841afcc-13ea-4bee-8645-634a02e76c4f@redhat.com \
    --to=pabeni@redhat.com \
    --cc=kuniyu@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matttbe@kernel.org \
    --cc=mptcp@lists.linux.dev \
    --cc=syzbot+ff020673c5e3d94d9478@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox