Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp2452688imd; Fri, 2 Nov 2018 11:38:57 -0700 (PDT) X-Google-Smtp-Source: AJdET5cqf8RuVBePpCRq5xZhB4EyQ3hyf8QqkNvfkHVx0GM/zfZVPXFFzlB4lb2uFTKOyu1FPPXl X-Received: by 2002:a17:902:744a:: with SMTP id e10-v6mr12880014plt.61.1541183937810; Fri, 02 Nov 2018 11:38:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541183937; cv=none; d=google.com; s=arc-20160816; b=EB5iLQVVqL9CiDTVwTldsjGkhq5sQlVKp0Kx6q3LzV1F5SfQlIRxvtQEPsxxm1anq8 Ux0+2h5VmfvGbwObkt8RiceX7swIxMiejtca2ULpEzuks/e9WhN8G35RMSsM9TKSB+5l EjKk6D4VWRHJJS+zrfFLEv3luEtG2/Yrx0WCP0TWplb0Dk3JfGUf6AN17v5PThdGLcAB re1fAJeX84L+GGnjic7cog47sRpnp6pIRlSHXdBE3fMVHsXJwc1nDhD8/6WqK6ZvAyAC tK5ECDWjFjxhabZrqPuXt1BYYrMega8smqBUUpd6c+lcDxmAGi5dnBkXagshEJz9dUKR qWlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=4i8ksD/7OyCiSxPy14xrKKuOoocbAOAGkexCi8qOxkw=; b=B2MT8BRUYHkl/Usu4FavStF6NAEXn9Ya1BtiO5vGdkRrQCDLk1KzogH5CKNruXnzKy 1C19/a67ZKrGHvSN3yw3z4S/0qRdz/vjxsOze3UXpG54stCyMcTPnqxvFbySGks3TzDO WCSp+F9Fb2aLca8NgsAi65K/tLzltAJgE7Nk18c8xpv0rhQPGOxtzYpE3Qy7gHzCskhi 7jhCMw/ZIA5pjh6/QVDm+E9eovht3AJvdHfbGGac02iOrR2ItiHWTldc9hUh3kRPkpFO wO6YOYP1YH/4yZTL/+RGiVcDZ4DbDrVYojjTZ/P3yqNs+qDNgYSQYwf8iPXMP2xvyENp xnfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JEvLdL7u; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i1-v6si33593244pgm.328.2018.11.02.11.38.42; Fri, 02 Nov 2018 11:38:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JEvLdL7u; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728626AbeKCDpu (ORCPT + 99 others); Fri, 2 Nov 2018 23:45:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:39472 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727556AbeKCDpu (ORCPT ); Fri, 2 Nov 2018 23:45:50 -0400 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F0FFF2081B; Fri, 2 Nov 2018 18:37:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541183859; bh=wSFPyrk7T+BCyIjrTUcj08ZAYQt9jDvuyWMk+nFbmlM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JEvLdL7uDwpH1XVQOcyKQ0fVbn6vbqIoY1WSzgmyep2eXoHxX49pNVaCbpsQtuR7u aDdwtKGQSe9XRwMoHmM3yeZPD3CFlNfl3eU5Yb+QLQ0fzq5olL2OxffCPl7xSkxAke WUziq+y27Mjhhgd2SbZVvlE6JWvtxtt5FvfZ4CWU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Jaime=20Caama=C3=B1o=20Ruiz?= , Greg Rose , "David S. Miller" Subject: [PATCH 4.19 11/24] openvswitch: Fix push/pop ethernet validation Date: Fri, 2 Nov 2018 19:34:44 +0100 Message-Id: <20181102182841.472413721@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181102182839.725385066@linuxfoundation.org> References: <20181102182839.725385066@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: "Jaime Caama?o Ruiz" [ Upstream commit 46ebe2834ba5b541f28ee72e556a3fed42c47570 ] When there are both pop and push ethernet header actions among the actions to be applied to a packet, an unexpected EINVAL (Invalid argument) error is obtained. This is due to mac_proto not being reset correctly when those actions are validated. Reported-at: https://mail.openvswitch.org/pipermail/ovs-discuss/2018-October/047554.html Fixes: 91820da6ae85 ("openvswitch: add Ethernet push and pop actions") Signed-off-by: Jaime CaamaƱo Ruiz Tested-by: Greg Rose Reviewed-by: Greg Rose Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/openvswitch/flow_netlink.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/net/openvswitch/flow_netlink.c +++ b/net/openvswitch/flow_netlink.c @@ -3030,7 +3030,7 @@ static int __ovs_nla_copy_actions(struct * is already present */ if (mac_proto != MAC_PROTO_NONE) return -EINVAL; - mac_proto = MAC_PROTO_NONE; + mac_proto = MAC_PROTO_ETHERNET; break; case OVS_ACTION_ATTR_POP_ETH: @@ -3038,7 +3038,7 @@ static int __ovs_nla_copy_actions(struct return -EINVAL; if (vlan_tci & htons(VLAN_TAG_PRESENT)) return -EINVAL; - mac_proto = MAC_PROTO_ETHERNET; + mac_proto = MAC_PROTO_NONE; break; case OVS_ACTION_ATTR_PUSH_NSH: