Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp2460437imd; Fri, 2 Nov 2018 11:47:41 -0700 (PDT) X-Google-Smtp-Source: AJdET5eS2InN4Cez4UuYEQfLivaaRmUBVXC3KOANnE+6CF0sfWiSRJEyTxgd186TMRstUlzltDIX X-Received: by 2002:a17:902:be0f:: with SMTP id r15-v6mr12505219pls.170.1541184461699; Fri, 02 Nov 2018 11:47:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541184461; cv=none; d=google.com; s=arc-20160816; b=jEaAKnBl3knZ9LGwT15p5F4Xvz88tspJsQmTvjDk0Sp2iGAkD5VPCCeZ9VYdOFn+83 2C2I4/dZJhC8q6pA0Aq0MbLChbeJSeS0GRWaRXFtqYubGlcUh7Y3BEg5I3LghZAqYGea D32D9ZWDINfadXu9CPGpKoTaBHnL+RvYH82LnF4Kt26KOSqDusg5uKB9Q8hzxrd/F6YS 2sHavji3iQc92i0jHSE+8Dkdq7disn/ObDHXfh3s2bwwfJepKBOKoOCyiMH+VDt602dI 8LTcRTwnXBuf6O5GlPlimOPj6azMJ6ksBS568TJxHOjpxGobohJk3doqRvub57ujSvDH WbTA== 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=8jobsDmCXClcEpVh+MUdaXK0usYkH5iEB9oeyn7X/9c=; b=PDu5zU2uzCpLuSW2iYiAgcse+YCXR5aFs/PX2fBYqf1RpG/ZKenXYIcTffNxtyy4NC uSnhGrPkieSq9LIXgeo3l+Jqnyy6m1S0rmgBY6x9FdQlzpZlXCZ+/5F3hiHFWdYTRPFt GCXXam6yWlXWR64/RlyXi+53z5G2/VNs5oWi/fqXclXhzrorfKSWToJPRl5u+Ip55rfC BQsPc2F1323ib5v1EVOwZnPwvpMGpQIGTaoxHsazju7n6dOfR3/6cX28gy+pouEzllKm 8k4i3IByxQ7nMlM/Z+JgOWyv6b7w7c+sQcN1+LgMev7wnWDUxOgeXPMEfU836r8wXQud tIvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uu81lJQ2; 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 a8-v6si34164073plz.94.2018.11.02.11.47.27; Fri, 02 Nov 2018 11:47:41 -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=uu81lJQ2; 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 S1730418AbeKCDy7 (ORCPT + 99 others); Fri, 2 Nov 2018 23:54:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:50920 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729000AbeKCDy6 (ORCPT ); Fri, 2 Nov 2018 23:54:58 -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 205E220847; Fri, 2 Nov 2018 18:46:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541184404; bh=hjn5++CyWpKUb0g0ROlA4JV1jlRBxcTCBcIB+dhzGCg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uu81lJQ2JlE+kcgTsJAIs82O6vWl11j19YyRXnI8NOHat6ykbAeu+BsZP41zk2fKO qagIXidRo4Jgwx/QuoPPkF3e8vUdsFiJBm6iuypFMoyG7BomuuozKMY1aCiNxfyBzy UPXTm8idi41TiQ86u/3/XbeZaxJj0XTy7Hz5BzCY= 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.18 125/150] openvswitch: Fix push/pop ethernet validation Date: Fri, 2 Nov 2018 19:34:47 +0100 Message-Id: <20181102182911.599206188@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181102182902.250560510@linuxfoundation.org> References: <20181102182902.250560510@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.18-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 @@ -2990,7 +2990,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: @@ -2998,7 +2998,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: