Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3489792pxf; Mon, 29 Mar 2021 03:49:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJydnnSIYaEloGjwDl17SrEm7SSj1w/1P1b9mkrnu0YKHUYEOp1wcnhBes9xhY04qTJnhiBX X-Received: by 2002:a17:906:a1c5:: with SMTP id bx5mr28984628ejb.166.1617014942807; Mon, 29 Mar 2021 03:49:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617014942; cv=none; d=google.com; s=arc-20160816; b=N0D+FTQeHY+u4CmyZZAK3TLlAyoHvIt29vFm4e1NTW1gmBT7Cq3wqk6goJYmb8kAcX 4Ow3eOK55uOopRxcyIyob4p2F9nimLNmQdp/ufQ4fZ+BI+yQbFlw1/MLkB7zb9XpcCLO 1DdrRf+W61NChjuzOssi+PuDM7+wuOsZ+EJ1SJAzYFAi1+hHFSusEKb++7ykkfifICkl ZeUDykgU23qjDDif6W8/SejeHXVf7ObcnZySovD++fnw8htVR0dbqE02tclGea7rz5fK 5aVb0ajylS2yL40nGXcQWrLihaSpzMGKR8Ul9UUF0Iui5I68+S4oTxYR3wCXmSs7TRfQ cIow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=1rhZmfIvDQGglRz/JSGrlETcj902rpEXSYGt/uuYzF4=; b=Bs1p3Etg0VKB28w4V8sQxd+l+mpJzFgJkJ5VCM7lBG9jVOx6bBWTzKSb9m0dv8Oe8E Oq1XxhQA+RXAG4/SPCCm9+yjQ1xYmDId4uTRb7JfnKFDplmxnpd7v+3YCqb56eaFz8UP bHNSHAPzJlilN/CEnKIJfeXRU8/S+2pyKOe3a0sb038s6ud5gzAcumjBQ2ffFnUxYVK+ V9qCIUOrYZUsbfJzYlRMruwO3pczVRs4ZVvf9fLlLHjUmPBZFFagIZuFWm/QIJ528Gn6 nfFBdbNM9WUwo7N/YGpfK1x+s8LGSMuk9O3wj0QMpWHd4JnhB6nv4c1CxAZduAs7Fg6C 6zoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=x4KytYj0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jp24si11966838ejb.512.2021.03.29.03.48.40; Mon, 29 Mar 2021 03:49:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=x4KytYj0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233490AbhC2Iib (ORCPT + 99 others); Mon, 29 Mar 2021 04:38:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:39514 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234068AbhC2IW4 (ORCPT ); Mon, 29 Mar 2021 04:22:56 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 90DC761477; Mon, 29 Mar 2021 08:22:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617006176; bh=BTO/1GcwPwTQ+bImPfQvbJjmHspcXcCTBFt3552rWbc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=x4KytYj0LUhqDKnC8fFK01YkEQ9UQRgdoSni03gnf3u+9k4El73opNtEZmHQWPp8i kMo0KkvzE89NjsRQ7Iwhqc/21NC/KOWHVARGwrN2XvhVv4hNoG2jNyZ78U1kZk+Lnu Ua1nmEjTgNJ2216A7M9twpzmzwEvwS0LNhM86Kis= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Maor Dickman , Roi Dayan , Oz Shlomo , Yevgeny Kliteynik , Saeed Mahameed , Sasha Levin Subject: [PATCH 5.10 099/221] net/mlx5e: Dont match on Geneve options in case option masks are all zero Date: Mon, 29 Mar 2021 09:57:10 +0200 Message-Id: <20210329075632.507289051@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210329075629.172032742@linuxfoundation.org> References: <20210329075629.172032742@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Maor Dickman [ Upstream commit 385d40b042e60aa0b677d7b400a0fefb44bcbaf4 ] The cited change added offload support for Geneve options without verifying the validity of the options masks, this caused offload of rules with match on Geneve options with class,type and data masks which are zero to fail. Fix by ignoring the match on Geneve options in case option masks are all zero. Fixes: 9272e3df3023 ("net/mlx5e: Geneve, Add support for encap/decap flows offload") Signed-off-by: Maor Dickman Reviewed-by: Roi Dayan Reviewed-by: Oz Shlomo Reviewed-by: Yevgeny Kliteynik Signed-off-by: Saeed Mahameed Signed-off-by: Sasha Levin --- drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_geneve.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_geneve.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_geneve.c index e472ed0eacfb..7ed3f9f79f11 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_geneve.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_geneve.c @@ -227,6 +227,10 @@ static int mlx5e_tc_tun_parse_geneve_options(struct mlx5e_priv *priv, option_key = (struct geneve_opt *)&enc_opts.key->data[0]; option_mask = (struct geneve_opt *)&enc_opts.mask->data[0]; + if (option_mask->opt_class == 0 && option_mask->type == 0 && + !memchr_inv(option_mask->opt_data, 0, option_mask->length * 4)) + return 0; + if (option_key->length > max_tlv_option_data_len) { NL_SET_ERR_MSG_MOD(extack, "Matching on GENEVE options: unsupported option len"); -- 2.30.1