Re: selftests: Linux Kernel Dump Test Module output
From: Kees Cook
Date: Wed Feb 26 2020 - 14:01:36 EST
On Wed, Feb 26, 2020 at 11:32:46PM +0530, Naresh Kamboju wrote:
> Yeah i see this case at my end also.
>
> my two cents,
> I have two comments,
> 1) shell check
I'll fix these up; thanks for the suggestions!
> Test output with set -x for debugging shell scripts.
> [...]
> ++ dmesg -c
> +++ mktemp --tmpdir -t lkdtm-XXXXXX
> ++ LOG=/tmp/lkdtm-r5yZ7K
> ++ trap cleanup EXIT
> ++ /bin/sh -c 'cat <(echo BUG) >/sys/kernel/debug/provoke-crash/DIRECT'
> ++ true
> ++ dmesg -c
> ++ cat /tmp/lkdtm-r5yZ7K
This is the part that is failing and I don't know why.
clear the kernel event log:
dmesg -c
trigger the kernel event:
/bin/sh -c 'cat <(echo BUG) >/sys/kernel/debug/provoke-crash/DIRECT'
dump the newly added event logs into a file (set -x doesn't report
redirection to /tmp/lkdtm-r5yZ7K):
dmesg -c
It seems /tmp/lkdtm-r5yZ7K is empty?
--
Kees Cook