提交 cc4b9434 编写于 作者: M Maor Dickman 提交者: Zheng Zengkai

net/mlx5e: Don't match on Geneve options in case option masks are all zero

stable inclusion
from stable-5.10.27
commit 61219de4641363d87aa45c63bf8648cbaceaba78
bugzilla: 51493

--------------------------------

[ Upstream commit 385d40b0 ]

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: 9272e3df ("net/mlx5e: Geneve, Add support for encap/decap flows offload")
Signed-off-by: NMaor Dickman <maord@nvidia.com>
Reviewed-by: NRoi Dayan <roid@nvidia.com>
Reviewed-by: NOz Shlomo <ozsh@nvidia.com>
Reviewed-by: NYevgeny Kliteynik <kliteyn@nvidia.com>
Signed-off-by: NSaeed Mahameed <saeedm@nvidia.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: N  Weilong Chen <chenweilong@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 5eb64845
...@@ -227,6 +227,10 @@ static int mlx5e_tc_tun_parse_geneve_options(struct mlx5e_priv *priv, ...@@ -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_key = (struct geneve_opt *)&enc_opts.key->data[0];
option_mask = (struct geneve_opt *)&enc_opts.mask->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) { if (option_key->length > max_tlv_option_data_len) {
NL_SET_ERR_MSG_MOD(extack, NL_SET_ERR_MSG_MOD(extack,
"Matching on GENEVE options: unsupported option len"); "Matching on GENEVE options: unsupported option len");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册