Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp619201pxk; Wed, 9 Sep 2020 14:16:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJza1PCmf3ego8NK4jf0hEoTj6DQdgFjUWm+S8eJRGq8TCP8EhoGS/krAizfcTcyJfpyTlJE X-Received: by 2002:a17:906:8d8:: with SMTP id o24mr5466197eje.384.1599686217469; Wed, 09 Sep 2020 14:16:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599686217; cv=none; d=google.com; s=arc-20160816; b=lq6x71/PJIXiiy1c7hKVoLt6gEv1Ha9PMPCRKliEfuu8bgpQzdIbIGCjI2Rb2ZNNKo mHG+Mm1kAgHV1zlpNVEwS8V9lnoummu0ZQNqg3u4EvqL67+FfibYoxAjdWaBZG2AztGm 0Fzk8/uJFS5tpBlyiMJrHX7+dLyayc2vjEw3LwGJP8eSrn9KJ9ZpFEB/BTlascPD4hvz TKbC0UcXmM6hgnO1dtFayjMqwNbc57wA2KGD60fRBz46W+zTP3m8iStjby/RJbspqMJj ueaQx75mBy6RCsKAMJ7gdTo3LdPqmj+jodiP6vJFjkXnZB/UB8+Ate8vaWMzl8BWf9uC hM3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=k/NDEz4vbfaB6VuU1c+sy+9x1uqLEvej+MXiCZvwYh0=; b=p2VMjZFLHaWjcPvNq3WgVHckiSi5KzXu5L+sIHk3m7PoWWleCG+OU/MvIVb5qxWjhA W0d9sSKNTMFC3bddftYNKC6dSbm0VL4aBH6m24xLMKbViHfmghH1qH9lPvpd27l93P3S 1aVq5ZXZ/UlaakCHAxLulXnn4ihEB4CqAyzhLlLD46Qhkh+K58U51Yrs8NlYSd0xlOix XqzoCrbr5gMVcAI5+znTu/FNlUSbDoXx411YO+kJBHFybRd2GzYtoySlxtWeo+6e5MGX rKwXyEz2yEs1YMDALmKruiSG1LoRDhbArwtvzg6N4qJkNxS+JrMB9D3baVZMpCDGnLD0 wKRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=fqMNCUph; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v2si2297152ejy.65.2020.09.09.14.16.34; Wed, 09 Sep 2020 14:16:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=fqMNCUph; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729860AbgIIVM5 (ORCPT + 99 others); Wed, 9 Sep 2020 17:12:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726408AbgIIVMw (ORCPT ); Wed, 9 Sep 2020 17:12:52 -0400 Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65F01C061573 for ; Wed, 9 Sep 2020 14:12:51 -0700 (PDT) Received: by mail-pf1-x444.google.com with SMTP id k15so3251611pfc.12 for ; Wed, 09 Sep 2020 14:12:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=k/NDEz4vbfaB6VuU1c+sy+9x1uqLEvej+MXiCZvwYh0=; b=fqMNCUphBvZ0MnuRX6VZZ8eu48QSN++BysXWW1SsAx1sR54Zaasid7QqN6D3GWYNPL EI6M8yIM03m9Sp2wi7W3G2wTccpR75lI9BahABODHjHhILqYzFSsgTxmW+BUQGG1UKuT KcWgTziDsywMxkCulieIPvsxkkNUYgx35A7l4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=k/NDEz4vbfaB6VuU1c+sy+9x1uqLEvej+MXiCZvwYh0=; b=Vb4AuTHbSFtHgxdjyccTCtuxSwwcoFWMe1l8LEsJkJyMbeu0Ob2bWf3zz4SLOvcrM+ yi5YU1Kk1c8Z3/iSeZBnF7iIc5vhv4mrm2ha2jmd5MUa1ThEBMqaWyzWD/CVUI6pf5Al s9Qe4eb4tk/qMf28yD5lUstxVreKXM2ThYNAKJHKsfiWO2r6u7jEx/8/CNhaKkcwr+Gj ++LkeexxqVfjf9B7byca44XULDqnWul099I+SUCLOnqy4Cd3ZjtxIFqastk9Q52VRnOA XyVTrwyIM8XST5581nkacbZ1KbK+c8dJacaAp4MH+DVPOckljYgtgztQa/HCzUv8sK8g Rpxw== X-Gm-Message-State: AOAM531xX9sjxVBj/Jyyq2NPo6daoiYzVevnU1ZdYb3s9POR0GYou/SN Nkqag2hxQmT/4uXofIrYlL1b8Q== X-Received: by 2002:a17:902:a585:b029:d0:afd3:d851 with SMTP id az5-20020a170902a585b02900d0afd3d851mr2846962plb.2.1599685970909; Wed, 09 Sep 2020 14:12:50 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id b15sm3505454pft.84.2020.09.09.14.12.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2020 14:12:50 -0700 (PDT) Date: Wed, 9 Sep 2020 14:12:49 -0700 From: Kees Cook To: Joe Lawrence Cc: Shuah Khan , Naresh Kamboju , Petr Mladek , Michael Ellerman , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Miroslav Benes Subject: Re: [PATCH] selftests/lkdtm: Use "comm" instead of "diff" for dmesg Message-ID: <202009091412.6BDB426@keescook> References: <202006261358.3E8AA623A9@keescook> <202009091247.C10CDA60C@keescook> <9f3e5c23-3acd-d14f-06f9-acbc84e052a5@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9f3e5c23-3acd-d14f-06f9-acbc84e052a5@redhat.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 09, 2020 at 04:29:50PM -0400, Joe Lawrence wrote: > On 9/9/20 3:49 PM, Kees Cook wrote: > > > > On Fri, Jun 26, 2020 at 01:59:43PM -0700, 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 > > > Link: https://lore.kernel.org/lkml/CA+G9fYtHP+Gg+BrR_GkBMxu2oOi-_e9pATtpb6TVRswv1G1r1Q@mail.gmail.com > > > Fixes: f131d9edc29d ("selftests/lkdtm: Don't clear dmesg when running tests") > > > Signed-off-by: Kees Cook > > > > Shuah, this really needs to land to fix lkdtm tests on busybox. Can > > you add this to -next? (Or is it better to direct this to Greg for the > > lkdtm tree?) > > > > Thanks! > > > > -Kees > > > > > --- > > > 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..5fe23009ae13 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 -13 "$DMESG" - > "$LOG" || true > > > cat "$LOG" > > > # Check for expected output > > > -- > > > 2.25.1 > > > > > > > > > -- > > > Kees Cook > > > > Hi Kees, > > You may want to consider a similar follow up to the one Miroslav made to the > livepatching equivalent: > > https://lore.kernel.org/live-patching/nycvar.YFH.7.76.2008271528000.27422@cbobk.fhfr.pm/T/#m1c17812d2c005dd57e9a299a4a492026a156619e > > basically 'comm' will complain if two lines from dmesg have the same > timestamp prefix and their text portions are not sorted. Ah-ha! Thank you. I will send a v2. :) -- Kees Cook