diff options
author | Kees Cook <keescook@chromium.org> | 2018-05-11 01:40:03 +0200 |
---|---|---|
committer | Kees Cook <keescook@chromium.org> | 2018-06-05 21:16:51 +0200 |
commit | ca90800a91ba723d78ded634d037c1d2df8b54d6 (patch) | |
tree | 5c709a41d95010d66d7a3f22607614ae117f66d2 /lib/test_sysctl.c | |
parent | overflow.h: Add allocation size calculation helpers (diff) | |
download | linux-ca90800a91ba723d78ded634d037c1d2df8b54d6.tar.xz linux-ca90800a91ba723d78ded634d037c1d2df8b54d6.zip |
test_overflow: Add memory allocation overflow tests
Make sure that the memory allocators are behaving as expected in the face
of overflows of multiplied arguments or when using the array_size()-family
helpers.
Example output of new tests (with the expected __alloc_pages_slowpath
and vmalloc warnings about refusing giant allocations removed):
[ 93.062076] test_overflow: kmalloc detected saturation
[ 93.062988] test_overflow: kmalloc_node detected saturation
[ 93.063818] test_overflow: kzalloc detected saturation
[ 93.064539] test_overflow: kzalloc_node detected saturation
[ 93.120386] test_overflow: kvmalloc detected saturation
[ 93.143458] test_overflow: kvmalloc_node detected saturation
[ 93.166861] test_overflow: kvzalloc detected saturation
[ 93.189924] test_overflow: kvzalloc_node detected saturation
[ 93.221671] test_overflow: vmalloc detected saturation
[ 93.246326] test_overflow: vmalloc_node detected saturation
[ 93.270260] test_overflow: vzalloc detected saturation
[ 93.293824] test_overflow: vzalloc_node detected saturation
[ 93.294597] test_overflow: devm_kmalloc detected saturation
[ 93.295383] test_overflow: devm_kzalloc detected saturation
[ 93.296217] test_overflow: all tests passed
Signed-off-by: Kees Cook <keescook@chromium.org>
Diffstat (limited to 'lib/test_sysctl.c')
0 files changed, 0 insertions, 0 deletions