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 37E893E92A5; Tue, 31 Mar 2026 16:25:41 +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=1774974341; cv=none; b=Z8fhpi4XXKLopbyBWSEY0RObX6BaNIm06Y1Dok10JTXF5m3EKbBDo7xObE7/JT/3T4sClt1FPr/28QfqJTs1duqEzV6YuFebkzPRz53+g9VjmYXyxF0EARKUStastiSJNjudqHjuJRpkOjXWfmOkWMA4qTSxa/JJQUEC0jiv0j0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774974341; c=relaxed/simple; bh=UPQCiBo1yhGHwOy2g8fuosSzdF/oZzE+jopKXRtLcFY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=crSnem82jBk7P6VlhgUkXFTa/ssSCZNek2KcvDoYNA3eAqaOVqjHt9Pt3+LmXEuOZM8dW+Ooe7vBhD4pcRpPnnZFHfTZtFZKICapmcJCvs5u/3NRTv2l5RvbjKaMRVMs9/s8Vl/tf6A/by4wR+Nj+JL1Y7qr0lB4NUUffL5Mp7w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=gi9+5F/y; 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="gi9+5F/y" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A12ADC19423; Tue, 31 Mar 2026 16:25:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1774974341; bh=UPQCiBo1yhGHwOy2g8fuosSzdF/oZzE+jopKXRtLcFY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gi9+5F/yUWSa22wD6KnjLUCrrQq9zoiDm6PYuSIQjjkXbgG38plIPpSQJYpPIT/9b eSoeDrv9xXC9Wy1y+WJRwvAR2y1hkJcQa66oD/+nWztX7Z/mTuNg1o/GWhjgyqEoHT vfFotDUYWANVSZpgragDfYALkttY1Qs0UqTzTCVk= 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 6.6 048/175] openvswitch: validate MPLS set/set_masked payload length Date: Tue, 31 Mar 2026 18:20:32 +0200 Message-ID: <20260331161731.550781384@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260331161729.779738837@linuxfoundation.org> References: <20260331161729.779738837@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-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 1d9a44d6216af..b31abd5508f55 100644 --- a/net/openvswitch/flow_netlink.c +++ b/net/openvswitch/flow_netlink.c @@ -2939,6 +2939,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