From nobody Sun May 24 20:33:26 2026 Received: from out-180.mta1.migadu.com (out-180.mta1.migadu.com [95.215.58.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AF8F53597B for ; Sat, 23 May 2026 13:04:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779541491; cv=none; b=izvJL0rThUzspzG4e7Y/Oj5uRGT6hAPOPh9BvbtueDqbLlbkS4IbrIDuQ6e7XkKVb4Juelk+zK4MjSonXIis37FtbJ/qfpkE9nQA5f/MQU9pwcF+5y93Jbpfc8w0M/4+DfPWLJJfBbn5SLBoJXSJKMpzYQoq9u3a0oAbEQW8chM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779541491; c=relaxed/simple; bh=BmskkCgo08MESOpeXC1LMKRftigq/Wwj3E91CrytSOI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=d2NPTa45hBPSVikcbaaC4wdA9oFmhdLol+hhupGAYu9cGuF2Fbc6Wdu7exsHGKAmXKQuphSvYWNXQZZpJBX1ND5+VSeQnArFdEPh0eRWx4x8/sK2iMJwKJePpsth7rJ1R1J78WDVBYaUY/HX3iOpnf2/Qz90K30V4zoHIVwbIIc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=OqeF5BDO; arc=none smtp.client-ip=95.215.58.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="OqeF5BDO" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1779541487; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=iWxfv2e+GcSyZUnEmnu4p5qrmceOqRn/R+AXgU064ck=; b=OqeF5BDOTeztheWxRpcMIlnxCeK2UH8iJp491X5Zyv9ebn8UBYTA5doMOPpfBMt5E8EPfq Y3Py0jTVzY29RChWPNk0/4odLbz1OXT4yZgB4SI9FFCASy6Q6ulF8JbokP4zfQd0ixe68d kZ5cV6ApPBgmhRoR7dnaqNJVjdin45E= From: luka.gejak@linux.dev To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman Cc: Luka Gejak , Felix Maurer , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next v7] net: hsr: require valid EOT supervision TLV Date: Sat, 23 May 2026 15:04:20 +0200 Message-ID: <20260523130420.62144-1-luka.gejak@linux.dev> 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 X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" From: Luka Gejak Supervision frames are only valid if terminated with a zero-length EOT TLV. The current check fails to reject non-EOT entries as the terminal TLV, potentially allowing malformed supervision traffic. Fix this by strictly requiring the terminal TLV to be HSR_TLV_EOT with a length of zero. Assisted-by: Gemini:Gemini-3.1-flash Signed-off-by: Luka Gejak Reviewed-by: Fernando Fernandez Mancera --- Changes in v7: - Send as standalone patch as other patch was moved to net. See NOTE. NOTE: This patch was previously part of a net-next series and was=20 seperated as requested by Jakub Kicinski. Link to the old series is [1]. [1]:https://lore.kernel.org/netdev/20260513182657.20346-1-luka.gejak@linux.= dev/ net/hsr/hsr_forward.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/hsr/hsr_forward.c b/net/hsr/hsr_forward.c index f669a226d728..0774981a65c1 100644 --- a/net/hsr/hsr_forward.c +++ b/net/hsr/hsr_forward.c @@ -110,7 +110,7 @@ static bool is_supervision_frame(struct hsr_priv *hsr, = struct sk_buff *skb) } =20 /* end of tlvs must follow at the end */ - if (hsr_sup_tlv->HSR_TLV_type =3D=3D HSR_TLV_EOT && + if (hsr_sup_tlv->HSR_TLV_type !=3D HSR_TLV_EOT || hsr_sup_tlv->HSR_TLV_length !=3D 0) return false; =20 --=20 2.54.0