Message ID | 432ef6686a25b49244f54c4dfd86bc4b20381d8a.1543337629.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 88B031869 for <patchwork-linux-mm@patchwork.kernel.org>; Tue, 27 Nov 2018 16:56:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 770822C425 for <patchwork-linux-mm@patchwork.kernel.org>; Tue, 27 Nov 2018 16:56:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6A9632C4D5; Tue, 27 Nov 2018 16:56:30 +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 D6A592C4BD for <patchwork-linux-mm@patchwork.kernel.org>; Tue, 27 Nov 2018 16:56:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B7D1F6B4945; Tue, 27 Nov 2018 11:56:07 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id B0A3B6B4947; Tue, 27 Nov 2018 11:56:07 -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 980EE6B4948; Tue, 27 Nov 2018 11:56:07 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by kanga.kvack.org (Postfix) with ESMTP id 3C0DB6B4945 for <linux-mm@kvack.org>; Tue, 27 Nov 2018 11:56:07 -0500 (EST) Received: by mail-wm1-f70.google.com with SMTP id t62-v6so16769760wmg.6 for <linux-mm@kvack.org>; Tue, 27 Nov 2018 08:56:07 -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=6e1l9Y/ECE5gJLR0cHfFtNGEhOKinaqvIQUjwSbnIxA=; b=ug5qQ4MvRDO/7Tyf2LvwJLtboDj9JQB6ZaBruumJyzfaDA+/CkaMIjTRs/PTaqofhM BispnqPELk+RppT/R6tVqknzn1tKOl7/3XuXzc0YtNekPxvH+ZP3mxDh1IFYeXJAFtms qir+W2Mmu1y6ZKOXgF+FhB8Yx+UTtzrmRiqmCw+HLz6XSaTCREZHOsJxxexqENdpKKuG 5s5JjlnWkNbDkGXgCTPNDnQVpWFWdpjSb6EBOQGPIg9A85McmhlMyrSDeQLyInLFlmo3 dWeydNSwQR3Lf6odO/YfNNxN4rajoBwJJzz5ALE3S4tWZd7V0mOITR3nTtI7QcdHqfyD LzoA== X-Gm-Message-State: AA+aEWY1pbhC5dTi7/ZW9VPcUEaoojGaWs80iqEvgyttJC9enT/9bzVv 2fMVypZFY8uYrG6e3n6IfzVdYAKNc+yRzMWdPcEc1un7HmI7TL8oJzkeGV3cTm+YrsHXzXqvkct z3eRaZtGfN+5ZlqlNL+ouQySYFMo8R1/zMC8YfsJdLNsiTqSsBfcWtBPhjz0RtYykoV88yhKZGj /c1MABvZ5a8hZEi9tHuhS3y6s9AEipr8U7FHeymGM7vZ72ySs6s2Kq92vIsvgHvrvL5pICAsx6U TKXkj2X1Eo4xfmyR7J0ZfdOYx5Gdr9snvH4Xm8EY5xfy53HO7CmhcvaiFdiQYug+/AvXdWFWKEM eyPkClqX2Os8ZtFEIzXFHdswGCyWqYJzUs5XJAJziDy8xmnB2poxF8YorCdDb/KS5NalmI1SBnn U X-Received: by 2002:adf:cc91:: with SMTP id p17mr28949954wrj.118.1543337766803; Tue, 27 Nov 2018 08:56:06 -0800 (PST) X-Received: by 2002:adf:cc91:: with SMTP id p17mr28949901wrj.118.1543337765933; Tue, 27 Nov 2018 08:56:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543337765; cv=none; d=google.com; s=arc-20160816; b=gnUq5FRj0sEiCHALqBnUf1d+HOdJnn4RwVn3flTkq0wn+IwfNLYPG0WZq7OfX6Y5pR d6AknbOaxT+pDppUvcv9u+2KmqsrT1v/54U63agYRQMb5TffmcahPH0tsiWI9AdY2cPG So3m/UT+sDLsZBLSuQtf1ATtjT8201RqPUQvceKKqsMdblqKt9LcrUE928SN7yk1sPDD zI8CkjKlRDGdxUrU1rPsdGUle/ZCpbtxTkkphP+X9FNidK0pq3YvFGGOtXtHy9wzEH7a fX2UVaAwM3oDupL6CwgJyuV6EZlwOVHJmL9+hZAU4xxYxSUTZyCv2GH87wA3eNXhHk+W bAAA== 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=6e1l9Y/ECE5gJLR0cHfFtNGEhOKinaqvIQUjwSbnIxA=; b=qQEybTlu2/dTaWDsOHJmd4aYOuotUlo1NzgvvmfgbPQCwvFrF7ZkUskrw1YkDuKyRf RxMBYvRSjnwRm+mFAPO318LNpb60KvHwARXkJ5Xt9YerD6wyf9ZpGi/3h5+amxYwBIAR AtheiDoBWZDqcnLlltEjpK+J9Ouda2QTTE2FiZtCcV+zsFHmJsrjuGlLfueVrOxxvqqg gwNmQIh3BEd6NGkrXdaxYa0i7mU/pYk7iW0Q4vwEGHS7SQHrXRZBGa5AnXrkrA8ixt9W Yl2FjHVph/QVViSBEV/r+ptAKYe0EqUjaXqbod6PETGlY9Bb7PSMUMBroViVSLaaSSGR VONg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=c7RLbeCB; 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 g18sor3093315wrw.3.2018.11.27.08.56.05 for <linux-mm@kvack.org> (Google Transport Security); Tue, 27 Nov 2018 08:56:05 -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=c7RLbeCB; 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=6e1l9Y/ECE5gJLR0cHfFtNGEhOKinaqvIQUjwSbnIxA=; b=c7RLbeCBSVZ4Kt6XmRk41o0eRiADDbVObnmQOr8RuKkIYie1CCJ4fYq8kfj9AfajBv OBvv316qqeqXWjU+4grgAXMDTb6uhS5R6mR7OXy5YlGkW6IH0gS0+aVi0WFb16P7E03z C9Mq+XCW4ZYUNS6UaPDcu9pBuiFLIKyA94mcuUhjZjhUXihex0N5TWIkfeVY82bcQLdr HnqZUKZa05tov8/OoSNckF7DsE/hTRTiN3nnqkdkfHNTjS9r2E1LQsQBFGxVT7sHi56N GABTW4X86jJYnMHRjmDPORCZC1aM5Kpaj34BLZGfRVchAXfgDVsAjf47zSHA1CHobvdE vn/Q== X-Google-Smtp-Source: AFSGD/UuH/6DY8P2w9UpFgpPIClD7KG7B4718Xsjq1f+D3WUkqLpCJuTKqnCRQRqaKolqFu71jv+oA== X-Received: by 2002:adf:9d4c:: with SMTP id o12mr2491101wre.94.1543337765359; Tue, 27 Nov 2018 08:56:05 -0800 (PST) Received: from andreyknvl0.muc.corp.google.com ([2a00:79e0:15:10:3180:41f8:3010:ff61]) by smtp.gmail.com with ESMTPSA id k73sm6383099wmd.36.2018.11.27.08.56.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Nov 2018 08:56:04 -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 v12 09/25] arm64: move untagged_addr macro from uaccess.h to memory.h Date: Tue, 27 Nov 2018 17:55:27 +0100 Message-Id: <432ef6686a25b49244f54c4dfd86bc4b20381d8a.1543337629.git.andreyknvl@google.com> X-Mailer: git-send-email 2.20.0.rc0.387.gc7a69e6b6c-goog In-Reply-To: <cover.1543337629.git.andreyknvl@google.com> References: <cover.1543337629.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