Re: [PATCH] RDMA/hns: Fix arithmetic overflow in calc_hem_config()
From: Leon Romanovsky
Date: Sun May 10 2026 - 12:01:29 EST
On Mon, 13 Apr 2026 12:14:43 +0300, Alexander.Chesnokov@xxxxxxxxxxxxx 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@xxxxxxxxxx>