]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
RDMA/mlx4: Make check for invalid flags stricter
authorDan Carpenter <dan.carpenter@linaro.org>
Thu, 29 Jun 2023 06:07:37 +0000 (09:07 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Aug 2023 08:22:37 +0000 (10:22 +0200)
commit6ab756a55e46ebc3944ac73d9c18f2321b0b150b
tree102cc217958c587e6584b6a034331fbeef27644c
parent9dde876a4dc8cc8be8ed4ccf34c137723f968a3a
RDMA/mlx4: Make check for invalid flags stricter

[ Upstream commit d64b1ee12a168030fbb3e0aebf7bce49e9a07589 ]

This code is trying to ensure that only the flags specified in the list
are allowed.  The problem is that ucmd->rx_hash_fields_mask is a u64 and
the flags are an enum which is treated as a u32 in this context.  That
means the test doesn't check whether the highest 32 bits are zero.

Fixes: 4d02ebd9bbbd ("IB/mlx4: Fix RSS hash fields restrictions")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/233ed975-982d-422a-b498-410f71d8a101@moroto.mountain
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/hw/mlx4/qp.c