From nobody Sun Jul 5 05:52:31 2026 Received: from mail-qk1-f175.google.com (mail-qk1-f175.google.com [209.85.222.175]) (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 2CEC03F99E1 for ; Wed, 17 Jun 2026 21:57:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781733453; cv=none; b=NZTMRVXfil22LUnSisKaKtUgu9cc4bz+e6gvwIbwcy1WTB9u3nNf7L3Uvwe4QCktNhGQlcMQvEZ3X4mkuaeRtpa+2aCzgq/FZhYfve418KMWMYKZqZTg45lDAcrFPd59bCwPH/+YbkkKIV4U/Smm08A4yeCfH99kQbeMZmErIUw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781733453; c=relaxed/simple; bh=YFX993hq1Dn+Ak0oODn5emNit7+SDeFwOkckrV1bITo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=YtuZKl4880d8MOREpNvuCJgl/LgGVctPsz4vahLgqiPf+lhbULpGsfa4XUZdGEmsrt0xbSXQf2h5a+aOR9jt6DQjspH1jqO8/lggbVAVs0czHCy0sFrnkf5n1dBHdIYr6j249ze9GEmelxunTcU8kRE3jCWTeRYhk1UZ5Hqi1hs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=G474XMNR; arc=none smtp.client-ip=209.85.222.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="G474XMNR" Received: by mail-qk1-f175.google.com with SMTP id af79cd13be357-915671abde5so23401985a.3 for ; Wed, 17 Jun 2026 14:57:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781733450; x=1782338250; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=OX6t51pm0YrW+eM37YUtdbX6+TWrUjJQf11wIZ0s0II=; b=G474XMNRVQGXPLkdOIydKCEwChqbirSQBc9kDGRSfgPSWzype3EzSNajhyWOMdVviX KY2SW2dTZsX/AhWbvgzwugj7dWVXUfyyUtCnIt5ShpXQ7NMlacQNZcZiaT3ppzvmFUz+ EnPQLiCfSLC+M/6hhpeYNou4uoabgR4Q9+uqJvu4gAMOVb3UTVSnZUVfvBXpE2MA2TGJ +6OO+eRAT+wlQr354KefJBTEx22neFVxI5WKNe4OyiIEG5wpekV0XKJkcCsUo+rFXqxs pM5JLoYg7wcY9Qvu/V5A/SoXEH7aRBe5rovW9Ec483vhxahDPDC/UN3i93beyf0cp+9P o+1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781733450; x=1782338250; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=OX6t51pm0YrW+eM37YUtdbX6+TWrUjJQf11wIZ0s0II=; b=h+y8YaYpmjYniHLGRZBS5uC7RBbp5e9s7/2UkHSOvhcJpsrXsRj1umXm/T3kiLQeMM z8yO2Bz6I1SHcAMVLJ3PmkKfsK5+Qjsum71Ok8Y+6pKAZiVJo4fLmz19OmcBJboKwvvc NCECucXZ8Aej9bPMLVhcypfkPmg84c7EZ1f4YtBudGu8YIEu7vozrwlJfhMGyoAwoOII dXsvMsZsq3QHDCiBIshhRmbToQl/bYwWkYxhmBYtyDJ20FOURIAEH9zCjyl3aIoQ5Q+Q xO8HW+s9mBKK/lJFG037eYcAU28bWWavOw1zAHBvy51Duaikj5TFlfXX1D71bjKJiBw1 phPw== X-Forwarded-Encrypted: i=1; AFNElJ/sBXp5xwE4MGzzO8ZI8uaHkqHdsgnwMzAh+CLgVGs7TmrGy7NQtTEBUg6v3LV8I0ECGsWMnYQ+57TzCG8=@vger.kernel.org X-Gm-Message-State: AOJu0YwKg9ISmoEaHCQLTw74L7SbCM3cTy7yihT1qaYs41nM03Jexljg Lg4WuWxmigqFnPZucl6mHCxhFZwOFGbmVG2roS2teiec5GEIF+JBh5MCZkRKmVKKPck= X-Gm-Gg: Acq92OETKaH14nMttL2DdF3nlYYYjdkq8LEtA6Uk4X+ydbqkAT39JnTjH/wAsD6Lif8 cYF5DHt1ZnVe2XZ4n8SXeLz7muMH1DsUKi4W8Sg9EEV33/MJXKk1pT2k3FpkFy7ceVet5rvzXq/ Dd0RisOEc+D9qMYMhLzvXqB6pGaeUfr55tVFDqOLFp4sg4qHiwKYqj5Q1Dugdn7qb8q21m+TwSo SDyLIhJsuNwfS+7/7FqwCGBhKO0r5vqJCds71EFoGGNnlw/fyolLja02nH69KJYpU4b+YLXJwHW FXbDngGUbuiFmsu0TtU/ed5bqjyaq+9SzWKsoEIVO8bykhcwlAb6XrJqFKBYalH3gVrbTg+852j 2rpH8RJXA+jf87P4ES8o3nSfxMaACmIhg9USSH2MwTkezfi4Wg8SUfzWhWwgRkGcq3ldg+sqL9a fdb3NAwTsyAYlPjhr/kiFjtQlYG0xntFm5O/fhMkPkgwXnmFkX2C2kVjgAMjAYkub/pz9vcT7dn uoHSZx/8BbdzOWuUbHo1nbsXuWXCuJJvPSJUZr9DaA= X-Received: by 2002:a05:620a:4625:b0:915:aa7d:42bc with SMTP id af79cd13be357-91f2a9c1356mr146659285a.10.1781733449733; Wed, 17 Jun 2026 14:57:29 -0700 (PDT) Received: from server0.tail6e7dd.ts.net (c-68-48-65-54.hsd1.mi.comcast.net. [68.48.65.54]) by smtp.gmail.com with ESMTPSA id af79cd13be357-9161a006441sm1974497285a.27.2026.06.17.14.57.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2026 14:57:29 -0700 (PDT) From: Michael Bommarito To: Matthieu Baerts , Mat Martineau Cc: Geliang Tang , Paolo Abeni , Eric Dumazet , Jakub Kicinski , mptcp@lists.linux.dev, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] mptcp: only honor zero-length DATA_FIN when a mapping is present Date: Wed, 17 Jun 2026 17:57:25 -0400 Message-ID: <20260617215725.1116295-1-michael.bommarito@gmail.com> X-Mailer: git-send-email 2.53.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" mptcp_get_options() initializes only the status group of struct mptcp_options_received; data_seq, subflow_seq and data_len are set by mptcp_parse_option() only inside the DSS mapping block, which runs when the DSS M (mapping present) bit is set. A peer can send a DSS option with DATA_FIN set but the mapping bit clear. The parser then sets mp_opt.data_fin while leaving data_len and data_seq uninitialized, and for a zero-length segment mptcp_incoming_options() reads them; KMSAN reports an uninit-value in mptcp_incoming_options(). Impact: a remote peer that has completed the MPTCP handshake makes mptcp_incoming_options() read uninitialized data_len and data_seq (KMSAN uninit-value) by sending a DSS option with DATA_FIN set and the mapping bit clear. A DATA_FIN is always sent with a mapping (mptcp_write_data_fin()), so gating this path on the mapping bit drops only the malformed no-map case and leaves valid DATA_FIN handling unchanged. Fixes: 43b54c6ee382 ("mptcp: Use full MPTCP-level disconnect state machine") Cc: stable@vger.kernel.org Assisted-by: Claude:claude-opus-4-8 Signed-off-by: Michael Bommarito --- The stale data_seq then reaches mptcp_update_rcv_data_fin(); no further consequence is demonstrated, so this is a robustness fix. The read site for a zero-length segment is: if (mp_opt.data_fin && mp_opt.data_len =3D=3D 1 && mptcp_update_rcv_data_fin(msk, mp_opt.data_seq, mp_opt.dsn64)) Reproduced under KMSAN: a no-map DSS DATA_FIN crafted on the wire and injected over a TUN device into a real MPTCP listener produces twelve "uninit-value in mptcp_incoming_options" reports on stock and none on the p= atched build (the unrelated mm-side KMSAN boot noise present on both trees is not affected); a well-formed mapp= ed DATA_FIN (control) drives the same branch with no report. Harness on request. 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 dff3fd5d3b559..e40efa26a6694 100644 --- a/net/mptcp/options.c +++ b/net/mptcp/options.c @@ -1227,7 +1227,7 @@ bool mptcp_incoming_options(struct sock *sk, struct s= k_buff *skb) * present, needs to be updated here before the skb is freed. */ if (TCP_SKB_CB(skb)->seq =3D=3D TCP_SKB_CB(skb)->end_seq) { - if (mp_opt.data_fin && mp_opt.data_len =3D=3D 1 && + if (mp_opt.use_map && mp_opt.data_fin && mp_opt.data_len =3D=3D 1 && mptcp_update_rcv_data_fin(msk, mp_opt.data_seq, mp_opt.dsn64)) mptcp_schedule_work((struct sock *)msk); =20 --=20 2.53.0