]> git.baikalelectronics.ru Git - kernel.git/commit
lib: add runtime test of check_*_overflow functions
authorRasmus Villemoes <linux@rasmusvillemoes.dk>
Mon, 7 May 2018 22:36:28 +0000 (00:36 +0200)
committerKees Cook <keescook@chromium.org>
Tue, 5 Jun 2018 19:16:51 +0000 (12:16 -0700)
commitd14d44493d96eef991ab90bf04110f27de958ec4
treed100b0647b858d100609b4115680e1349cc912aa
parent7b2b649098058ed99b96b6da822acfeee884ca30
lib: add runtime test of check_*_overflow functions

This adds a small module for testing that the check_*_overflow
functions work as expected, whether implemented in C or using gcc
builtins.

Example output:

test_overflow: u8 : 18 tests
test_overflow: s8 : 19 tests
test_overflow: u16: 17 tests
test_overflow: s16: 17 tests
test_overflow: u32: 17 tests
test_overflow: s32: 17 tests
test_overflow: u64: 17 tests
test_overflow: s64: 21 tests

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
[kees: add output to commit log, drop u64 tests on 32-bit]
Signed-off-by: Kees Cook <keescook@chromium.org>
lib/Kconfig.debug
lib/Makefile
lib/test_overflow.c [new file with mode: 0644]