Re: [PATCH v2] mm/memory_hotplug: prevent accessing by index=-1

From: Oscar Salvador
Date: Fri Jun 07 2024 - 03:35:03 EST


On Thu, Jun 06, 2024 at 11:06:59AM +0300, Anastasia Belova wrote:
> nid may be equal to NUMA_NO_NODE=-1. Prevent accessing node_data
> array by invalid index with check for nid.
>
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
>
> Fixes: e83a437faa62 ("mm/memory_hotplug: introduce "auto-movable" online policy")
> Signed-off-by: Anastasia Belova <abelova@xxxxxxxxxxxxx>

Acked-by: Oscar Salvador <osalvador@xxxxxxx>

Thanks!

--
Oscar Salvador
SUSE Labs