From patchwork Mon Dec 10 12:51:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Konovalov X-Patchwork-Id: 10721231 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 3FBAB17FE for ; Mon, 10 Dec 2018 12:51:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 31B722A28E for ; Mon, 10 Dec 2018 12:51:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2573C2A299; Mon, 10 Dec 2018 12:51:31 +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 7D0052A2B2 for ; Mon, 10 Dec 2018 12:51:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4F65C8E0010; Mon, 10 Dec 2018 07:51:22 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 4A5A88E0001; Mon, 10 Dec 2018 07:51:22 -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 2D5AB8E0010; Mon, 10 Dec 2018 07:51:22 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by kanga.kvack.org (Postfix) with ESMTP id BC2B88E0001 for ; Mon, 10 Dec 2018 07:51:21 -0500 (EST) Received: by mail-wm1-f71.google.com with SMTP id 77so2076186wmr.5 for ; Mon, 10 Dec 2018 04:51:21 -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=ngEuYePF0Ik8OjXWCCgTn5YSoHew/I/tp51mGRx8kg4=; b=Wg72CF/wkNP4p+1EvEcOJbPMjxb23eiW9RPJv9kWcH6Et7iGZ+WpPd0GqJe2O8pN6+ CeY4dro393nQeV79lmVhrqphum7z7+LlqyO6JvwXbsNr4sNFthHmjXHXc7WC9fDFPU/T pf6sZR8jxV2cgGIfI3FLcJ2Wq9hGLdzmvqgxhwIFBXdgZLlAYfO7jfPIzdXUYN4mXxo+ XaxBC4C+GDyliZcladdiReqPrY/sM5LoaSv0Zfj+bkpMfyYIdPmKZGnIXlrT2Zzx9xl5 EnQlKLU5tQmcn0AeTfc/siMc94mNX02ALgYm9njV+oyI0TVYLwElB2zWL82yxQTSW4io 3R2Q== X-Gm-Message-State: AA+aEWZb5Qd6xodpspae+w2IvY/f7tYzxRqv8nRAAsUX3CiukAD5eKB2 YjWPH3I9IrjDrzBaH8SdUHIxoGIZszDbzB3jYxr8i+QXqWLLa87y7ua6iJReL4T8zlYDWEddqx/ hu2Q6hEK21LnrlUeL3eiSOJO1apFSdFqw0DER8XgVqoUf1ULfAN70Lr65hJLYztqICOevT6Lipu TlkibhPfpBPE2xGlYHJl48qXgw9J1vP8yt/q5gXgpX7ekf0G2xU/7gb766HPiGTEboMkMsfGOT1 4DPRXr+mEUr6tcireQNnkOfS01QPDaf8CisBCNSNSC6+gKwGWE7Z1BjZM1Fitt7ppjkZ0TAg8kh /1XZmwg1aXjOVktlbIN/SbPxQfzWvvb/fqyVUY1ixa43abq5HnE6UBaezczzCqHgvpLN8im0/43 b X-Received: by 2002:adf:8544:: with SMTP id 62mr10332421wrh.1.1544446281298; Mon, 10 Dec 2018 04:51:21 -0800 (PST) X-Received: by 2002:adf:8544:: with SMTP id 62mr10332371wrh.1.1544446280345; Mon, 10 Dec 2018 04:51:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544446280; cv=none; d=google.com; s=arc-20160816; b=ke8OXZsIfhWujivxSl15OrD1MfsqN4kI5epJP+V6i4KkKkz0EYGKehR+clTJCajjn2 t7nfiEiyyjoFKiPzqSpxkk9cmXNTZmgYln7WHlrHjfAsDGz8P/pwm0BkhPb47VoOk4SD 3v/IFR83BQuv/O9YVIKG113xk2FovlsgyCsjm/y8wT9PMzcd155HuJEJF3XkaO46bHim sYbBI7O+LCWl6W5Qc8kWbCtWbJ1gn2AJH+tOEmgRBoNl7osVUc0V6dJ9odV75TrFbqQ1 HCJUbBKZp2wAm/e4KiUoePPKVijrsNH8UWMuzFnxyMO68ZuDKHvMBQOOzPwzgWJr3CXL 2kQw== 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=ngEuYePF0Ik8OjXWCCgTn5YSoHew/I/tp51mGRx8kg4=; b=j/KHJDA8xuUTWgVITg8HQxyTbukPAaPFZlZZw0W8rqpJd3eW2VY+KiB3cCp3WBCX6d pZv4FGZpMttjs1dAxg0vHnpkFm7zNNLXKRpJTwIUDDkI+F3TUcjVY0rBg+ESVPHgm1d/ EupCn51blZARZAwHKZT1idnhkxNpvWlEwhexjzJdgCvrBJcxnGuDH/8jzc9vwSeXwA1k bZmkPz1Tyo5z/xC0qQPOEebr/Qko3JhBDW1gUqdcC3rFqUzkx6FcIhQWMF2GUKfJnZ4i QNo8FbPINQz1xhKPdVuBVTQLKqeW9DqgBZPIx9/mu5i61f9AW81vgj8RGnBcQ4+O9NnR xPjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=CmCoquOI; 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 62sor7642244wmp.0.2018.12.10.04.51.20 for (Google Transport Security); Mon, 10 Dec 2018 04:51:20 -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=CmCoquOI; 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=ngEuYePF0Ik8OjXWCCgTn5YSoHew/I/tp51mGRx8kg4=; b=CmCoquOIItufHfboXmnykNLOniuP3oph0acoA+XTBGrVSB7mLajVT1E+hcpN/loM2U pgTqfe0K46l6v8uQ0po6d+HH/BYTwg03g4AD3w73FEou0gcZfxKBvZoNJNbXyq/i9XXq oWIL8wgRBrxDFD26bNkbcOl20YzQpb3jqpOq4y7dvxu1hztX+EIEmh8/dbUf5WisLWNC nJQM6fa0ao0AoCzQ9ilewLkC5FCYnwtOcEWLjmZXH3V3s+2vp4n9VdbDuwx1wbwkHrB5 jrV/DTMHI0R2v5vA8+fGBVABLCaGz/a67XaqV0DDQBL/XUY+fQXzNAstsF+zSaEwaMrF 3tDw== X-Google-Smtp-Source: AFSGD/WCzFmonEHgoYAEBEhZecfqFKbM9P4hOtWijVGXyq92rKZT6lTyCBXPbqUfxWdZxWq3rWTdTg== X-Received: by 2002:a1c:da92:: with SMTP id r140mr11005051wmg.136.1544446279827; Mon, 10 Dec 2018 04:51:19 -0800 (PST) Received: from andreyknvl0.muc.corp.google.com ([2a00:79e0:15:10:3180:41f8:3010:ff61]) by smtp.gmail.com with ESMTPSA id l197sm36893363wma.44.2018.12.10.04.51.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Dec 2018 04:51:19 -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 , 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 , Andrey Konovalov Subject: [PATCH v9 7/8] arm64: update Documentation/arm64/tagged-pointers.txt Date: Mon, 10 Dec 2018 13:51:04 +0100 Message-Id: <5b08153a9d69a5aa958071dcc5477c881f56dcde.1544445454.git.andreyknvl@google.com> X-Mailer: git-send-email 2.20.0.rc2.403.gdbc3b29805-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