Commit 8e087a2a authored by Kees Cook's avatar Kees Cook Committed by Greg Kroah-Hartman
Browse files

lib/test_overflow.c: avoid tainting the kernel and fix wrap size

[ Upstream commit 8e060c21 ]

This adds __GFP_NOWARN to the kmalloc()-portions of the overflow test to
avoid tainting the kernel.  Additionally fixes up the math on wrap size
to be architecture and page size agnostic.

Link: http://lkml.kernel.org/r/201905282012.0A8767E24@keescook


Fixes: ca90800a ("test_overflow: Add memory allocation overflow tests")
Signed-off-by: default avatarKees Cook <keescook@chromium.org>
Reported-by: default avatarRandy Dunlap <rdunlap@infradead.org>
Suggested-by: default avatarRasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: Joe Perches <joe@perches.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 439c79ed
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment