From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oo1-f71.google.com (mail-oo1-f71.google.com [209.85.161.71]) (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 98FBC1A681B for ; Sun, 3 May 2026 23:20:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.71 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777850451; cv=none; b=UeVIWw2ndU4KS/rI0a+blZCH/mKZ7X/nOor3knF1pwhrWSmznNcN6bA7OtJ4qivm7Ln62l7CKIF+8+YI7ZwmzxvLX/+4ki/lKosfEHBbuBlIUC+SOcWvvRJ2YdF54I1u1dMM7uid8k8wcJon7DAc8u2Ks8f4ent299ttfHuenuw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777850451; c=relaxed/simple; bh=dGL0oWCWXnaM8Aj5FW12/n8ff0EU7wtCJvqFMgz3ufI=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=a+3gMr2yGoiy1/AOOu4dmHSPM0yz6EwTK+GRF6l1GSwH5L6aN9x0bGPE93hlT3hhDsNyKN/xtVt3rZxra+dZJjDZWHi9+z6Z6VJ/di4KgYU/sipFqqcm6POPI+04mQzeYEWNFERJk+ZgWtBMMme1SQtdP5yrp9azfM3aMUETX8U= 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.161.71 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-oo1-f71.google.com with SMTP id 006d021491bc7-6948d83a5c0so9952356eaf.1 for ; Sun, 03 May 2026 16:20:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777850448; x=1778455248; 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=zZutxdeahOWx4xmSclCwoV+FZl0ulduHicrJ914b1c4=; b=aimQJDWFG7ot/nRLfmsecNgR1+CSMZHg31uimqxWiHEzLRCk/5sxxZvQQy0HP3bfB/ v1P6nAjbeX5DCi1aaFBlRw6NPx9/DSc9uEU8Xknzz0QJZCDTiemaWNpQ83SVNd+SaBqd tuGouHYJpga7t7i5inMJymnj92RekojU7U29th33K065DegEP3NIQ4ZtnXvCnScwwamk n+4lsTW2AN/dqAQ+nvVg602ZGNPCCx63dXGz05BTUGCdb/WEN1RrgKGQDMdi+tpmM/ML AL4njD+CNbxv4Ptmr9sN9gmSnOj1BICTjeyfBFQSqC5E9LZ+ulFtG0DcGyVgYM2AnJt5 Et9Q== X-Gm-Message-State: AOJu0Yx4L27XDfJj9RJOwnNC9KkQTffiKroOgCfOxQM+fJGF2xe4uzQy RCblWiNxUMLWPeshgJdbqW15R18OwRlBSUFmvNmGeob3Fpa+nEDIsTIchRog+Ncdn72g+XlQyQX KGeOJc6O+whwJ7uac4Dw2x62xHit0wHra65CKBMi71VddTU/UvWOLXOZVTUk= Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Received: by 2002:a4a:ee0b:0:b0:68c:6e:89d1 with SMTP id 006d021491bc7-69697d8df8dmr3598688eaf.41.1777850448312; Sun, 03 May 2026 16:20:48 -0700 (PDT) Date: Sun, 03 May 2026 16:20:48 -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: <69f7d850.050a0220.312cd3.003c.GAE@google.com> Subject: Forwarded: [PATCH] mptcp: zero opts->ext_copy in mptcp_established_options_dss() 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 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 --- 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