Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp786961imm; Fri, 21 Sep 2018 08:17:06 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYM+ibFrR2kW43erE6Ck8DHGxvLU+R9iPoy8ZokagaDHlsoXoDpq1SevuvNELXzvSoOdpGV X-Received: by 2002:a63:740f:: with SMTP id p15-v6mr42543094pgc.395.1537543026665; Fri, 21 Sep 2018 08:17:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537543026; cv=none; d=google.com; s=arc-20160816; b=VKq5yBGkkDcUpSIC8OMTyJ2px3lwW+aD24oh3HtDlsqfI6yDErWhRgUgHPJyM9q4oj DUm24ziSDgiobzDqj9Ep8JG99YrYzzQT1ABJpkFAmVR+KcHjCqkrgVwm0Kal7do28CYG vLZb7uPBWttDe1ouIAGP/CK/Pg1QWzEG3arxiQV1lSPzG4oKEx98ZGLGrv26epAZQGV9 JuL3B6JlQzKNl/gN/8CKF+GY/5Jstom0FUWh/eRk9QfMhi9Dhm2zi8jPs0svJDf8enmr BXlL0Cjzi5gg7X630bs/k/A/LtCBrarN/kAtiL3ecBoWAsWp5FbX/Mm7WnR3BfiiFHBQ nr4Q== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=0OMivlQBlkMR+OIo97sD6sFFaZkiu9rVW9+qGQSiUP4=; b=kQLkqwEDVBfbesIAHty/tCnUTkZfSORNUEpjj5RsHQdXe5ueVDiuSB0B0X7jw8hTks TxO4DwSwaZ7DDlhWMvIVWMT+19hD/hKZWzQH5hSAH/axVT5eYBtfQx56ot9CbDgk4kGZ 6cbNx5CA2BPVvio1NRLtTlG40u7D90HhMJgnxnLPe5I1YcGZ1p0nV89FLqcbW/vF0dZk Gn2Rq9J2wOoSCrWV42GG8ahVPQu9FyY3dmXX2GPxoMM1OSkKl6GXUKrgZIovG6oEGrt7 PfTHfBF35LKDTjNElqBXEBAcx+tFzzWdzpwVva6IFhPB4Orkr+3ELJiD6DVIlefcJshA 4NXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=OFyuXUUZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n1-v6si28418914pfe.66.2018.09.21.08.16.43; Fri, 21 Sep 2018 08:17:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=OFyuXUUZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390435AbeIUVE2 (ORCPT + 99 others); Fri, 21 Sep 2018 17:04:28 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:56265 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391010AbeIUVD0 (ORCPT ); Fri, 21 Sep 2018 17:03:26 -0400 Received: by mail-wm1-f66.google.com with SMTP id f21-v6so3429620wmc.5 for ; Fri, 21 Sep 2018 08:14:06 -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=0OMivlQBlkMR+OIo97sD6sFFaZkiu9rVW9+qGQSiUP4=; b=OFyuXUUZFiBmXAWubLMx8YU2l5NLejkfxGTmVmIjjN+VgNs9mtzWo980BQQpct6WLd rDAhvuAdk6qF3cbQTSFRXn0PcT1IzpAfxR+sFpJOJe2IJbwSj59PMSyBpUxLuVggrsvP hrti4DOQKgnAED9gVJ5snFxmuK+mluxPyAQnTA3dQ7NAfuUFASCgQMSB3mp5/xfQ27xS 75qVKCQIrZCgnWJtYLaPFDtHEGJ538o1f4PLXaKvfU2khl7Q/i2PkvPvdY0aTeENetoK 2nbVWFbN03/CT+bvoF56qjyq9biCpx6HnnKmrSy5A+VKYDB3tV63Bch01C/sd+Kv4Qzw 1BOw== 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=0OMivlQBlkMR+OIo97sD6sFFaZkiu9rVW9+qGQSiUP4=; b=q3Rw458XYVgUXxeMrc9cgl6ES1QvaWAiju6Np0Jp8eRTMtjJP3w/P+bBYQ9F/D/ZaU PC9OqfNHlTnYHeCyUMbKu81awo4274fqWm9GbvW7bO/abJk8pyTnzV04M03LoZ5kzpwl RN2JvDBIwXqwaA1es0wcPI72AIdTgCK6iedEgvLjg6fxpcnRh3ICN5YTAhlEf/ga1jbL XYDYgnA41G1ljlUqrwNg68U3fus1DoDPbNYtIhDxtdLnuYfoVBTTtwfyuFEGrZNjQ73X 7fYr9upyr4Xo8v1XNZJeY2MWF7Gz2D+mTaulvpMRwT6BnTgemiDB0d2F8PZDSHPRx2g8 jhZw== X-Gm-Message-State: APzg51BbbFxe3+U4L3LywDX/eGoIEYyu/3X+ZVWkpLbljj39q0+oxHnV 9FQVHatJdY3JIpT35vG8qfbA9Q== X-Received: by 2002:a1c:40d5:: with SMTP id n204-v6mr7794413wma.44.1537542845659; Fri, 21 Sep 2018 08:14:05 -0700 (PDT) Received: from andreyknvl0.muc.corp.google.com ([2a00:79e0:15:10:84be:a42a:826d:c530]) by smtp.gmail.com with ESMTPSA id e7-v6sm27990271wru.46.2018.09.21.08.14.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 21 Sep 2018 08:14:04 -0700 (PDT) From: Andrey Konovalov To: Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , Catalin Marinas , Will Deacon , Christoph Lameter , Andrew Morton , Mark Rutland , Nick Desaulniers , Marc Zyngier , Dave Martin , Ard Biesheuvel , "Eric W . Biederman" , Ingo Molnar , Paul Lawrence , Geert Uytterhoeven , Arnd Bergmann , "Kirill A . Shutemov" , Greg Kroah-Hartman , Kate Stewart , Mike Rapoport , 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 , Evgeniy Stepanov , Lee Smith , Ramana Radhakrishnan , Jacob Bramley , Ruben Ayrapetyan , Jann Horn , Mark Brand , Chintan Pandya , Vishwath Mohan , Andrey Konovalov Subject: [PATCH v9 11/20] kasan, arm64: fix up fault handling logic Date: Fri, 21 Sep 2018 17:13:33 +0200 Message-Id: X-Mailer: git-send-email 2.19.0.444.g18242da7ef-goog In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- arch/arm64/mm/fault.c | 3 +++ 1 file changed, 3 insertions(+) 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 #include #include +#include #include #include @@ -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; -- 2.19.0.444.g18242da7ef-goog