Re: [PATCH] x86/xen: Remove use of VLAs
- Date: Fri, 13 Apr 2018 20:55:53 -0600
- From: David Brown <david.brown@xxxxxxxxxx>
- Subject: Re: [PATCH] x86/xen: Remove use of VLAs
On Fri, Apr 13, 2018 at 03:11:46PM -0700, Laura Abbott wrote:
There's an ongoing effort to remove VLAs from the kernel to eventually
turn on -Wvla. The few VLAs in use have an upper bound based on a size
of 64K. This doesn't produce an excessively large stack so just switch
the upper bound.
This comment is more in regards to many of these patches, and not as
much this one specifically.
How confident are we in the upper bounds we're setting, and how
obvious is it in the resulting code so that something does later
change to overflow these bounds.
The danger here is that we're converting something a little easier to
detect (a stack overflow), with something harder to detect
(overflowing an array on the stack).
I guess the question is twofold: how did you determine that 64K was
the largest 'size' value, and how should reviewers verify this as
well. Perhaps this should at least be in the commit text so someone
tracking down something with this code can find it later.