From: syzbot <syzbot+ff020673c5e3d94d9478@syzkaller.appspotmail.com>
To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Forwarded: [PATCH] mptcp: zero opts->ext_copy in mptcp_established_options_dss()
Date: Sun, 03 May 2026 16:20:48 -0700 [thread overview]
Message-ID: <69f7d850.050a0220.312cd3.003c.GAE@google.com> (raw)
In-Reply-To: <69f44505.050a0220.3cbe47.0008.GAE@google.com>
For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.
***
Subject: [PATCH] mptcp: zero opts->ext_copy in mptcp_established_options_dss()
Author: kartikey406@gmail.com
#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
syzbot reported two related KMSAN uninit-value reports rooted in
mptcp_established_options_dss():
1. mptcp_write_data_fin() reads ext->use_map on the subflow shutdown
path (tcp_send_ack via mptcp_subflow_shutdown), where the skb has
no MPTCP extension and the "opts->ext_copy = *mpext" assignment is
skipped.
2. mptcp_write_options() reads mpext->use_ack on the data_fin
acknowledgement path (tcp_send_ack via mptcp_send_ack from
mptcp_check_data_fin), where the outer DSS-mapping block is
skipped entirely (snd_data_fin_enable is false and mpext is NULL),
yet bitfield RMW writes to opts->ext_copy.use_ack / .ack64 leave
neighboring bits poisoned, which mptcp_write_options() then reads.
The root cause is the same in both cases: opts->ext_copy lives in a
union inside opts->mptcp, which is a plain (non-cleared) member of
the on-stack struct tcp_out_options declared in __tcp_transmit_skb().
Multiple code paths in mptcp_established_options_dss() write only
some fields of ext_copy and rely on the rest being zero, but that
precondition is never enforced.
Zero opts->ext_copy at the start of mptcp_established_options_dss()
so all subsequent writes -- including bitfield RMWs -- operate on
clean memory regardless of which path is taken.
Reported-by: syzbot+ff020673c5e3d94d9478@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=ff020673c5e3d94d9478
Signed-off-by: Deepanshu Kartikey <kartikey406@gmail.com>
---
net/mptcp/options.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/mptcp/options.c b/net/mptcp/options.c
index 8a1c5698983c..3fb914196987 100644
--- a/net/mptcp/options.c
+++ b/net/mptcp/options.c
@@ -572,6 +572,7 @@ static bool mptcp_established_options_dss(struct sock *sk, struct sk_buff *skb,
bool ret = false;
u64 ack_seq;
+ memset(&opts->ext_copy, 0, sizeof(opts->ext_copy));
opts->csum_reqd = READ_ONCE(msk->csum_enabled);
mpext = skb ? mptcp_get_ext(skb) : NULL;
--
2.43.0
next prev parent reply other threads:[~2026-05-03 23:20 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 ` syzbot [this message]
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 ` [PATCH] mptcp: fix " Paolo Abeni
2026-05-04 17:14 ` [syzbot] [mptcp?] " 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=69f7d850.050a0220.312cd3.003c.GAE@google.com \
--to=syzbot+ff020673c5e3d94d9478@syzkaller.appspotmail.com \
--cc=linux-kernel@vger.kernel.org \
--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