Re: [PATCH v7] kernel.h: Retain constant expression output for max()/min()

2018-04-05 Thread Kees Cook
On Thu, Apr 5, 2018 at 3:09 PM, Kees Cook wrote: > On Thu, Apr 5, 2018 at 2:20 PM, Linus Torvalds > wrote: >> There may be others hiding that weren't caught by my limited build >> testing, trhough. So please keep an eye out for build

Re: [PATCH v7] kernel.h: Retain constant expression output for max()/min()

2018-04-05 Thread Kees Cook
On Thu, Apr 5, 2018 at 3:09 PM, Kees Cook wrote: > On Thu, Apr 5, 2018 at 2:20 PM, Linus Torvalds > wrote: >> There may be others hiding that weren't caught by my limited build >> testing, trhough. So please keep an eye out for build warnings. > > I'll spin up my full multi-arch allmodconfig

Re: [PATCH v7] kernel.h: Retain constant expression output for max()/min()

2018-04-05 Thread Kees Cook
On Thu, Apr 5, 2018 at 2:20 PM, Linus Torvalds wrote: > On Thu, Apr 5, 2018 at 1:42 PM, Linus Torvalds > wrote: >> >> Ok, applied. > > Ugh, during the merge window, we had actually grown a new example of > that "different enum types"

Re: [PATCH v7] kernel.h: Retain constant expression output for max()/min()

2018-04-05 Thread Kees Cook
On Thu, Apr 5, 2018 at 2:20 PM, Linus Torvalds wrote: > On Thu, Apr 5, 2018 at 1:42 PM, Linus Torvalds > wrote: >> >> Ok, applied. > > Ugh, during the merge window, we had actually grown a new example of > that "different enum types" problem: > > struct drm_prop_enum_list

Re: [PATCH v7] kernel.h: Retain constant expression output for max()/min()

2018-04-05 Thread Linus Torvalds
On Thu, Apr 5, 2018 at 1:42 PM, Linus Torvalds wrote: > > Ok, applied. Ugh, during the merge window, we had actually grown a new example of that "different enum types" problem: struct drm_prop_enum_list enum_list[max(DRM_COLOR_ENCODING_MAX,

Re: [PATCH v7] kernel.h: Retain constant expression output for max()/min()

2018-04-05 Thread Linus Torvalds
On Thu, Apr 5, 2018 at 1:42 PM, Linus Torvalds wrote: > > Ok, applied. Ugh, during the merge window, we had actually grown a new example of that "different enum types" problem: struct drm_prop_enum_list enum_list[max(DRM_COLOR_ENCODING_MAX,

Re: [PATCH v7] kernel.h: Retain constant expression output for max()/min()

2018-04-05 Thread Linus Torvalds
On Thu, Apr 5, 2018 at 1:31 PM, Kees Cook wrote: > > Yeah, I'm in no rush to collect the "unresponded" VLA patches into a > tree, and we've still got more to go, so right now it'd just be a > single-patch pull. If you can snag it now, that'd be great! :) Ok, applied.

Re: [PATCH v7] kernel.h: Retain constant expression output for max()/min()

2018-04-05 Thread Linus Torvalds
On Thu, Apr 5, 2018 at 1:31 PM, Kees Cook wrote: > > Yeah, I'm in no rush to collect the "unresponded" VLA patches into a > tree, and we've still got more to go, so right now it'd just be a > single-patch pull. If you can snag it now, that'd be great! :) Ok, applied. Linus

Re: [PATCH v7] kernel.h: Retain constant expression output for max()/min()

2018-04-05 Thread Kees Cook
On Thu, Apr 5, 2018 at 1:20 PM, Linus Torvalds wrote: > On Thu, Apr 5, 2018 at 12:52 PM, Kees Cook wrote: >> >> This patch seems finished (*knock on wood*). Do you want to take this >> directly for v4.17, should I send a single-patch

Re: [PATCH v7] kernel.h: Retain constant expression output for max()/min()

2018-04-05 Thread Kees Cook
On Thu, Apr 5, 2018 at 1:20 PM, Linus Torvalds wrote: > On Thu, Apr 5, 2018 at 12:52 PM, Kees Cook wrote: >> >> This patch seems finished (*knock on wood*). Do you want to take this >> directly for v4.17, should I send a single-patch pull-request, or >> should this go through -mm (for either

Re: [PATCH v7] kernel.h: Retain constant expression output for max()/min()

2018-04-05 Thread Linus Torvalds
On Thu, Apr 5, 2018 at 12:52 PM, Kees Cook wrote: > > This patch seems finished (*knock on wood*). Do you want to take this > directly for v4.17, should I send a single-patch pull-request, or > should this go through -mm (for either 4.17 or 4.18)? I was actually expecting

Re: [PATCH v7] kernel.h: Retain constant expression output for max()/min()

2018-04-05 Thread Linus Torvalds
On Thu, Apr 5, 2018 at 12:52 PM, Kees Cook wrote: > > This patch seems finished (*knock on wood*). Do you want to take this > directly for v4.17, should I send a single-patch pull-request, or > should this go through -mm (for either 4.17 or 4.18)? I was actually expecting it to go with the other

Re: [PATCH v7] kernel.h: Retain constant expression output for max()/min()

2018-04-05 Thread Kees Cook
On Fri, Mar 30, 2018 at 6:52 PM, Kees Cook wrote: > This patch updates the min()/max() macros to evaluate to a constant > expression when called on constant expression arguments. This removes Hi Linus, This patch seems finished (*knock on wood*). Do you want to take this

Re: [PATCH v7] kernel.h: Retain constant expression output for max()/min()

2018-04-05 Thread Kees Cook
On Fri, Mar 30, 2018 at 6:52 PM, Kees Cook wrote: > This patch updates the min()/max() macros to evaluate to a constant > expression when called on constant expression arguments. This removes Hi Linus, This patch seems finished (*knock on wood*). Do you want to take this directly for v4.17,

[PATCH v7] kernel.h: Retain constant expression output for max()/min()

2018-03-30 Thread Kees Cook
In the effort to remove all VLAs from the kernel[1], it is desirable to build with -Wvla. However, this warning is overly pessimistic, in that it is only happy with stack array sizes that are declared as constant expressions, and not constant values. One case of this is the evaluation of the max()

[PATCH v7] kernel.h: Retain constant expression output for max()/min()

2018-03-30 Thread Kees Cook
In the effort to remove all VLAs from the kernel[1], it is desirable to build with -Wvla. However, this warning is overly pessimistic, in that it is only happy with stack array sizes that are declared as constant expressions, and not constant values. One case of this is the evaluation of the max()