diff options
author | 2020-10-22 13:45:52 +0200 | |
---|---|---|
committer | 2020-11-02 17:08:50 -0800 | |
commit | 4761612ffe3c1655e58f1ef9cf867c6f67d46fe2 (patch) | |
tree | 525e4d847f8f55254f0601e2051cabfe6e78603f /kernel/kcsan/selftest.c | |
parent | Linux 5.10-rc1 (diff) | |
download | linux-4761612ffe3c1655e58f1ef9cf867c6f67d46fe2.tar.gz linux-4761612ffe3c1655e58f1ef9cf867c6f67d46fe2.tar.bz2 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/selftest.c')
-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; |