summaryrefslogtreecommitdiffstats
path: root/kernel/kcsan
diff options
context:
space:
mode:
authorMarco Elver <elver@google.com>2020-10-22 13:45:52 +0200
committerPaul E. McKenney <paulmck@kernel.org>2020-11-03 02:08:50 +0100
commit4761612ffe3c1655e58f1ef9cf867c6f67d46fe2 (patch)
tree525e4d847f8f55254f0601e2051cabfe6e78603f /kernel/kcsan
parentLinux 5.10-rc1 (diff)
downloadlinux-4761612ffe3c1655e58f1ef9cf867c6f67d46fe2.tar.xz
linux-4761612ffe3c1655e58f1ef9cf867c6f67d46fe2.zip
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 <dvyukov@google.com> Signed-off-by: Marco Elver <elver@google.com> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Diffstat (limited to 'kernel/kcsan')
-rw-r--r--kernel/kcsan/selftest.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/kcsan/selftest.c b/kernel/kcsan/selftest.c
index d98bc208d06d..9014a3a82cf9 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;