From patchwork Wed Jan 13 16:21:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Konovalov X-Patchwork-Id: 12017323 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=-17.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,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 5C5A6C433E0 for ; Wed, 13 Jan 2021 16:26:54 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 04D462339D for ; Wed, 13 Jan 2021 16:26:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 04D462339D Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:From:Subject:References:Mime-Version:Message-Id: In-Reply-To:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=l3ImyCZiGAVSGz3waDTxMZ6t9Pnw78wmFvWCzj9ebTc=; b=X2O/uQ73arjsW7o8pEPK0zrph O9xb/NBFTHDL4yFcOMnfGX9+Z93g1q/m+hG7fcFj8nwYX6XN+elfkQ9mlM5i2rlxaDBjXyRfgnP2G AMyg11ND8pkAdo+rSKdDnRnOlmETgR69QGrozdh1Op1hu9MXyEMqmrW8W+TbVCoc38YYJYoZHgUQ1 vexHb14tsUnWjgXGWKYBggg3anyGUTiiB15ANzLvZfB696VpAo8zixBMCvEw1T+9GHK9sEAzKF0oa mXTHVtt7vZNASECebqrgf5rkqd+P1cpdUyi1FgAtrPaLjtEHWL4Zq3Ueqq4NtSzwu010AjJZpEeoJ uTEGUJBzQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kzivv-0007rN-Jf; Wed, 13 Jan 2021 16:23:43 +0000 Received: from mail-qv1-xf4a.google.com ([2607:f8b0:4864:20::f4a]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kziue-0007Ld-Ut for linux-arm-kernel@lists.infradead.org; Wed, 13 Jan 2021 16:22:41 +0000 Received: by mail-qv1-xf4a.google.com with SMTP id i13so1822754qvx.11 for ; Wed, 13 Jan 2021 08:22:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:in-reply-to:message-id:mime-version:references:subject :from:to:cc; bh=0oH7aBBGG/x9vXdKvNsdbcmQExRVmREsCFEoJWJ3HWQ=; b=tYlSj+QTWutTDH5gzQYUyaice5go9l3cv899Fm94zOUhM2UTC+6sCkV198NX7X4rLv 9P+W9aeX0vY5gLC78glAsyk9S3f57B4otPPj9GIGen1A2xt7t4epZxu83cYwXAWrkGjC AUEkcM3Klpy9VDwCuFSD/blehpXrwf+MLutxOK+4OfHwXFn1u65iYPeU7Qfxl+UsCnYB dfbKOj5/BntajGohSBWAJTDkIsXdaljcno+BVlkyqblGW366u2PTCDZJUqXsCrTsA7JO vqmKERfAQL7Lp4kcq2GP5H/689JwgXw18RbDGPxZm5vERM1+FjZ1qvjOFbctixc57qqE LbNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=0oH7aBBGG/x9vXdKvNsdbcmQExRVmREsCFEoJWJ3HWQ=; b=HSIbAZZXA+qXj2a8Dggs448lksQEmYuWuZ2t9eVlQOl0rUdYIwKEKPhZc+AVA6X7Y1 N9qKClaewPyiZpbfravX8CVngAeTsGmR1dzKS21akh3p6N/JWjopsnnHynDHacwAHBc6 pqk0yv45iAx50qn9d4aFaeC7DQogil1TUCLNh0ltM/2EeZGag2blwzaJBH7LERPG2nqi Sb5+RNUnGvmL1pRumlZi1uJ/v9CjbAwW4T2j5SkI3t3NcGuQ500L3oTequ96cXaVl7jh 7g81+DBFwy+ojaDaXze9jVIqrbMQ6aIkPXzd0cv7QLnTFr24de2s7TOfmWqNgK2o3fwS RlIw== X-Gm-Message-State: AOAM5303nbgLDLZypp97Im18dCG40q1TRGobzr7U2+u7Ncsq8i/SAPSo pVy5GtK42Mc9btdef2NkVH2jxpbpTo2+8HpC X-Google-Smtp-Source: ABdhPJxOje2p0FQHseszOF0PAnCpvRA/kj/HPWxbgfjb/sC79Qvgl/QNJ2+aV/+6IFs0+UXkGQqNeZaxA4gv48Fr X-Received: from andreyknvl3.muc.corp.google.com ([2a00:79e0:15:13:7220:84ff:fe09:7e9d]) (user=andreyknvl job=sendgmr) by 2002:a0c:cc12:: with SMTP id r18mr2847745qvk.51.1610554941000; Wed, 13 Jan 2021 08:22:21 -0800 (PST) Date: Wed, 13 Jan 2021 17:21:41 +0100 In-Reply-To: Message-Id: <654bdeedde54e9e8d5d6250469966b0bdf288010.1610554432.git.andreyknvl@google.com> Mime-Version: 1.0 References: X-Mailer: git-send-email 2.30.0.284.gd98b1dd5eaa7-goog Subject: [PATCH v2 14/14] kasan: don't run tests when KASAN is not enabled From: Andrey Konovalov To: Catalin Marinas , Vincenzo Frascino , Dmitry Vyukov , Alexander Potapenko , Marco Elver X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210113_112225_088452_F0BF398A X-CRM114-Status: GOOD ( 11.79 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Branislav Rankov , Andrey Konovalov , Kevin Brodsky , Will Deacon , linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, Andrey Ryabinin , Andrew Morton , Peter Collingbourne , Evgenii Stepanov Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Don't run KASAN tests when it's disabled with kasan.mode=off to avoid corrupting kernel memory. Link: https://linux-review.googlesource.com/id/I6447af436a69a94bfc35477f6bf4e2122948355e Signed-off-by: Andrey Konovalov --- lib/test_kasan.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/test_kasan.c b/lib/test_kasan.c index d9f9a93922d5..0c8279d9907e 100644 --- a/lib/test_kasan.c +++ b/lib/test_kasan.c @@ -47,6 +47,9 @@ static bool multishot; */ static int kasan_test_init(struct kunit *test) { + if (!kasan_enabled()) + return -1; + multishot = kasan_save_enable_multi_shot(); hw_set_tagging_report_once(false); return 0;