Re: [PATCH] lib: test_overflow: Avoid taining the kernel and fix wrap size

From: Joe Perches
Date: Tue May 28 2019 - 19:43:36 EST


On Tue, 2019-05-28 at 15:51 -0700, Kees Cook wrote:
> 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.
[]
> diff --git a/lib/test_overflow.c b/lib/test_overflow.c
[]
> @@ -486,16 +486,17 @@ static int __init test_overflow_shift(void)
[]
> +#define alloc_GFP (GFP_KERNEL | __GFP_NOWARN)
[]
> +#define alloc110(alloc, arg, sz) alloc(arg, sz, alloc_GFP | __GFP_NOWARN)

seems redundant.