Re: [PATCH -next] mm/memcg: Use struct_size() helper in kzalloc()

From: Muchun Song
Date: Thu Dec 16 2021 - 04:45:20 EST


On Thu, Dec 16, 2021 at 10:21 AM Wang Weiyang <wangweiyang2@xxxxxxxxxx> wrote:
>
> Make use of the struct_size() helper instead of an open-coded version, in
> order to avoid any potential type mistakes or integer overflows that, in
> the worst scenario, could lead to heap overflows.
>
> Link: https://github.com/KSPP/linux/issues/160
> Signed-off-by: Wang Weiyang <wangweiyang2@xxxxxxxxxx>

Reviewed-by: Muchun Song <songmuchun@xxxxxxxxxxxxx>