Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp597390pxk; Wed, 9 Sep 2020 13:34:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxB+3ssRuRJOGmwJEHXL5UTdBw92f30B9yYow+3iEzP3MFfVWd9iu6Uiz320/lgVHlfPnZW X-Received: by 2002:aa7:c7da:: with SMTP id o26mr6120160eds.261.1599683641404; Wed, 09 Sep 2020 13:34:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599683641; cv=none; d=google.com; s=arc-20160816; b=A8Elv0QvP5kcEItJt+jBCDYbAJ5FYkmcqu/TCmGYh/aqB7A1NK6vhpmejAdnE8Pa8M JZpqdZYSVvHrT2UKqow3c/3Bjp53ONQG5R8nyO/1quzLHCLN/qoXGf2g53/9F49dq5Tv B3wPumw57hkJa2JI+oVjAf7fKPsa1mDTdSjc6V6s4wUBEvQse+EPDYYxrv6NoP0HSX52 n5WeseoosYKzOIMgbq3WL9nrCjr1T0o+0sk5PcmfLJCUbrR5WhM3xqu26V2Z7aGjCj9d Px0vzBzTe2/kQrI7qj0fFHsL5hPibmMBuDi4Q+3T2Rqd1qyG2VAJiKIGovD0Cmv1GfCM J0KA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=6nexsJiCuIdw7FA1Tk1xu5+FRgBxFGsMZ4jBAZcpm8c=; b=H6Ps5tH3NyrAATHh27J2cuWPpyN+AU3hOTDADAJQf93rOpzPXTGdeTxe5iekgebSmj fOOp5IwegnU8+yXZgMzVtjd1t+mGq2boyCoEOWc/FPnNu3K8DEniCKd22yIYqX7eTUmZ 0kwUb+5XKiL9Y5HLw4aXUfn/GLXnAlop4DJ7EmSzYn5t5mZOnhRqH2G0OAcGnYafDpTw fTre9tmQtaMm9YBdwdQyggt3Y0eACVtpEMQ67PcWs/+E8BfWiCgsYC8mQip0Wp30DmRM 1kfax99HgxKnBu7viWu9+um+IA8AdBGkO7viXWob1uq8NprfmSmtkB1CC9lh7rei0c50 gKRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dvx5En3K; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g5si2141771ejy.39.2020.09.09.13.33.38; Wed, 09 Sep 2020 13:34:01 -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=@redhat.com header.s=mimecast20190719 header.b=dvx5En3K; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727900AbgIIUaB (ORCPT + 99 others); Wed, 9 Sep 2020 16:30:01 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:55806 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726605AbgIIU37 (ORCPT ); Wed, 9 Sep 2020 16:29:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599683398; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6nexsJiCuIdw7FA1Tk1xu5+FRgBxFGsMZ4jBAZcpm8c=; b=dvx5En3KPWOIeM6b26+I/P8yh+PlVGPX6mRWVIN4qCoUUnb9jropzPuxRxEeyelbjEOZUs jvtk7BJu7lxIFkElKmBOUvDLeK4KDHjL7uf6MaZU7rwKDY5TiPNnNCzY6qqJr8jXgNPSXp TYighXPiFByh096UMnvybEwXjuYRr/E= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-128-J55BP5YrOMKeOlbqDeyhpg-1; Wed, 09 Sep 2020 16:29:54 -0400 X-MC-Unique: J55BP5YrOMKeOlbqDeyhpg-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 235A818BA283; Wed, 9 Sep 2020 20:29:53 +0000 (UTC) Received: from [10.10.114.200] (ovpn-114-200.rdu2.redhat.com [10.10.114.200]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8A3EC10013D7; Wed, 9 Sep 2020 20:29:51 +0000 (UTC) Subject: Re: [PATCH] selftests/lkdtm: Use "comm" instead of "diff" for dmesg To: Kees Cook , Shuah Khan Cc: Naresh Kamboju , Petr Mladek , Michael Ellerman , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Miroslav Benes References: <202006261358.3E8AA623A9@keescook> <202009091247.C10CDA60C@keescook> From: Joe Lawrence Message-ID: <9f3e5c23-3acd-d14f-06f9-acbc84e052a5@redhat.com> Date: Wed, 9 Sep 2020 16:29:50 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <202009091247.C10CDA60C@keescook> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Regards, -- Joe