From: Marco Elver Date: Thu, 22 Oct 2020 11:45:52 +0000 (+0200) Subject: kcsan: selftest: Ensure that address is at least PAGE_SIZE X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=4761612ffe3c1655e58f1ef9cf867c6f67d46fe2;p=linux.git kcsan: selftest: Ensure that address is at least PAGE_SIZE In preparation of supporting only addresses not within the NULL page, change the selftest to never use addresses that are less than PAGE_SIZE. Reviewed-by: Dmitry Vyukov Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney --- diff --git a/kernel/kcsan/selftest.c b/kernel/kcsan/selftest.c index d98bc208d06db..9014a3a82cf9c 100644 --- a/kernel/kcsan/selftest.c +++ b/kernel/kcsan/selftest.c @@ -33,6 +33,9 @@ static bool test_encode_decode(void) unsigned long addr; prandom_bytes(&addr, sizeof(addr)); + if (addr < PAGE_SIZE) + addr = PAGE_SIZE; + if (WARN_ON(!check_encodable(addr, size))) return false;