The patch titled Subject: kernelh-skip-single-eval-logic-on-literals-in-min-max-v2 has been added to the -mm tree. Its filename is kernelh-skip-single-eval-logic-on-literals-in-min-max-v2.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/kernelh-skip-single-eval-logic-on-literals-in-min-max-v2.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/kernelh-skip-single-eval-logic-on-literals-in-min-max-v2.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Kees Cook <keescook@xxxxxxxxxxxx> Subject: kernelh-skip-single-eval-logic-on-literals-in-min-max-v2 - fix copy/paste-o max1_/max2_ (ijc) - clarify "compile-time" constant in comment (Rasmus) - clean up formatting on min_t()/max_t() Link: http://lkml.kernel.org/r/20180308233758.GA22120@beast Signed-off-by: Kees Cook <keescook@xxxxxxxxxxxx> Cc: Josh Poimboeuf <jpoimboe@xxxxxxxxxx> Cc: Rasmus Villemoes <linux@xxxxxxxxxxxxxxxxxx> Cc: Ian Campbell <ijc@xxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- diff -puN include/linux/kernel.h~kernelh-skip-single-eval-logic-on-literals-in-min-max-v2 include/linux/kernel.h --- a/include/linux/kernel.h~kernelh-skip-single-eval-logic-on-literals-in-min-max-v2 +++ a/include/linux/kernel.h @@ -797,8 +797,8 @@ static inline void ftrace_dump(enum ftra min1 < min2 ? min1 : min2; }) /* - * In the case of builtin constant values, there is no need to do the - * double-evaluation protection, so the raw comparison can be made. + * In the case of compile-time constant values, there is no need to do + * the double-evaluation protection, so the raw comparison can be made. * This allows min()/max() to be used in stack array allocations and * avoid the compiler thinking it is a dynamic value leading to an * accidental VLA. @@ -809,8 +809,8 @@ static inline void ftrace_dump(enum ftra __builtin_types_compatible_p(t1, t2), \ (t1)(x) < (t2)(y) ? (t1)(x) : (t2)(y), \ __single_eval_min(t1, t2, \ - __UNIQUE_ID(max1_), \ - __UNIQUE_ID(max2_), \ + __UNIQUE_ID(min1_), \ + __UNIQUE_ID(min2_), \ x, y)) /** @@ -892,9 +892,7 @@ static inline void ftrace_dump(enum ftra * @x: first value * @y: second value */ -#define min_t(type, x, y) \ - __min(type, type, \ - x, y) +#define min_t(type, x, y) __min(type, type, x, y) /** * max_t - return maximum of two values, using the specified type @@ -902,9 +900,7 @@ static inline void ftrace_dump(enum ftra * @x: first value * @y: second value */ -#define max_t(type, x, y) \ - __max(type, type, \ - x, y) +#define max_t(type, x, y) __max(type, type, x, y) /** * clamp_t - return a value clamped to a given range using a given type _ Patches currently in -mm which might be from keescook@xxxxxxxxxxxx are bug-use-%pb-in-bug-and-stack-protector-failure.patch bug-exclude-non-bug-warn-exceptions-from-report_bug.patch taint-convert-to-indexed-initialization.patch taint-consolidate-documentation.patch taint-add-taint-for-randstruct.patch kernelh-skip-single-eval-logic-on-literals-in-min-max.patch kernelh-skip-single-eval-logic-on-literals-in-min-max-v2.patch test_bitmap-do-not-accidentally-use-stack-vla.patch fork-unconditionally-clear-stack-on-fork.patch exec-pass-stack-rlimit-into-mm-layout-functions.patch exec-introduce-finalize_exec-before-start_thread.patch exec-pin-stack-limit-during-exec.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html