Re: selftests: Linux Kernel Dump Test Module output

Kees Cook
2020-02-26T18:49:33Z

On Wed, Feb 26, 2020 at 11:53:37AM +0000, Cristian Marussi wrote:
> Sorry I lost track of this thread....tested now on v5.6rc3 on arm64 on a local
> setup (not proper CI) with CONFIG_LKDTM=y and solves the above issue. (missing CONFIG_LKDTM?)

Great!

> Looking at the general run though I have anyway a bunch of SKIP similar to Naresh
>
> ./run_kselftest.sh 2>/dev/null | grep "SKIP"
> not ok 1 selftests: lkdtm: PANIC.sh # SKIP
> not ok 6 selftests: lkdtm: LOOP.sh # SKIP
> not ok 7 selftests: lkdtm: EXHAUST_STACK.sh # SKIP
> not ok 8 selftests: lkdtm: CORRUPT_STACK.sh # SKIP
> not ok 9 selftests: lkdtm: CORRUPT_STACK_STRONG.sh # SKIP
> not ok 15 selftests: lkdtm: UNSET_SMEP.sh # SKIP
> not ok 16 selftests: lkdtm: DOUBLE_FAULT.sh # SKIP
> not ok 18 selftests: lkdtm: OVERWRITE_ALLOCATION.sh # SKIP
> not ok 19 selftests: lkdtm: WRITE_AFTER_FREE.sh # SKIP
> not ok 21 selftests: lkdtm: WRITE_BUDDY_AFTER_FREE.sh # SKIP
> not ok 26 selftests: lkdtm: SOFTLOCKUP.sh # SKIP
> not ok 27 selftests: lkdtm: HARDLOCKUP.sh # SKIP
> not ok 28 selftests: lkdtm: SPINLOCKUP.sh # SKIP
> not ok 29 selftests: lkdtm: HUNG_TASK.sh # SKIP
> not ok 59 selftests: lkdtm: REFCOUNT_TIMING.sh # SKIP
> not ok 60 selftests: lkdtm: ATOMIC_TIMING.sh # SKIP
>
> BUT, if I look at one LKDTM test script
> (lkdtm/USERCOPY_STACK_FRAME_TO.sh):
>
> ...
> # If the test is commented out, report a skip
> if echo "$test" | grep -q '^#' ; then
> ...
>
> and in fact:
>
> root@sqwt-ubuntu:/opt/ksft# cat lkdtm/tests.txt | grep ^#
> #PANIC
> #LOOP Hangs the system
> #EXHAUST_STACK Corrupts memory on failure
> #CORRUPT_STACK Crashes entire system on success
> #CORRUPT_STACK_STRONG Crashes entire system on success
> #OVERWRITE_ALLOCATION Corrupts memory on failure
> #WRITE_AFTER_FREE Corrupts memory on failure
> #WRITE_BUDDY_AFTER_FREE Corrupts memory on failure
> #SOFTLOCKUP Hangs the system
> #HARDLOCKUP Hangs the system
> #SPINLOCKUP Hangs the system
> #HUNG_TASK Hangs the system
> #REFCOUNT_TIMING timing only
> #ATOMIC_TIMING timing only
>
> so only two of the above tests are in fact unexpectedly skipped.

Yup, that is operating as expected. :)

> not ok 15 selftests: lkdtm: UNSET_SMEP.sh # SKIP
> not ok 16 selftests: lkdtm: DOUBLE_FAULT.sh # SKIP

These are x86-specific, so that is correct as well.

Thanks for following up!

--
Kees Cook