Re: [PATCH] x86/uv/time: Replace one-element array and save heap space

2020-09-29 Thread Thomas Gleixner
On Mon, May 18 2020 at 14:01, Gustavo A. R. Silva wrote: > The current codebase makes use of one-element arrays in the following > form: > > struct something { > int length; > u8 data[1]; > }; > > struct something *instance; > > instance = kmalloc(sizeof(*instance) + size, GFP_KERNEL); > in

Re: [PATCH] x86/uv/time: Replace one-element array and save heap space

2020-09-29 Thread Gustavo A. R. Silva
Hi all, Who can take this? Thanks -- Gustavo On 5/21/20 18:24, Gustavo A. R. Silva wrote: > [+CC John Stultz and +Kees' Reviewed-by tag] > > Reviewed-by: Kees Cook > > On Mon, May 18, 2020 at 02:01:14PM -0500, Gustavo A. R. Silva wrote: >> The current codebase makes use of one-element arrays

Re: [PATCH] x86/uv/time: Replace one-element array and save heap space

2020-05-21 Thread Gustavo A. R. Silva
[+CC John Stultz and +Kees' Reviewed-by tag] Reviewed-by: Kees Cook On Mon, May 18, 2020 at 02:01:14PM -0500, Gustavo A. R. Silva wrote: > The current codebase makes use of one-element arrays in the following > form: > > struct something { > int length; > u8 data[1]; > }; > > struct s

Re: [PATCH] x86/uv/time: Replace one-element array and save heap space

2020-05-20 Thread Joe Perches
On Wed, 2020-05-20 at 10:19 -0700, Kees Cook wrote: > On Mon, May 18, 2020 at 12:09:16PM -0700, Joe Perches wrote: > > On Mon, 2020-05-18 at 14:01 -0500, Gustavo A. R. Silva wrote: > > > The current codebase makes use of one-element arrays in the following > > > form: > > > > > > struct something

Re: [PATCH] x86/uv/time: Replace one-element array and save heap space

2020-05-20 Thread Kees Cook
On Mon, May 18, 2020 at 12:09:16PM -0700, Joe Perches wrote: > On Mon, 2020-05-18 at 14:01 -0500, Gustavo A. R. Silva wrote: > > The current codebase makes use of one-element arrays in the following > > form: > > > > struct something { > > int length; > > u8 data[1]; > > }; > [] > > This i

Re: [PATCH] x86/uv/time: Replace one-element array and save heap space

2020-05-18 Thread Gustavo A. R. Silva
On Mon, May 18, 2020 at 12:09:16PM -0700, Joe Perches wrote: > On Mon, 2020-05-18 at 14:01 -0500, Gustavo A. R. Silva wrote: > > The current codebase makes use of one-element arrays in the following > > form: > > > > struct something { > > int length; > > u8 data[1]; > > }; > [] > > This i

Re: [PATCH] x86/uv/time: Replace one-element array and save heap space

2020-05-18 Thread Joe Perches
On Mon, 2020-05-18 at 14:01 -0500, Gustavo A. R. Silva wrote: > The current codebase makes use of one-element arrays in the following > form: > > struct something { > int length; > u8 data[1]; > }; [] > This issue has been out there since 2009. > This issue was found with the help of Cocci

[PATCH] x86/uv/time: Replace one-element array and save heap space

2020-05-18 Thread Gustavo A. R. Silva
The current codebase makes use of one-element arrays in the following form: struct something { int length; u8 data[1]; }; struct something *instance; instance = kmalloc(sizeof(*instance) + size, GFP_KERNEL); instance->length = size; memcpy(instance->data, source, size); but the preferre