Message ID | ca97a9434ecb703456cc06d9f17fd45e2e0b46ce.1537383101.git.andreyknvl@google.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-kbuild-owner@kernel.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D35381390 for <patchwork-linux-kbuild@patchwork.kernel.org>; Wed, 19 Sep 2018 18:55:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C549029178 for <patchwork-linux-kbuild@patchwork.kernel.org>; Wed, 19 Sep 2018 18:55:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B8D962AF40; Wed, 19 Sep 2018 18:55:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, USER_IN_DEF_DKIM_WL autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 69C6729178 for <patchwork-linux-kbuild@patchwork.kernel.org>; Wed, 19 Sep 2018 18:55:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387472AbeITAei (ORCPT <rfc822;patchwork-linux-kbuild@patchwork.kernel.org>); Wed, 19 Sep 2018 20:34:38 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:43536 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387532AbeITAeh (ORCPT <rfc822;linux-kbuild@vger.kernel.org>); Wed, 19 Sep 2018 20:34:37 -0400 Received: by mail-wr1-f68.google.com with SMTP id k5-v6so6859585wre.10 for <linux-kbuild@vger.kernel.org>; Wed, 19 Sep 2018 11:55:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xtJgUAWOXZXX0dAHUptbPqpenfy7NgkmLyignEvLyTk=; b=vPuyihblvxcn0sLFem62r23wIGYYYskYXdS/f0UduHxfmXZcYhZa+1inXCT+EVC71b xR9esBpfVNjAw5O1xd94Y0Ta9SiVI5dJ17z93VEQu3KYeWrfq33uQUDvbvmcGV6iZTUb b+9TkA37Wz+GEuxDBV724TGKdy1T52jCVQWAgTPE79jxFsVOoaSYOixroijjzYzATXJ1 jj4LdW4Md3upKR14f85br611JPh1UrMa8LADi2b3KZ1rAmXkL7gTDaLh1qx5/UUIf96h Ykig492trKfPPYXL59tNXdfV/Ll/v7d93Di9WJRRygDSUcHJLfMTsoWN2l6fYWF3kink jUjw== 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=xtJgUAWOXZXX0dAHUptbPqpenfy7NgkmLyignEvLyTk=; b=L+1o+NkZRh5oImHC8FZZo5+d3BGXqedvITpOC37CycD2dDa5EGl1g+JbkE1Xt26Lpj ZqalM2SdhDrXVpoOlhz3XDh5l54WHZNoVptWGnsb3GrT4y64RKE1V/TLk3DG42ot7idI YwE9fDwtkfcdSmc3Jrs8rI74jP9DGV0QF7RTeE6DFxO1efyWGw3LDYZPw4d6EhS4/tM8 b4wVRMKBz+4+9ftd6op/0bGfH0KuoLj6ljKkjDIAXoWTrqRBU+EQIGn8JjsDy5icYAPf SsNaENDp5y7XAFjPpyhPGY/RHsjQjRwsACELw8S6CuefjXp3cndmol2ukjAyMeUjfvRr 5MOA== X-Gm-Message-State: APzg51A/+wWrWYbrWDYkKU4Q54gxTEY4mlhhbqc+SdAwlfbtg/46GO5C uBABLKDqB+iMfWhC1ZOqxyPrBQ== X-Google-Smtp-Source: ANB0VdblUI7MFFp8hCfvF9UePgtJJWb/kUMM90uaKcYDdSH4MK9TlKqZCLxx5yQlpghBFlT3+9tF4A== X-Received: by 2002:adf:9464:: with SMTP id 91-v6mr30486547wrq.231.1537383321264; Wed, 19 Sep 2018 11:55:21 -0700 (PDT) Received: from andreyknvl0.muc.corp.google.com ([2a00:79e0:15:10:84be:a42a:826d:c530]) by smtp.gmail.com with ESMTPSA id b10-v6sm8510065wmc.28.2018.09.19.11.55.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Sep 2018 11:55:20 -0700 (PDT) From: Andrey Konovalov <andreyknvl@google.com> To: Andrey Ryabinin <aryabinin@virtuozzo.com>, Alexander Potapenko <glider@google.com>, Dmitry Vyukov <dvyukov@google.com>, Catalin Marinas <catalin.marinas@arm.com>, Will Deacon <will.deacon@arm.com>, Christoph Lameter <cl@linux.com>, Andrew Morton <akpm@linux-foundation.org>, Mark Rutland <mark.rutland@arm.com>, Nick Desaulniers <ndesaulniers@google.com>, Marc Zyngier <marc.zyngier@arm.com>, Dave Martin <dave.martin@arm.com>, Ard Biesheuvel <ard.biesheuvel@linaro.org>, "Eric W . Biederman" <ebiederm@xmission.com>, Ingo Molnar <mingo@kernel.org>, Paul Lawrence <paullawrence@google.com>, Geert Uytterhoeven <geert@linux-m68k.org>, Arnd Bergmann <arnd@arndb.de>, "Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Kate Stewart <kstewart@linuxfoundation.org>, Mike Rapoport <rppt@linux.vnet.ibm.com>, kasan-dev@googlegroups.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sparse@vger.kernel.org, linux-mm@kvack.org, linux-kbuild@vger.kernel.org Cc: Kostya Serebryany <kcc@google.com>, Evgeniy Stepanov <eugenis@google.com>, Lee Smith <Lee.Smith@arm.com>, Ramana Radhakrishnan <Ramana.Radhakrishnan@arm.com>, Jacob Bramley <Jacob.Bramley@arm.com>, Ruben Ayrapetyan <Ruben.Ayrapetyan@arm.com>, Jann Horn <jannh@google.com>, Mark Brand <markbrand@google.com>, Chintan Pandya <cpandya@codeaurora.org>, Vishwath Mohan <vishwath@google.com>, Andrey Konovalov <andreyknvl@google.com> Subject: [PATCH v8 11/20] kasan, arm64: fix up fault handling logic Date: Wed, 19 Sep 2018 20:54:50 +0200 Message-Id: <ca97a9434ecb703456cc06d9f17fd45e2e0b46ce.1537383101.git.andreyknvl@google.com> X-Mailer: git-send-email 2.19.0.397.gdd90340f6a-goog In-Reply-To: <cover.1537383101.git.andreyknvl@google.com> References: <cover.1537383101.git.andreyknvl@google.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: <linux-kbuild.vger.kernel.org> X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP |
Series |
kasan: add software tag-based mode for arm64
|
expand
|
diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c index 50b30ff30de4..78328c864d01 100644 --- a/arch/arm64/mm/fault.c +++ b/arch/arm64/mm/fault.c @@ -32,6 +32,7 @@ #include <linux/perf_event.h> #include <linux/preempt.h> #include <linux/hugetlb.h> +#include <linux/kasan.h> #include <asm/bug.h> #include <asm/cmpxchg.h> @@ -134,6 +135,8 @@ void show_pte(unsigned long addr) pgd_t *pgdp; pgd_t pgd; + addr = (unsigned long)kasan_reset_tag((void *)addr); + if (addr < TASK_SIZE) { /* TTBR0 */ mm = current->active_mm;
show_pte in arm64 fault handling relies on the fact that the top byte of a kernel pointer is 0xff, which isn't always the case with tag-based KASAN. This patch resets the top byte in show_pte. Signed-off-by: Andrey Konovalov <andreyknvl@google.com> --- arch/arm64/mm/fault.c | 3 +++ 1 file changed, 3 insertions(+)