From patchwork Fri May 29 20:03:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 208457 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B63A7C433DF for ; Fri, 29 May 2020 20:03:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8DB05207BC for ; Fri, 29 May 2020 20:03:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="MnQqBwNw" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728077AbgE2UD5 (ORCPT ); Fri, 29 May 2020 16:03:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726866AbgE2UD4 (ORCPT ); Fri, 29 May 2020 16:03:56 -0400 Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B558C08C5C8 for ; Fri, 29 May 2020 13:03:56 -0700 (PDT) Received: by mail-pl1-x642.google.com with SMTP id i17so1656237pli.13 for ; Fri, 29 May 2020 13:03:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=RCmY6exoQe8jgDlgtI8ix1LZA3heHUWvNPlFDsRApLI=; b=MnQqBwNwN160VVgSonbc44ILiWcznwE2zxAqmP5H45SuGW1zWMprJ3fkNzFbqE0ys9 jWtfx3lJmUTiW94r+uRvJIC0eBO2AXKPXc8K1/UJJKLekiMh36Na0IUgi+08BhKmWXPz uGfZgj8TvMJQ7eDO/5LFBl8ZQw7s/TpCDauLc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=RCmY6exoQe8jgDlgtI8ix1LZA3heHUWvNPlFDsRApLI=; b=G9uYKKPOdJRj6VGUireb/5CwPRk/rVk4AKZOusm5B4a1n5KscBE/jj9wJcMTna39z8 StgZYBNoCFlwQXwtRaV085+NTx3I91h2V7HTDs0sxjEY0mb1au0zch4Z8RZnhKlF2uzC A6ZrN7vcvUGG1hfxN0DHE+kxo7GoEmJjPgnbxjkQEiDjDVW3qAqhfs8piWsPhPKuzROq AZ9cr8nPpgxmAL3YevcntWqssCxsvJs29FdIKo5kYsd7rQUNj9SyopTFCHMFh9F0aMA8 JDL53eDP3JfPEKhRHJBt+8WWFRiS52gR++VVQ91MQ0I3dVKNNux5A/MaC4cSXJDh/J1R 3Y3A== X-Gm-Message-State: AOAM533qfdywZfpYJOHoFrZTUAi/JP4rUup6xEzSOirbgMg2jRC0vOWk Oh+SXqet4miZ2aWdQhu6fN4eew== X-Google-Smtp-Source: ABdhPJxeHWBezDRrH1a1yIT6IN5Ko6WOSv1GdMCCm93pznbXED5bbwEvp8L9ykvWeAwn6Ot/xvSGxw== X-Received: by 2002:a17:90a:6904:: with SMTP id r4mr11012848pjj.119.1590782635809; Fri, 29 May 2020 13:03:55 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id q189sm8188645pfc.112.2020.05.29.13.03.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 May 2020 13:03:54 -0700 (PDT) From: Kees Cook To: Greg Kroah-Hartman Cc: Kees Cook , Prasad Sodagudi , Sami Tolvanen , Amit Daniel Kachhap , linux-kselftest@vger.kernel.org, clang-built-linux@googlegroups.com, linux-kernel@vger.kernel.org Subject: [PATCH 3/4] selftests/lkdtm: Reset WARN_ONCE to avoid false negatives Date: Fri, 29 May 2020 13:03:46 -0700 Message-Id: <20200529200347.2464284-4-keescook@chromium.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200529200347.2464284-1-keescook@chromium.org> References: <20200529200347.2464284-1-keescook@chromium.org> MIME-Version: 1.0 Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org Since we expect to see warnings every time for many tests, just reset the WARN_ONCE flags each time the script runs. Signed-off-by: Kees Cook --- tools/testing/selftests/lkdtm/run.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/testing/selftests/lkdtm/run.sh b/tools/testing/selftests/lkdtm/run.sh index ee64ff8df8f4..8383eb89d88a 100755 --- a/tools/testing/selftests/lkdtm/run.sh +++ b/tools/testing/selftests/lkdtm/run.sh @@ -8,6 +8,7 @@ # set -e TRIGGER=/sys/kernel/debug/provoke-crash/DIRECT +CLEAR_ONCE=/sys/kernel/debug/clear_warn_once KSELFTEST_SKIP_TEST=4 # Verify we have LKDTM available in the kernel. @@ -67,6 +68,11 @@ cleanup() { } trap cleanup EXIT +# Reset WARN_ONCE counters so we trip it each time this runs. +if [ -w $CLEAR_ONCE ] ; then + echo 1 > $CLEAR_ONCE +fi + # Save existing dmesg so we can detect new content below dmesg > "$DMESG"