Skip to content
Commit 4ad319cd authored by Yevgeny Kliteynik's avatar Yevgeny Kliteynik Committed by Greg Kroah-Hartman
Browse files

net/mlx5: DR, Fix slab-out-of-bounds in mlx5_cmd_dr_create_fte

commit 0aec12d9 upstream.

When adding a rule with 32 destinations, we hit the following out-of-band
access issue:

  BUG: KASAN: slab-out-of-bounds in mlx5_cmd_dr_create_fte+0x18ee/0x1e70

This patch fixes the issue by both increasing the allocated buffers to
accommodate for the needed actions and by checking the number of actions
to prevent this issue when a rule with too many actions is provided.

Fixes: 1ffd4989

 ("net/mlx5: DR, Increase supported num of actions to 32")
Signed-off-by: default avatarYevgeny Kliteynik <kliteyn@nvidia.com>
Reviewed-by: default avatarAlex Vesker <valex@nvidia.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent fe992d6a
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment