linux/lib/kunit
David Gow 2d68df6cc4 kunit: Always print actual pointer values in asserts
KUnit assertions and expectations will print the values being tested. If
these are pointers (e.g., KUNIT_EXPECT_PTR_EQ(test, a, b)), these
pointers are currently printed with the %pK format specifier, which -- to
prevent information leaks which may compromise, e.g., ASLR -- are often
either hashed or replaced with ____ptrval____ or similar, making debugging
tests difficult.

By replacing %pK with %px as Documentation/core-api/printk-formats.rst
suggests, we disable this security feature for KUnit assertions and
expectations, allowing the actual pointer values to be printed. Given
that KUnit is not intended for use in production kernels, and the
pointers are only printed on failing tests, this seems like a worthwhile
tradeoff.

Signed-off-by: David Gow <davidgow@google.com>
Reviewed-by: Brendan Higgins <brendanhiggins@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2020-03-25 12:12:33 -06:00
..
assert.c kunit: Always print actual pointer values in asserts 2020-03-25 12:12:33 -06:00
Kconfig kunit: allow kunit to be loaded as a module 2020-01-09 16:43:40 -07:00
kunit-example-test.c kunit: allow kunit tests to be loaded as a module 2020-01-09 16:42:29 -07:00
kunit-test.c kunit: allow kunit tests to be loaded as a module 2020-01-09 16:42:29 -07:00
Makefile kunit: allow kunit to be loaded as a module 2020-01-09 16:43:40 -07:00
string-stream-test.c kunit: allow kunit tests to be loaded as a module 2020-01-09 16:42:29 -07:00
string-stream.c kunit: move string-stream.h to lib/kunit 2020-01-09 16:41:05 -07:00
string-stream.h kunit: move string-stream.h to lib/kunit 2020-01-09 16:41:05 -07:00
test.c kunit: allow kunit to be loaded as a module 2020-01-09 16:43:40 -07:00
try-catch-impl.h kunit: hide unexported try-catch interface in try-catch-impl.h 2020-01-09 16:42:09 -07:00
try-catch.c kunit: remove timeout dependence on sysctl_hung_task_timeout_seconds 2020-01-09 16:42:55 -07:00