]> git.baikalelectronics.ru Git - kernel.git/commit
test_overflow: macrofy some more, do more tests for free
authorRasmus Villemoes <linux@rasmusvillemoes.dk>
Mon, 4 Jun 2018 06:41:27 +0000 (08:41 +0200)
committerKees Cook <keescook@chromium.org>
Tue, 5 Jun 2018 19:16:51 +0000 (12:16 -0700)
commitca97907fe53748c1cdf4570b485474649bfc2dc0
tree491427d7aca44d874fbbba56c2b3103f5f4725d1
parent65e0ebb97fc4d04f59f2f11dee308aebd7bd20a6
test_overflow: macrofy some more, do more tests for free

Obviously a+b==b+a and a*b==b*a, but the implementation of the fallback
checks are not entirely symmetric in how they treat a and b. So we might
as well check the (b,a,r,of) tuple as well as the (a,b,r,of) one for +
and *. Rather than more copy-paste, factor out the common part to
check_one_op.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Kees Cook <keescook@chromium.org>
lib/test_overflow.c