mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/
synced 2026-09-28 19:20:30 +00:00
RDMA/mlx4: Prevent shift wrapping in set_user_sq_size()
The ucmd->log_sq_bb_count variable is controlled by the user so this shift can wrap. Fix it by using check_shl_overflow() in the same way that it was done in commit515f60004e("RDMA/hns: Prevent undefined behavior in hns_roce_set_user_sq_size()"). Fixes:839041329f("IB/mlx4: Sanity check userspace send queue sizes") Signed-off-by: Dan Carpenter <error27@gmail.com> Link: https://lore.kernel.org/r/a8dfbd1d-c019-4556-930b-bab1ded73b10@kili.mountain Signed-off-by: Leon Romanovsky <leon@kernel.org>
This commit is contained in:
parent
faa63656fc
commit
d50b3c73f1
1 changed files with 6 additions and 2 deletions
Loading…
Add table
Add a link
Reference in a new issue