Re: [PATCH 1/2][next] mm: memcontrol: Use flex_array_size() helper in memcpy()

2020-08-04 Thread Michal Hocko
On Fri 31-07-20 12:12:53, Gustavo A. R. Silva wrote: > Make use of the flex_array_size() helper to calculate the size of a > flexible array member within an enclosing structure. > > This helper offers defense-in-depth against potential integer > overflows, while at the same time makes it explicitl

[PATCH 1/2][next] mm: memcontrol: Use flex_array_size() helper in memcpy()

2020-07-31 Thread Gustavo A. R. Silva
Make use of the flex_array_size() helper to calculate the size of a flexible array member within an enclosing structure. This helper offers defense-in-depth against potential integer overflows, while at the same time makes it explicitly clear that we are dealing with a flexible array member. Also