Message ID | 2e9ef8d2ed594106eca514b268365b5419113f6a.1544099024.git.andreyknvl@google.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <owner-linux-mm@kvack.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 A36491731 for <patchwork-linux-mm@patchwork.kernel.org>; Thu, 6 Dec 2018 12:25:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 92002292C8 for <patchwork-linux-mm@patchwork.kernel.org>; Thu, 6 Dec 2018 12:25:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 85A9C2D325; Thu, 6 Dec 2018 12:25:23 +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=-10.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, USER_IN_DEF_DKIM_WL autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 58AAE297D0 for <patchwork-linux-mm@patchwork.kernel.org>; Thu, 6 Dec 2018 12:25:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3220F6B7A01; Thu, 6 Dec 2018 07:25:05 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 25B026B7A03; Thu, 6 Dec 2018 07:25:05 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0ACF66B7A04; Thu, 6 Dec 2018 07:25:05 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by kanga.kvack.org (Postfix) with ESMTP id A1C486B7A01 for <linux-mm@kvack.org>; Thu, 6 Dec 2018 07:25:04 -0500 (EST) Received: by mail-wr1-f69.google.com with SMTP id x3so70113wru.22 for <linux-mm@kvack.org>; Thu, 06 Dec 2018 04:25:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=F/Rs74E1jKAK3ACh/wE42WMWNbPFeAMFJIPcMbt9WD4=; b=kx9LKu5dJ6JW1krfVjY1x9n618TWK/neJCYmLs6SZNqUXco7EZT05lFyUKGJtPNFvs NmkTibRcIi22+tVPeFrqzMHVN0IiODPp/TSDBFHU5SZyKx1QK9jyXoGnwOLe681f1840 CvU5ET14VMpnB51D42qPePmmAnAAMcWF0zfqFUNKG/PGCLjBjdl1yKQ/fwaKSMT6fcMF D4UImKuVEZRAcXr5bN4nmHcD08+Fehry+LIqELNxIe5o28CaLLa01p2HbaKdaB3lUVQX lNKwFSyan0pwT8+vJtyrqEwVQTOJ6SuAMGg9Jqhnws7CzT1dGtF6gJZcTjOiVGkvTFpv fYfQ== X-Gm-Message-State: AA+aEWYR4bX8QlpYsHTKiRvJ6LpslPbIa7Llq5z4QzsoLz1gOSPHiX6A 4jBokXcaVXX9jogVoqflyTKlZz9jSswIi3x2/DP0OvGqJFHEBYEBR5jLmKRIzcCnsyhDKIZHRNP xst/6FXDV2KL1h2TbUAWgKfLgos8ZWnWXvA/+6PhzvN/Pj1Wd3URS3I4Z5se+K69We/CL9ShKoJ j78p18RlEJ/ujgc1ygfRkHyi87/2dJNdCCCPZd0IQZCFF+FHU6zdA5Ta2itvlRxhwtXHhEhKz5K pLLd+gpNRFgOpx+JGJM0UYWjZMsHlvwXtfFsRfNPJr3DFh+gkPAZS/Jrnur/ZgwrYniNSwtc1Pc AAW3LrkOms6vxU/7DHpzWDqC2OxtFmbB+Ola5alXNdwBdoC7xLXyJMk+66Agp6H1AGNfoIrgnC5 Z X-Received: by 2002:a5d:5502:: with SMTP id b2mr25938773wrv.330.1544099104186; Thu, 06 Dec 2018 04:25:04 -0800 (PST) X-Received: by 2002:a5d:5502:: with SMTP id b2mr25938711wrv.330.1544099103289; Thu, 06 Dec 2018 04:25:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544099103; cv=none; d=google.com; s=arc-20160816; b=qS+f5euD22Hcfnc3dleZerT8Xi05q+F+aq4+jYhDpksGnI5fOEZIP02BhQklUO7pi0 vlkb/1TPDFpUhFjlJqnyBRppeCQq9UP4DiGnYsapGlbwSyV9DytWvJsb/3DV22gjj6Vm GsaeJQNdLXx/0t0wvcb45hv1zFf2V9hBTRwvE3DHmLuB2xVvJPmg8mpjCpIplV97W2OE sDx6GdZAYsBvtH8sWgyp/hluKwe9yghyJfS7Kt3FUo8LBcRy7X/E0BynRD8ejWrfGlK3 X7EcDIIjAJPpZLRWuzth/fOPryFExPjrmBkmkTR8+p3EIRXI02TahViJ9kL5PH3wKnwE gFow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=F/Rs74E1jKAK3ACh/wE42WMWNbPFeAMFJIPcMbt9WD4=; b=QnZYbU3dSO9RxGoQV0WJHzkzfgRSNU4+wh2DdVr2zj1uZbNGUoymIivS+iOi3PzOXS 98wOxzMjuGxbrhDV+LQ8nBOk1jsrbDvWv6q3Kg+B2FONIZIWKx75bbt5aZptMztIAkp1 tdAWIrwR8CoRBBCaiGBS0oUalW0pW+vXOR7n6a4/l+G4jBaNdk3+7XP2WLh2hHigV4PC hJB27k57WCAIbO2b/YUXY00pq2n/fb6Lqsl8IbvKuY4dSJ8osGfcaMzoAQ34UiTOOCzu 5Nlt1vI6EGFeK4wnAMcqOMva1ZBIA8BD1Id79tUUqIsbYyiSOzOiyigD0WQml3i9Aseb mY5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=VAlGzqot; spf=pass (google.com: domain of andreyknvl@google.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=andreyknvl@google.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id l13sor178206wre.39.2018.12.06.04.25.03 for <linux-mm@kvack.org> (Google Transport Security); Thu, 06 Dec 2018 04:25:03 -0800 (PST) Received-SPF: pass (google.com: domain of andreyknvl@google.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=VAlGzqot; spf=pass (google.com: domain of andreyknvl@google.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=andreyknvl@google.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com 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=F/Rs74E1jKAK3ACh/wE42WMWNbPFeAMFJIPcMbt9WD4=; b=VAlGzqot4KggH/2lBiRkMM4lITHs5IpRZ4p+F4SbO+qt098Hg0g4wlLA22lQa2+sgu 1ZO/pc5wB2nDiSRi5FFQsNwlSmKERZzC6+C1bm7VRPFwLoKQrSId434VtYvpzCsk7c3i /vH7cIfPKbr+V1Dilr9fKTxodHnjd41ZTfyz597HV372In0cpd9mvAmlNFP+HJxA+AQ+ mzStQ2w6DGPYRDzykQjqYtFlASCb4Bva887fDY6JzKFwMetT4nD71IbFlWztZ4E/AIat lVr7320saaRT4uROOn2botn655EPyWEYbn4KMSnBzLpXEAJMIWiYQJli7yQdCgLhi50x ffvA== X-Google-Smtp-Source: AFSGD/XTYTqzsshlDGi9NHkEBAbQ2NsOtZrsn1Z0Y2zjYz0lfHZbxea+X0lOoDWgzEFhq8Dhw9ARjA== X-Received: by 2002:adf:b783:: with SMTP id s3mr26257157wre.274.1544099102810; Thu, 06 Dec 2018 04:25:02 -0800 (PST) Received: from andreyknvl0.muc.corp.google.com ([2a00:79e0:15:10:3180:41f8:3010:ff61]) by smtp.gmail.com with ESMTPSA id j8sm339988wrt.40.2018.12.06.04.25.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Dec 2018 04:25:01 -0800 (PST) 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 v13 09/25] arm64: move untagged_addr macro from uaccess.h to memory.h Date: Thu, 6 Dec 2018 13:24:27 +0100 Message-Id: <2e9ef8d2ed594106eca514b268365b5419113f6a.1544099024.git.andreyknvl@google.com> X-Mailer: git-send-email 2.20.0.rc1.387.gf8505762e3-goog In-Reply-To: <cover.1544099024.git.andreyknvl@google.com> References: <cover.1544099024.git.andreyknvl@google.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> X-Virus-Scanned: ClamAV using ClamSMTP |
Series |
kasan: add software tag-based mode for arm64
|
expand
|
diff --git a/arch/arm64/include/asm/memory.h b/arch/arm64/include/asm/memory.h index 05fbc7ffcd31..e2c9857157f2 100644 --- a/arch/arm64/include/asm/memory.h +++ b/arch/arm64/include/asm/memory.h @@ -211,6 +211,14 @@ static inline unsigned long kaslr_offset(void) */ #define PHYS_PFN_OFFSET (PHYS_OFFSET >> PAGE_SHIFT) +/* + * When dealing with data aborts, watchpoints, or instruction traps we may end + * up with a tagged userland pointer. Clear the tag to get a sane pointer to + * pass on to access_ok(), for instance. + */ +#define untagged_addr(addr) \ + ((__typeof__(addr))sign_extend64((u64)(addr), 55)) + /* * Physical vs virtual RAM address space conversion. These are * private definitions which should NOT be used outside memory.h diff --git a/arch/arm64/include/asm/uaccess.h b/arch/arm64/include/asm/uaccess.h index 07c34087bd5e..281a1e47263d 100644 --- a/arch/arm64/include/asm/uaccess.h +++ b/arch/arm64/include/asm/uaccess.h @@ -96,13 +96,6 @@ static inline unsigned long __range_ok(const void __user *addr, unsigned long si return ret; } -/* - * When dealing with data aborts, watchpoints, or instruction traps we may end - * up with a tagged userland pointer. Clear the tag to get a sane pointer to - * pass on to access_ok(), for instance. - */ -#define untagged_addr(addr) sign_extend64(addr, 55) - #define access_ok(type, addr, size) __range_ok(addr, size) #define user_addr_max get_fs