[PATCH] regulator: mt6359: Fix UBSAN shift-out-of-bounds
Mark Brown
broonie at kernel.org
Thu Aug 29 04:59:18 PDT 2024
On Thu, Aug 29, 2024 at 10:58:07AM +0800, Jian Hui Lee wrote:
> A shift-out-of-bounds will occur as caught by LTP fs:read_all_sys, if
> modeset_mask has not been set for MT6359_LDO_LINEAR regulators.
>
> Example command on MediaTek Genio 1200-EVK:
> # cat /sys/devices/platform/soc/10024000.pwrap/10024000.pwrap\:pmic/regulator/regulator.28/opmode
>
> This patch initializes the member modeset_reg to zero, and checks it
> before any further actions.
It would be better to fix this by not registering any mode operations
for the relevant regulators, that will catch these and any other or
future issues.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-mediatek/attachments/20240829/cb1748f1/attachment-0001.sig>
More information about the Linux-mediatek
mailing list