[lvc-project] [PATCH] RDMA/hns: Fix arithmetic overflow in calc_hem_config()

Leon Romanovsky leon at kernel.org
Sun May 10 19:01:10 MSK 2026


On Mon, 13 Apr 2026 12:14:43 +0300, Alexander.Chesnokov at kaspersky.com wrote:
> If bt_num is 3 or 2, then the expressions like
> l0_idx * chunk_ba_num + l1_idx are computed in 32-bit
> arithmetic before being assigned to a u64 index field,
> which can lead to overflow.
> 
> Cast the first operand to u64 to ensure the arithmetic
> is performed in 64-bit.
> 
> [...]

Applied, thanks!

[1/1] RDMA/hns: Fix arithmetic overflow in calc_hem_config()
      https://git.kernel.org/rdma/rdma/c/784e12a8c45571

Best regards,
-- 
Leon Romanovsky <leon at kernel.org>




More information about the lvc-project mailing list