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

Alexander Chesnokov Alexander.Chesnokov at kaspersky.com
Fri Jul 17 10:18:58 MSK 2026


Добрый день!

Считаю, что эти патчи уровня minor. Так как один из них хоть и приняли, а второй решили дропнуть, так как David Laight не увидел в коде никаких проблем. 

-----Original Message-----
From: Fedor Pchelkin <pchelkin at ispras.ru> 
Sent: Thursday, July 16, 2026 11:22 PM
To: Alexander Chesnokov <Alexander.Chesnokov at kaspersky.com>; Sergey Grekhov <Sergey.Grekhov at kaspersky.com>
Cc: lvc-project at linuxtesting.org
Subject: Re: [lvc-project] [PATCH v2] RDMA/hns: Fix arithmetic overflow in hns_roce_v2_set_hem()

Caution: This is an external email.



On Thu, 09. Jul 04:56, Alexander Chesnokov wrote:
> > When does the value overflow.
> > Yes, the expression can overflow and the result is assigned to a 
> > 64bit variable, but I'd have testing this code would have showed the 
> > problem. So what is the customer visible impact?
>
> You're right, there is no reachable overflow. In 
> hns_roce_calc_hem_mhop() the 32-bit table_idx is split into 
> base-chunk_ba_num digits i, j, k, and here they are recombined: i * 
> chunk_ba_num + j equals table_idx / chunk_ba_num, and the full expression equals table_idx, which is u32.
> i is additionally bounded by ba_l0_num. So the arithmetic cannot 
> exceed U32_MAX on any real input - there is no customer-visible 
> impact, and the SVACE report is a false positive.
>
> I'll drop the Fixes: and Cc: stable tags and resend as a standalone 
> hardening/readability change. If you'd prefer to just drop it, that's 
> fine too.

Касаемо

NO_CAST.INTEGER_OVERFLOW: drivers/infiniband/hw/hns/hns_roce_hem.c:317 (https://lvc-svacer.ispras.ru/r/d8t4rr9r8jq9a46d5bag)
NO_CAST.INTEGER_OVERFLOW: drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4176 (https://lvc-svacer.ispras.ru/r/d9cjme9r8jqc4vlas8ag)

нам всё же стоит определиться, что это по итогу - Confirmed Major (сейчас стоит в разметках), Confirmed Minor, Won't fix или False positive.

От этого зависит необходимость портирования патчей в lvc-ветки и обязательность задач по Программе.  Они обязательны только для Major.
Я уже был готов добавить патчи, но прочитал этот тред и снова запутался.

Каков предлагается итоговый  вердикт в свейсере по этим предупреждениям
- оставляете как есть, снижаете до minor, ставите false positive или что-то другое ?

Считаете ли нужным добавление патчей в lvc-ветки? (мы ничего сильно против не имеем, в случае чего)

Ссылка на текущий тред в lore.kernel
https://lore.kernel.org/all/24c0a3cf43074b37bb1c9c321a73f470@kaspersky.com/T/#u


More information about the lvc-project mailing list