From patchwork Fri Feb 22 12:53:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Konovalov X-Patchwork-Id: 10825905 Return-Path: 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 55A8013B5 for ; Fri, 22 Feb 2019 12:54:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 43E21317D0 for ; Fri, 22 Feb 2019 12:54:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3791132463; Fri, 22 Feb 2019 12:54:05 +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 A68A8317D0 for ; Fri, 22 Feb 2019 12:54:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CE0128E0102; Fri, 22 Feb 2019 07:53:53 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id C41DC8E00FD; Fri, 22 Feb 2019 07:53:53 -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 ABE6A8E0102; Fri, 22 Feb 2019 07:53:53 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by kanga.kvack.org (Postfix) with ESMTP id 48AA18E00FD for ; Fri, 22 Feb 2019 07:53:53 -0500 (EST) Received: by mail-wr1-f71.google.com with SMTP id j44so940772wre.22 for ; Fri, 22 Feb 2019 04:53:53 -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=QBwzVVFrwl/lt9+IMfY2XIzbrADnd5gfL2MVdMoEoBA=; b=PegBozn85Ptz7Dc0VlorxS2+2uXEB4abVhcyW8dDA8uveh4Akq/tlNs4fzcwZjXULk IoCNWGHqD14qug6Y+LNpqIo3Ojedi7+TFRzA3crW5zgmaO5z17nMfkoVpKThXIseJREu 8pikHZYCaggojkWPu1TwRABX/NzM0v878ZMpp7m1xfkCtoKgWH3B/9KjC+g9+NA3KAxj JfH4tfaMsoLYS5zk3J3SyrWauV4n024KgmRY1k3abvpfNvjyi2zVvsMWIo9S7lEB/V3F Uvx3QAU1EE5gwF6V7KFDQSthKlzcfT+KEbQbsdEFLTg7zf2XiHoqTsCIbX/rgCdPP2I7 zx5Q== X-Gm-Message-State: AHQUAubLyrP9OgSY5D9sj3ElbQd6U5V2qR+LGgH6IDxHMkLDfvDhyQwM 6CFseLz9Elcoxuw5Ry165hteoj1U5htkIx/zn7yD7nLgKYnFSjTy7sDnUlSDpZFCdul8hJ6C9MP VVCj9jRSD9l7M24/XQxSTg18Sqj9EW0QErGHWCdSLZKOcVhhctczYNkvEb9bIPhISM7HudFJeD7 CAjX+rL/knRXn0P8Fb5H2aKcDWs2RiBYgzxSB5CTbzM8YIZHN3h/+VN2WvFfdanIHYlNoIrhHqZ 0q1KKGEFOqQLPaY2m0dv/hjcFWaXLavWLFfdM5/WSSZHuIKGS8mjv8o9G9a7FqZutW6c5H9Ax2v mTt33WWTxHPCpL+DOUpOkzDViBYZ7Pq9qNFI3/1iFpbIS3aKI93w7ofcEfEyT0NHKljCFPzyMCj Q X-Received: by 2002:adf:dd8a:: with SMTP id x10mr3035941wrl.117.1550840032835; Fri, 22 Feb 2019 04:53:52 -0800 (PST) X-Received: by 2002:adf:dd8a:: with SMTP id x10mr3035897wrl.117.1550840031973; Fri, 22 Feb 2019 04:53:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550840031; cv=none; d=google.com; s=arc-20160816; b=o8eXcgD7gRWlCEdRRy7VydRC5wEavGhHALNEi3ah1yjCG1bG0nlgrfYGu7GAJheZ71 pW4uDXuURGUthk24yrb0fhv2Ae4ulrvNXi8jTMrp1wWjIUVw08dL0/KUMRwNxevMdzGA sWTzm9QzxIKt6yXnFBwvHSlnGqkuby5eQ36QhlF8KFt+SrojoIBDbdwH1Nj0cPfAXAnx goXTFogZS/uXwtRDSZH58fScF4XLPv0jxFeG55YI2189DXGWO0qFaGqQ/SeoL+cwBbJL VSGXuEKmTQLyqTmFqU0PdsKMIIgVkSD5u3SBVsiQA2IFg8LmaZvwSJQp1Es0CftXBdbo Zr3w== 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=QBwzVVFrwl/lt9+IMfY2XIzbrADnd5gfL2MVdMoEoBA=; b=xrgdzTC9gqJH7SMlcqphOOXnySvvAakwyT3+wia5bc1KR/oKPRAobea18MWW7bVJk/ Jpl77lLf5TtZDRY32L0T3KpgVEE2qegDze30H7Rpek/8It9/PiBKQQg85PjzbOSy7tyA f49d/RvbfF62CokkI7qcIO3WsWVQR4P/Ep4KcGwmy7P7sm6QrPr/d41xTROfhKdSBjeH 1KUv/deGEwRvqVW0+JsJRgUsyTVtYQBo+8UO5HEX14oAuxzvtvIUNDS3OWzCohhxanGx cA5K+v3PK820t+ElsNgRrdXW2xuwNr65IwnjfGtbi7xDe7U2Nh5AMCE3Zp32fpZSoujI IDFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=SP+p1d8f; 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 l7sor1101025wrr.32.2019.02.22.04.53.51 for (Google Transport Security); Fri, 22 Feb 2019 04:53:51 -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=SP+p1d8f; 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=QBwzVVFrwl/lt9+IMfY2XIzbrADnd5gfL2MVdMoEoBA=; b=SP+p1d8f0BVnFGmwpzP5ObmgqSe7l5anq9SYK3Z0/3NQEWTdLTfJgPvtmksh4rCpqp IfRqUp24iOQF92rOfMBXwE8SN4Qg9+J3Ff0nPtSyfwTEqbyNm+DeeN5PWzbyT11CnE2+ NiNjrCubovAK/wbw8TnBd9rAdhYi2JGQm/9ZBjiURbGSLjfWJPtszQ5Wp43UoL05Tluv TlBFrRQljeAOUxOv3LCaFgOpw7HH2il9JHvSEnJIjNEhD/hw3TxMJV0heNgWZ4hyYnqc k67G6tBgxNf5nw4KsRQIR60AgXHPgBerP6BueL5DUb/aboLZYnGfKfMCtobiEEHXKnw+ xU8Q== X-Google-Smtp-Source: AHgI3IZQ0MX6sfukCDFdoJfLKBs/7VPcUCMns2qTz5bt2s0RG4yqp/Tz4fV7jNtbv7px50I5nWPT9w== X-Received: by 2002:adf:efc8:: with SMTP id i8mr3073265wrp.164.1550840031452; Fri, 22 Feb 2019 04:53:51 -0800 (PST) Received: from andreyknvl0.muc.corp.google.com ([2a00:79e0:15:13:8ce:d7fa:9f4c:492]) by smtp.gmail.com with ESMTPSA id o14sm808209wrp.34.2019.02.22.04.53.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Feb 2019 04:53:50 -0800 (PST) From: Andrey Konovalov To: Catalin Marinas , Will Deacon , Mark Rutland , Robin Murphy , Kees Cook , Kate Stewart , Greg Kroah-Hartman , Andrew Morton , Ingo Molnar , "Kirill A . Shutemov" , Shuah Khan , Vincenzo Frascino , linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Dmitry Vyukov , Kostya Serebryany , Evgeniy Stepanov , Lee Smith , Ramana Radhakrishnan , Jacob Bramley , Ruben Ayrapetyan , Chintan Pandya , Luc Van Oostenryck , Dave Martin , Kevin Brodsky , Szabolcs Nagy , Andrey Konovalov Subject: [PATCH v10 11/12] arm64: update Documentation/arm64/tagged-pointers.txt Date: Fri, 22 Feb 2019 13:53:23 +0100 Message-Id: X-Mailer: git-send-email 2.21.0.rc0.258.g878e2cd30e-goog In-Reply-To: References: MIME-Version: 1.0 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: X-Virus-Scanned: ClamAV using ClamSMTP Document the changes in Documentation/arm64/tagged-pointers.txt. Signed-off-by: Andrey Konovalov --- Documentation/arm64/tagged-pointers.txt | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/Documentation/arm64/tagged-pointers.txt b/Documentation/arm64/tagged-pointers.txt index a25a99e82bb1..f4cf1f5cf362 100644 --- a/Documentation/arm64/tagged-pointers.txt +++ b/Documentation/arm64/tagged-pointers.txt @@ -17,13 +17,22 @@ this byte for application use. Passing tagged addresses to the kernel -------------------------------------- -All interpretation of userspace memory addresses by the kernel assumes -an address tag of 0x00. +The kernel supports tags in pointer arguments (including pointers in +structures) for a limited set of syscalls, the exceptions are: -This includes, but is not limited to, addresses found in: + - memory syscalls: brk, madvise, mbind, mincore, mlock, mlock2, move_pages, + mprotect, mremap, msync, munlock, munmap, pkey_mprotect, process_vm_readv, + process_vm_writev, remap_file_pages; - - pointer arguments to system calls, including pointers in structures - passed to system calls, + - ioctls that accept user pointers that describe virtual memory ranges; + + - TCP_ZEROCOPY_RECEIVE setsockopt. + +The kernel supports tags in user fault addresses. However the fault_address +field in the sigcontext struct will contain an untagged address. + +All other interpretations of userspace memory addresses by the kernel +assume an address tag of 0x00, in particular: - the stack pointer (sp), e.g. when interpreting it to deliver a signal, @@ -33,11 +42,7 @@ This includes, but is not limited to, addresses found in: Using non-zero address tags in any of these locations may result in an error code being returned, a (fatal) signal being raised, or other modes -of failure. - -For these reasons, passing non-zero address tags to the kernel via -system calls is forbidden, and using a non-zero address tag for sp is -strongly discouraged. +of failure. Using a non-zero address tag for sp is strongly discouraged. Programs maintaining a frame pointer and frame records that use non-zero address tags may suffer impaired or inaccurate debug and profiling