Patch "net/mlx5e: Don't match on Geneve options in case option masks are all zero" has been added to the 5.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

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

to the 5.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     net-mlx5e-don-t-match-on-geneve-options-in-case-opti.patch
and it can be found in the queue-5.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 590c1d542c4ccc318472c0669eb48bb0e71ab28a
Author: Maor Dickman <maord@xxxxxxxxxx>
Date:   Tue Feb 16 13:39:18 2021 +0200

    net/mlx5e: Don't match on Geneve options in case option masks are all zero
    
    [ 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 <maord@xxxxxxxxxx>
    Reviewed-by: Roi Dayan <roid@xxxxxxxxxx>
    Reviewed-by: Oz Shlomo <ozsh@xxxxxxxxxx>
    Reviewed-by: Yevgeny Kliteynik <kliteyn@xxxxxxxxxx>
    Signed-off-by: Saeed Mahameed <saeedm@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

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");



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux