linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] selftests/lkdtm: Use "comm" instead of "diff" for dmesg
@ 2020-09-09 21:17 Kees Cook
  2020-09-09 21:35 ` Shuah Khan
  0 siblings, 1 reply; 3+ messages in thread
From: Kees Cook @ 2020-09-09 21:17 UTC (permalink / raw)
  To: Shuah Khan
  Cc: Kees Cook, Naresh Kamboju, linux-kselftest, Joe Lawrence,
	Petr Mladek, Michael Ellerman, linux-kernel

Instead of full GNU diff (which smaller boot environments may not have),
use "comm" which is more available.

Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org>
Cc: Shuah Khan <shuah@kernel.org>
Cc: linux-kselftest@vger.kernel.org
Fixes: f131d9edc29d ("selftests/lkdtm: Don't clear dmesg when running tests")
Signed-off-by: Kees Cook <keescook@chromium.org>
---
v2: add --nocheck-order, thanks to Joe Lawrence
v1: https://lore.kernel.org/lkml/202006261358.3E8AA623A9@keescook/
---
 tools/testing/selftests/lkdtm/run.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/lkdtm/run.sh b/tools/testing/selftests/lkdtm/run.sh
index 8383eb89d88a..bb7a1775307b 100755
--- a/tools/testing/selftests/lkdtm/run.sh
+++ b/tools/testing/selftests/lkdtm/run.sh
@@ -82,7 +82,7 @@ dmesg > "$DMESG"
 ($SHELL -c 'cat <(echo '"$test"') >'"$TRIGGER" 2>/dev/null) || true
 
 # Record and dump the results
-dmesg | diff --changed-group-format='%>' --unchanged-group-format='' "$DMESG" - > "$LOG" || true
+dmesg | comm --nocheck-order -13 "$DMESG" - > "$LOG" || true
 
 cat "$LOG"
 # Check for expected output
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] selftests/lkdtm: Use "comm" instead of "diff" for dmesg
  2020-09-09 21:17 [PATCH v2] selftests/lkdtm: Use "comm" instead of "diff" for dmesg Kees Cook
@ 2020-09-09 21:35 ` Shuah Khan
  2020-09-10 16:53   ` Greg Kroah-Hartman
  0 siblings, 1 reply; 3+ messages in thread
From: Shuah Khan @ 2020-09-09 21:35 UTC (permalink / raw)
  To: Kees Cook, Shuah Khan, Greg Kroah-Hartman
  Cc: Naresh Kamboju, linux-kselftest, Joe Lawrence, Petr Mladek,
	Michael Ellerman, linux-kernel, skhan

On 9/9/20 3:17 PM, Kees Cook wrote:
> Instead of full GNU diff (which smaller boot environments may not have),
> use "comm" which is more available.
> 
> Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org>
> Cc: Shuah Khan <shuah@kernel.org>
> Cc: linux-kselftest@vger.kernel.org
> Fixes: f131d9edc29d ("selftests/lkdtm: Don't clear dmesg when running tests")
> Signed-off-by: Kees Cook <keescook@chromium.org>
> ---
> v2: add --nocheck-order, thanks to Joe Lawrence
> v1: https://lore.kernel.org/lkml/202006261358.3E8AA623A9@keescook/
> ---
>   tools/testing/selftests/lkdtm/run.sh | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/lkdtm/run.sh b/tools/testing/selftests/lkdtm/run.sh
> index 8383eb89d88a..bb7a1775307b 100755
> --- a/tools/testing/selftests/lkdtm/run.sh
> +++ b/tools/testing/selftests/lkdtm/run.sh
> @@ -82,7 +82,7 @@ dmesg > "$DMESG"
>   ($SHELL -c 'cat <(echo '"$test"') >'"$TRIGGER" 2>/dev/null) || true
>   
>   # Record and dump the results
> -dmesg | diff --changed-group-format='%>' --unchanged-group-format='' "$DMESG" - > "$LOG" || true
> +dmesg | comm --nocheck-order -13 "$DMESG" - > "$LOG" || true
>   
>   cat "$LOG"
>   # Check for expected output
> 

Greg,

Would you like me to take this through kselftest tree?

If you want to take it through lkdtm tree, here is my Ack:

Acked-by: Shuah Khan <skhan@linuxfoundation.org>

thanks,
-- Shuah

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] selftests/lkdtm: Use "comm" instead of "diff" for dmesg
  2020-09-09 21:35 ` Shuah Khan
@ 2020-09-10 16:53   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 3+ messages in thread
From: Greg Kroah-Hartman @ 2020-09-10 16:53 UTC (permalink / raw)
  To: Shuah Khan
  Cc: Kees Cook, Shuah Khan, Naresh Kamboju, linux-kselftest,
	Joe Lawrence, Petr Mladek, Michael Ellerman, linux-kernel

On Wed, Sep 09, 2020 at 03:35:00PM -0600, Shuah Khan wrote:
> On 9/9/20 3:17 PM, Kees Cook wrote:
> > Instead of full GNU diff (which smaller boot environments may not have),
> > use "comm" which is more available.
> > 
> > Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org>
> > Cc: Shuah Khan <shuah@kernel.org>
> > Cc: linux-kselftest@vger.kernel.org
> > Fixes: f131d9edc29d ("selftests/lkdtm: Don't clear dmesg when running tests")
> > Signed-off-by: Kees Cook <keescook@chromium.org>
> > ---
> > v2: add --nocheck-order, thanks to Joe Lawrence
> > v1: https://lore.kernel.org/lkml/202006261358.3E8AA623A9@keescook/
> > ---
> >   tools/testing/selftests/lkdtm/run.sh | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/tools/testing/selftests/lkdtm/run.sh b/tools/testing/selftests/lkdtm/run.sh
> > index 8383eb89d88a..bb7a1775307b 100755
> > --- a/tools/testing/selftests/lkdtm/run.sh
> > +++ b/tools/testing/selftests/lkdtm/run.sh
> > @@ -82,7 +82,7 @@ dmesg > "$DMESG"
> >   ($SHELL -c 'cat <(echo '"$test"') >'"$TRIGGER" 2>/dev/null) || true
> >   # Record and dump the results
> > -dmesg | diff --changed-group-format='%>' --unchanged-group-format='' "$DMESG" - > "$LOG" || true
> > +dmesg | comm --nocheck-order -13 "$DMESG" - > "$LOG" || true
> >   cat "$LOG"
> >   # Check for expected output
> > 
> 
> Greg,
> 
> Would you like me to take this through kselftest tree?
> 
> If you want to take it through lkdtm tree, here is my Ack:
> 
> Acked-by: Shuah Khan <skhan@linuxfoundation.org>

Thanks, I'll take it.

greg k-h

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-09-10 17:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-09 21:17 [PATCH v2] selftests/lkdtm: Use "comm" instead of "diff" for dmesg Kees Cook
2020-09-09 21:35 ` Shuah Khan
2020-09-10 16:53   ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).