diff options
author | Marco Elver <elver@google.com> | 2020-10-22 14:45:52 +0300 |
---|---|---|
committer | Paul E. McKenney <paulmck@kernel.org> | 2020-11-03 04:08:50 +0300 |
commit | 4761612ffe3c1655e58f1ef9cf867c6f67d46fe2 (patch) | |
tree | 525e4d847f8f55254f0601e2051cabfe6e78603f /kernel/kcsan | |
parent | 3650b228f83adda7e5ee532e2b90429c03f7b9ec (diff) | |
download | linux-4761612ffe3c1655e58f1ef9cf867c6f67d46fe2.tar.xz |
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.c | 3 |
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; |