diff options
| author | Danila Chernetsov <listdansp@mail.ru> | 2026-06-27 09:59:51 +0000 |
|---|---|---|
| committer | Jason Gunthorpe <jgg@nvidia.com> | 2026-07-02 14:24:15 -0300 |
| commit | 9f0f2d2121f16d420199a82ac5bbc242269133b3 (patch) | |
| tree | 8a6d74de9d9eed00e96f7c5426ba215888b8c08b /Documentation/gpu/intel-display/git@git.tavy.me:linux.git | |
| parent | e939334ea7dd219f100f963dbb1cb43df520c20a (diff) | |
RDMA/hns: Fix potential integer overflow in mhop hem cleanup
In hns_roce_cleanup_mhop_hem_table(), the expression:
obj = i * buf_chunk_size / table->obj_size;
is evaluated using 32-bit unsigned arithmetic because
'buf_chunk_size' is u32 and the usual arithmetic conversions convert
'i' to unsigned int. The result is assigned to a u64 variable, but the
multiplication may overflow before the assignment.
For sufficiently large HEM tables, this produces an incorrect object
index passed to hns_roce_table_mhop_put().
Cast 'i' to u64 before the multiplication so that the intermediate
calculation is performed with 64-bit arithmetic.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Fixes: a25d13cbe816 ("RDMA/hns: Add the interfaces to support multi hop addressing for the contexts in hip08")
Link: https://patch.msgid.link/r/20260627095951.51378-1-listdansp@mail.ru
Signed-off-by: Danila Chernetsov <listdansp@mail.ru>
Reviewed-by: Junxian Huang <huangjunxian6@hisilicon.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'Documentation/gpu/intel-display/git@git.tavy.me:linux.git')
0 files changed, 0 insertions, 0 deletions
