From patchwork Mon Nov 2 16:04:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Konovalov X-Patchwork-Id: 11874395 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=-12.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,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 1DB4AC00A89 for ; Mon, 2 Nov 2020 16:13:16 +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 96B22206E3 for ; Mon, 2 Nov 2020 16:13:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="wDOd8M1l"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="riUcA41q" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 96B22206E3 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=fUPWOtLXMSTsvoqTtcTB3bJQyUB7pV/iN8bjRzsmMfk=; b=wDOd8M1lHNK6gosSSV1q7GhCS O+DyAv6Z+pU5dHkJ+gKG/GQ/HiOcxjvYMzmTvdLNE48sTnjFWhbr7czDd3DvWjqrkzfRbIj9FNaxq Rrv69+v0NRXtTivFsCulsbxxTz3V9aMCJcIL3tj+MenxqdSzA8fGhJ8p5fvjUnhlelDAiNpxHUYMF wYTV9uFevCgsUMV29FTKopVH1aorvrRWmjLMVYNpKeu3c9othMbaEjvGJ1pceHLt0vx34ngcXYgvA 2xqKDh4lyGx2twObGDV5qP1bA/zaOC+3IUMGFLhkCIRoAfB4L7m/Gvy39uqv8gYH7W/1JGyvEqfxo yyhSZOjlg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kZcQ0-0001nH-2x; Mon, 02 Nov 2020 16:10:52 +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 1kZcKv-0006s5-1u for linux-arm-kernel@lists.infradead.org; Mon, 02 Nov 2020 16:05:44 +0000 Received: by mail-qv1-xf4a.google.com with SMTP id s8so8433813qvv.18 for ; Mon, 02 Nov 2020 08:05:35 -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=oA6gmttblv8OmG3VJbCFTsqSwJTzGphkOsRK2ZeD750=; b=riUcA41qwlHXo+IbXtU4f2GGtL76P+RBDCYMJGj6nE+vphGjBRYJ67tW9DBnbp+Uc6 qMa4GtkvmVwVrtiW9jcmviJqseU0AbFPIF3HItqgnStji6pZtsP5a9LlFovkawU1J9y3 EukBmZkKvJr3nUM1WKbhrHN7Csgv707bg9BiSwiLH/cb8dTNmhDvF9i9WX7NYE9vYLlb 67bswnRRtk+MuEPTEbGZurY7ZnF8y2PK8IeGpd6SWadjxP2T887UXDT5+kgYvnCmjZbn d2Pdgu4U1pIRCMROZC6pCKvhZHwLxdKYNXN4mhikQaV7I3zkG63zYaTv1MGZ995za2Tg /KAw== 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=oA6gmttblv8OmG3VJbCFTsqSwJTzGphkOsRK2ZeD750=; b=Yzh6e89oxW6u9qBtUu6zwHNiLCyZfskcYwIRfbd7i98rAzT6AS5ajWbHP1ZjfzATvy 0Y7B1wLTfKn8Lyg8n9MoUVfQwZmwj3J9YBnqhsYKMGU8eBt1A6pGSZXbpvDnmlPJkw3r 7IXLbt34yN0vgnuvYqh1R01kvNPSeXtYLVNaLKgfQ3IgpoKO7aZ80IZO7AsJz6dRbrXh aJi+iC+WNbKi+Uwaoh3mbYWQetxdD31ykuL19kJE2Tr0tSTlz+PTWJYY9kAD8davYFJU aUAa9dbRPfHn19RWq2iX5qYXIrrhVnwzVV0vFJHmczcU1UhwV1pfQa8JQ7mhv6N5yp5E 1cyg== X-Gm-Message-State: AOAM533RXdpj6iYrxPD060sFaiR8bEykH3UEx1e/eUnk/1W0csEjfI2R Hwg8G2FMNQ8Pc73Om6ZH5QjotIDIzzgxu6I3 X-Google-Smtp-Source: ABdhPJydHYs3rFxR5kefdVO46E96R1YsrBKg8uYgB2EbErSVyLuzI4uP5LbcVSXSsiycAoCuQsO+loq4dLPI+D6H X-Received: from andreyknvl3.muc.corp.google.com ([2a00:79e0:15:13:7220:84ff:fe09:7e9d]) (user=andreyknvl job=sendgmr) by 2002:a0c:ef02:: with SMTP id t2mr22391450qvr.7.1604333133885; Mon, 02 Nov 2020 08:05:33 -0800 (PST) Date: Mon, 2 Nov 2020 17:04:08 +0100 In-Reply-To: Message-Id: <5749501e35314228f1a6fbd385b7bf81da99ff56.1604333009.git.andreyknvl@google.com> Mime-Version: 1.0 References: X-Mailer: git-send-email 2.29.1.341.ge80a0c044ae-goog Subject: [PATCH v7 28/41] kasan: kasan_non_canonical_hook only for software modes From: Andrey Konovalov To: Catalin Marinas , Will Deacon X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201102_110537_236349_956BB820 X-CRM114-Status: GOOD ( 13.67 ) 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: linux-arm-kernel@lists.infradead.org, Marco Elver , Elena Petrova , Andrey Konovalov , Kevin Brodsky , Branislav Rankov , kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Alexander Potapenko , Evgenii Stepanov , Andrey Ryabinin , Andrew Morton , Vincenzo Frascino , Dmitry Vyukov Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This is a preparatory commit for the upcoming addition of a new hardware tag-based (MTE-based) KASAN mode. kasan_non_canonical_hook() is only applicable to KASAN modes that use shadow memory, and won't be needed for hardware tag-based KASAN. No functional changes for software modes. Signed-off-by: Andrey Konovalov Signed-off-by: Vincenzo Frascino Reviewed-by: Marco Elver --- Change-Id: Icc9f5ef100a2e86f3a4214a0c3131a68266181b2 --- mm/kasan/report.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/kasan/report.c b/mm/kasan/report.c index 5d5733831ad7..594bad2a3a5e 100644 --- a/mm/kasan/report.c +++ b/mm/kasan/report.c @@ -403,7 +403,8 @@ bool kasan_report(unsigned long addr, size_t size, bool is_write, return ret; } -#ifdef CONFIG_KASAN_INLINE +#if (defined(CONFIG_KASAN_GENERIC) || defined(CONFIG_KASAN_SW_TAGS)) && \ + defined(CONFIG_KASAN_INLINE) /* * With CONFIG_KASAN_INLINE, accesses to bogus pointers (outside the high * canonical half of the address space) cause out-of-bounds shadow memory reads