提交 4761612f 编写于 作者: M Marco Elver 提交者: Paul E. McKenney

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: NDmitry Vyukov <dvyukov@google.com>
Signed-off-by: NMarco Elver <elver@google.com>
Signed-off-by: NPaul E. McKenney <paulmck@kernel.org>
上级 3650b228
...@@ -33,6 +33,9 @@ static bool test_encode_decode(void) ...@@ -33,6 +33,9 @@ static bool test_encode_decode(void)
unsigned long addr; unsigned long addr;
prandom_bytes(&addr, sizeof(addr)); prandom_bytes(&addr, sizeof(addr));
if (addr < PAGE_SIZE)
addr = PAGE_SIZE;
if (WARN_ON(!check_encodable(addr, size))) if (WARN_ON(!check_encodable(addr, size)))
return false; return false;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册