Re: [PATCH 1/5] lib/group_cpus: Let group_cpu_evenly() return the number of initialized masks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 6/17/25 06:43, Daniel Wagner wrote:
> group_cpu_evenly() might have allocated less groups then requested:
>
> group_cpu_evenly()
>    __group_cpus_evenly()
>      alloc_nodes_groups()
>        # allocated total groups may be less than numgrps when
>        # active total CPU number is less then numgrps
>
> In this case, the caller will do an out of bound access because the
> caller assumes the masks returned has numgrps.
>
> Return the number of groups created so the caller can limit the access
> range accordingly.
>
> Acked-by: Thomas Gleixner<tglx@xxxxxxxxxxxxx>
> Reviewed-by: Hannes Reinecke<hare@xxxxxxx>
> Reviewed-by: Ming Lei<ming.lei@xxxxxxxxxx>
> Signed-off-by: Daniel Wagner<wagi@xxxxxxxxxx>
> ---

Looks good.

Reviewed-by: Chaitanya Kulkarni <kch@xxxxxxxxxx>

-ck






[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux