]> 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)
commit418089e6a81b57e22b09063c22c518f7e09b765d
tree491427d7aca44d874fbbba56c2b3103f5f4725d1
parentd14d44493d96eef991ab90bf04110f27de958ec4
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