Re: [PATCH] mlx5: bound raw flow rule match parameter copies

From: Leon Romanovsky

Date: Mon Mar 23 2026 - 13:52:37 EST


On Sun, Mar 22, 2026 at 11:19:22AM +0800, Pengpeng Hou wrote:
> `_create_raw_flow_rule()` copies user-supplied match data and matcher
> mask bytes directly into the fixed `mlx5_flow_spec` arrays. The UAPI
> allows up to `MLX5_IB_DW_MATCH_PARAM` bytes for the input attributes,
> but the kernel object only allocates
> `MLX5_ST_SZ_DW(fte_match_param)` bytes for each buffer.
>
> Validate the sizes before copying so oversized verbs requests cannot
> corrupt the spec object.
>
> Signed-off-by: Pengpeng Hou <pengpeng@xxxxxxxxxxx>
> ---
> drivers/infiniband/hw/mlx5/fs.c | 6 ++++++
> 1 file changed, 6 insertions(+)

I suggest you to simply change MLX5_IB_DW_MATCH_PARAM value from 0xA0 to
be 0x80.

Thanks