From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 A0D1A313298; Mon, 13 Apr 2026 16:53:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776099222; cv=none; b=hZeoRnVGcif0gy2dTCRSsQLQPz8dP9+BVZmXq1fLywtnuuLBa2C5QDZcw31m7zLmurd2nuBUFvRUrbWm25vFHGfiRJdS7uy8H7pph0oGlbE6Zj6TyE4XxjXbpjfgbvV5fQDvueA5A6xoL6v5giMCUmB9+VfwVbUcG9Omx3HKPCc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776099222; c=relaxed/simple; bh=dbU+xGdv+TUsdE+g5YDefCa4XdCApJ/MCWw7CgH9+ac=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HQZ0HnJaP3LB+vmcPbR7dr1LvNK6Tjj0YAy+DGaqj5hHcLsOrEPsXLSgTReIyqMGmikfTWS3lQsYxliDTHEGpO4JyFFrHj1LUhD2LLanNhiNvJLnw6yxflVCST/85fR0hzIkbZWUfHZPZRd668uuM6p5aZv0sZr7F1cQBWiHCAw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=bSHEOHYE; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="bSHEOHYE" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 36FDCC2BCB0; Mon, 13 Apr 2026 16:53:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1776099222; bh=dbU+xGdv+TUsdE+g5YDefCa4XdCApJ/MCWw7CgH9+ac=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bSHEOHYE4NG1k57hj89i+2npRjXIHh3SDYQWBSLTDqnBWPgOQBq3RdLJrp1NsX4bN w6Et1Eyn8z3N0LlSs3ZhapAZSc0l28d7wujidkzAr1HNspZ3HsfQvh5xSj5ehcT2Il unHJt2VeCqLPkyAOb+ZTz+lrIsjowO2p7q7Fn3zo= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Yifan Wu , Juefei Pu , Ao Zhou , Yuan Tan , Xin Liu , Ilya Maximets , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.10 258/491] openvswitch: validate MPLS set/set_masked payload length Date: Mon, 13 Apr 2026 17:58:23 +0200 Message-ID: <20260413155828.711636005@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260413155819.042779211@linuxfoundation.org> References: <20260413155819.042779211@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Yang Yang [ Upstream commit 546b68ac893595877ffbd7751e5c55fd1c43ede6 ] validate_set() accepted OVS_KEY_ATTR_MPLS as variable-sized payload for SET/SET_MASKED actions. In action handling, OVS expects fixed-size MPLS key data (struct ovs_key_mpls). Use the already normalized key_len (masked case included) and reject non-matching MPLS action key sizes. Reject invalid MPLS action payload lengths early. Fixes: fbdcdd78da7c ("Change in Openvswitch to support MPLS label depth of 3 in ingress direction") Reported-by: Yifan Wu Reported-by: Juefei Pu Tested-by: Ao Zhou Co-developed-by: Yuan Tan Signed-off-by: Yuan Tan Suggested-by: Xin Liu Signed-off-by: Yang Yang Reviewed-by: Ilya Maximets Link: https://patch.msgid.link/20260319080228.3423307-1-n05ec@lzu.edu.cn Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- net/openvswitch/flow_netlink.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/openvswitch/flow_netlink.c b/net/openvswitch/flow_netlink.c index 54f952620b214..2185fd5596fc7 100644 --- a/net/openvswitch/flow_netlink.c +++ b/net/openvswitch/flow_netlink.c @@ -2911,6 +2911,8 @@ static int validate_set(const struct nlattr *a, case OVS_KEY_ATTR_MPLS: if (!eth_p_mpls(eth_type)) return -EINVAL; + if (key_len != sizeof(struct ovs_key_mpls)) + return -EINVAL; break; case OVS_KEY_ATTR_SCTP: -- 2.51.0