[lvc-project] [PATCH] gpiolib: acpi: use BIT_ULL() for u64 mask in address space handler

Fedor Pchelkin pchelkin at ispras.ru
Tue Jan 27 13:55:21 MSK 2026


On Mon, 26. Jan 06:59, Denis Sergeev wrote:
> The BIT() macro uses unsigned long, which is 32 bits on 32-bit
> architectures. When iterating over GPIO pins with index >= 32,
> the expression (*value & BIT(i)) causes undefined behavior due
> to shifting by a value >= type width.
> 
> Since 'value' is a pointer to u64, use BIT_ULL() to ensure correct
> 64-bit mask on all architectures.
> 
> Found by Linux Verification Center (linuxtesting.org) with Svace.
> 
> Fixes: 2c4d00cb8fc5 ("gpiolib: acpi: Use BIT() macro to increase readability")

Ошибка существовала до этого коммита, он лишь неявным образом перевёл код
перевёл на использование unsigned long вместо int.

Нужно направить этот патч-зависимость и текущий патч в виде серии под
ветку 5.10, чтобы исправить там проблему.  Адресатом является только
список рассылки lvc-patches.

[PATCH 5.10 1/2]
|
+- [PATCH 5.10 2/2]

> Signed-off-by: Denis Sergeev <denserg.edu at gmail.com>



More information about the lvc-project mailing list