From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oa1-f70.google.com (mail-oa1-f70.google.com [209.85.160.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2DAC729993D for ; Sun, 3 May 2026 14:53:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.70 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777820010; cv=none; b=t3zq+QPFl3Zqh1rryv1qBva2taT5Ot7nci7tzsmfk7DFNoD5ct/gNlCZG3sjXAr9LtKjL5uAl9CRHMJpH4sYnnt/CiHx5R78tuTexGK3BdSLU58nV5SPI6/1H0KVl9KpMMvlBbhoLYwnfPNUrPPLsALivZw8J0Lh3QEd4cCAhTc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777820010; c=relaxed/simple; bh=klH9ReKjwDwyefP/mtFDQs/mmz9Ggh42jqdSF3WZ9r0=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=rEHGaQuU4njM5f+mIEQZhEgsKBb6uAZAMV6coHkWpNiRmjhvYI+5v1QaNQM5WAkEmdC7oxamrorrR5qr2nqAKofyokaZms9KuiZWj5q/Kvhib/z5dUivy9DJedcjXmVcefeRzJ+Y/x6kldu2ax0dswy6JlML5JujHFT1y1pFFzk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com; arc=none smtp.client-ip=209.85.160.70 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com Received: by mail-oa1-f70.google.com with SMTP id 586e51a60fabf-423133d22a0so8094875fac.3 for ; Sun, 03 May 2026 07:53:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777820008; x=1778424808; h=to:from:subject:message-id:in-reply-to:date:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=YkMggTDvIRTMdDpyI7cB1HntspaDUunWUxTZGRJIKoA=; b=SC8bR1Gk6LaZ1IgB+1Rdeq+iRzDMBnkV9eQFga04NfRQMX8aNcG0CqmRBpoivg0NqW /3sO/1vhlLXAAFbyf+L538wbj4oO+Un7a5nXLypTIdw7STzobNlRJmd+e4gvOOpn7eHY JnPgsOYZb+T1Plx6Ja85FIHx5T5I8qiOaee0oxtY+j+qVDsbVeYefnfc2RXP7fgT+9zr gUhgsUP1s52Ao088Z0tfYu43Q5ZGe1ZUGFYwU6RnT4F/1fg2Pu4BGObmlq1ewMEWQlDD oUjOgvpx9TtxYOxjvC3yd+jRl1mHbVJGy++pT0XKx2sr6hKI2e4RGHA/gEqhXYOCAQrH oEIw== X-Gm-Message-State: AOJu0YxUnBBiOJ0jYlRIbiIIJbHvBTL/F7rJE8kyruqCZmKCxgPiQUKD 3FjUQ7okUcgjDyRJjH9CaYaeV1QpV2rsCmMVbFBhYZ2kFlpP3M0pNCpZsV7PmhIrkFVCy2c6wHP 7t5vIScT0HFG1z3MQgoYOHPOfWxbZ3y5EKVUNeFSZ6Z0xi5sE4etcvY+36M0= Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Received: by 2002:a05:6820:c8f:b0:696:2674:8a1a with SMTP id 006d021491bc7-69697df6f61mr3216674eaf.48.1777820008327; Sun, 03 May 2026 07:53:28 -0700 (PDT) Date: Sun, 03 May 2026 07:53:28 -0700 In-Reply-To: <69f44505.050a0220.3cbe47.0008.GAE@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <69f76168.050a0220.312cd3.0036.GAE@google.com> Subject: Forwarded: [PATCH] mptcp: zero opts->ext_copy on DATA_FIN-only path From: syzbot To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Content-Type: text/plain; charset="UTF-8" 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 on DATA_FIN-only path Author: kartikey406@gmail.com #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master syzbot reported a KMSAN uninit-value in mptcp_write_data_fin() when sending a DATA_FIN on a pure-ACK path triggered by subflow shutdown: BUG: KMSAN: uninit-value in mptcp_write_data_fin net/mptcp/options.c:542 mptcp_established_options_dss net/mptcp/options.c:590 mptcp_established_options net/mptcp/options.c:874 tcp_established_options net/ipv4/tcp_output.c:1192 __tcp_transmit_skb net/ipv4/tcp_output.c:1575 __tcp_send_ack net/ipv4/tcp_output.c:4499 tcp_send_ack net/ipv4/tcp_output.c:4505 mptcp_subflow_shutdown net/mptcp/protocol.c:3137 mptcp_check_send_data_fin net/mptcp/protocol.c:3218 __mptcp_close net/mptcp/protocol.c:3313 Local variable opts created at: __tcp_transmit_skb net/ipv4/tcp_output.c:1536 mptcp_established_options_dss() copies an existing DSS mapping into opts->ext_copy only when the skb has an MPTCP extension attached: if (mpext) { ... opts->ext_copy = *mpext; } When called via tcp_send_ack() from the subflow shutdown path, the skb is a freshly allocated pure-ACK with no MPTCP extension, so mptcp_get_ext(skb) returns NULL and the assignment is skipped. mptcp_established_options_dss() still proceeds to call mptcp_write_data_fin(... &opts->ext_copy) when snd_data_fin_enable is set, and mptcp_write_data_fin() reads ext->use_map to decide whether to synthesize a 1-byte DATA_FIN mapping. opts is a stack local in __tcp_transmit_skb() and opts->mptcp is not part of the cleared sub-group, so ext_copy is uninitialized on this path. Zero opts->ext_copy at the start of the DSS mapping block so the synthetic-mapping branch in mptcp_write_data_fin() runs on clean memory regardless of whether mpext is present. Reported-by: syzbot+ff020673c5e3d94d9478@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=ff020673c5e3d94d9478 Signed-off-by: Deepanshu Kartikey --- net/mptcp/options.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/mptcp/options.c b/net/mptcp/options.c index 8a1c5698983c..6707f70024f2 100644 --- a/net/mptcp/options.c +++ b/net/mptcp/options.c @@ -578,6 +578,8 @@ static bool mptcp_established_options_dss(struct sock *sk, struct sk_buff *skb, if (!skb || (mpext && mpext->use_map) || snd_data_fin_enable) { unsigned int map_size = TCPOLEN_MPTCP_DSS_BASE + TCPOLEN_MPTCP_DSS_MAP64; + memset(&opts->ext_copy, 0, sizeof(opts->ext_copy)); + if (mpext) { if (opts->csum_reqd) map_size += TCPOLEN_MPTCP_DSS_CHECKSUM; -- 2.43.0