[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e958209b-8621-57ca-01d6-2e76b05dab4c@collabora.com>
Date: Wed, 23 Jun 2021 13:39:57 +0100
From: Guillaume Tucker <guillaume.tucker@...labora.com>
To: Kees Cook <keescook@...omium.org>, Shuah Khan <shuah@...nel.org>
Cc: stable@...r.kernel.org, linux-kselftest@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] selftests/lkdtm: Use /bin/sh not $SHELL
On 19/06/2021 03:58, Kees Cook wrote:
> Some environments do not set $SHELL when running tests. There's no need
> to use $SHELL here anyway, so just replace it with hard-coded path
> instead. Additionally avoid using bash-isms in the command, so that
> regular /bin/sh can be used.
>
> Suggested-by: Guillaume Tucker <guillaume.tucker@...labora.com>
> Fixes: 46d1a0f03d66 ("selftests/lkdtm: Add tests for LKDTM targets")
> Cc: stable@...r.kernel.org
> Signed-off-by: Kees Cook <keescook@...omium.org>
Tested-by: "kernelci.org bot" <bot@...nelci.org>
Sample staging results with this patch applied on top of
next-20210622:
https://staging.kernelci.org/test/plan/id/60d2dbdc3cfb88da0924bf41/
Full log:
https://storage.staging.kernelci.org/kernelci/staging-next/staging-next-20210623.0/x86_64/x86_64_defconfig+x86-chromebook+kselftest/clang-13/lab-collabora/kselftest-lkdtm-asus-C523NA-A20057-coral.html
This was tested using Debian Buster with the default shell
being "dash", which doesn't support Bash-specific features.
Thanks,
Guillaume
> ---
> tools/testing/selftests/lkdtm/run.sh | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/tools/testing/selftests/lkdtm/run.sh b/tools/testing/selftests/lkdtm/run.sh
> index bb7a1775307b..0f9f22ac004b 100755
> --- a/tools/testing/selftests/lkdtm/run.sh
> +++ b/tools/testing/selftests/lkdtm/run.sh
> @@ -78,8 +78,9 @@ dmesg > "$DMESG"
>
> # Most shells yell about signals and we're expecting the "cat" process
> # to usually be killed by the kernel. So we have to run it in a sub-shell
> -# and silence errors.
> -($SHELL -c 'cat <(echo '"$test"') >'"$TRIGGER" 2>/dev/null) || true
> +# to avoid terminating this script. Leave stderr alone, just in case
> +# something _else_ happens.
> +(/bin/sh -c '(echo '"$test"') | cat >'"$TRIGGER") || true
>
> # Record and dump the results
> dmesg | comm --nocheck-order -13 "$DMESG" - > "$LOG" || true
>
Powered by blists - more mailing lists