From patchwork Thu Nov 8 14:36:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Konovalov X-Patchwork-Id: 10674383 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 1658C14E2 for ; Thu, 8 Nov 2018 14:36:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 065DC26C9B for ; Thu, 8 Nov 2018 14:36:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ECBB928B1F; Thu, 8 Nov 2018 14:36:48 +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=unavailable 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 815A326C9B for ; Thu, 8 Nov 2018 14:36:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 493AA6B060B; Thu, 8 Nov 2018 09:36:33 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 46C5B6B060C; Thu, 8 Nov 2018 09:36:33 -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 30C7B6B060E; Thu, 8 Nov 2018 09:36:33 -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 B761E6B060C for ; Thu, 8 Nov 2018 09:36:32 -0500 (EST) Received: by mail-wr1-f71.google.com with SMTP id g17-v6so17305722wrw.6 for ; Thu, 08 Nov 2018 06:36:32 -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=AfT6+8vP45oXrV17rGSZ9pzYS0my+RLSPjgVa2gqAd4=; b=AqsYz3EOGjg7Sskx8cz/gfKBT9OIKclFwxf30m6SUsI4oaeMYeA8MFwd9Rd41RgL9v NhMIjCyvbv7qi8NZdsHH/v2yfDabbJuXOcpfHiLn0cCq9wYVfhCNM8RiuwZpWGC5LwbY WXZH9xjybrJWujR+4IZ+tfjUjyPRMW8i7d8iQ32METmPGKrrRzPq2JsAalhBNjhbIPE6 FCvakff4lfOSygHU399KJraiwa72601NILP+nS6x8tSeKN+RD2v3NmxjNcEWy2nZVWJN YWD8WZ2d0FqXz7EOHRXit41eaHCZq+W5mED7lAyd4FvABqyoq6lcEmeB5HYn7Y2+Bk+c dFpQ== X-Gm-Message-State: AGRZ1gJF+/CBOhzoU5u/m5oEKMUU4c/K11LPdlPTnWO2pS0lcPH4EmoF N7d6b71eC2X9dTDADaeRErIiDbCbUxUad+dFzYskswHN6r3pkfpz8XSpwCNnnMtcPm6hgb3FEyW Ji/45YJfxUMoFhotq9puwjI5lwx/V53abUB5vyw7jvt1V6C4FYpwYQtJPkVFt8T11Nw58X/t4iS ql3vrpmZJRbUJ/5b1w+SMroU1yQF7N+z0IDbpkkqtvKt9/gakg7/rUUGKp0xFgTJ5zm/VbR4cNS DUjBaA8G94FmXVvJ8V9+gaaRrL7mKZwMoRyWXqFDut7N/EPJ0Gx/jMJSG40FFPchjmll9Ur/yda ej1zE4ZVwGo9HRf9Qy/93SKzEZKpLettAdA2LfoggXS4ExwZMDFRwY80XDvi9FH/lifs01UgiBZ V X-Received: by 2002:a1c:c911:: with SMTP id f17-v6mr1467918wmb.41.1541687792251; Thu, 08 Nov 2018 06:36:32 -0800 (PST) X-Received: by 2002:a1c:c911:: with SMTP id f17-v6mr1467874wmb.41.1541687791371; Thu, 08 Nov 2018 06:36:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541687791; cv=none; d=google.com; s=arc-20160816; b=rFfcP4eU1T++2ZbIETbfpRiig+sYwM0C9paG2hiEF9wrc3hoW5DaDjNlwkj2OtZKZg KPv3Kb1CqSeUwAsEegK+69sakAFOe1ERqKhdfUMgIGyjsoSZPj3e2Eh2TTCY8d7N3GzI LHS8BLKmQz8Zg4fndAjitjz4pIjgHwkKP5yBcZD4VudC7O/766ZgEu6TIyzefKu8jWah 1Gu4hxV9Tjt9yaknBTsP4o1kocMROGYYDAKJBPYZtmC2g1Onx7AU9M6S6LhBLs/T2qEX I0INUhS/mysii4kkPHnobLF/CKe9SgWxMotyRotawsAsZ/6zG88XkQASe+4pPD/6uibr /soA== 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=AfT6+8vP45oXrV17rGSZ9pzYS0my+RLSPjgVa2gqAd4=; b=qUmJuFyssvOnE8uqLOThwMbxS9LIgFcGWvaFSAZvSEQuaDOFCY15XbzG3Mv3s3A6Pl pAZuZ+o+LSYO9mlnLcVN6FmUDnkSPBNGfszvnmhZD9OzjXZ5WwUHgIQ94SVHul5/UiZT UYCYlJOJaBUlmxLHkp8z4jOCvRk2tUz2cuFlxudEA7gyS5vLdcSCzphp5UOIJb9E5Jy4 w9FztslXuCi54sSiCCSbpwZ/NRr4c+/wptcvEcvYhF3zPUbbvd0GOM1N3p9uRx3zecj+ wMWia1KABy9CEbyMKMrfEutbtYur2iGtQF0WL94Ts1DtilWWu33VEupuc62paS1LYt/L 4ARw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=UXht8r8Y; 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 p7-v6sor3155535wro.17.2018.11.08.06.36.31 for (Google Transport Security); Thu, 08 Nov 2018 06:36:31 -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=UXht8r8Y; 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=AfT6+8vP45oXrV17rGSZ9pzYS0my+RLSPjgVa2gqAd4=; b=UXht8r8Y+LVp07kCtfXSBeRBhpCaVOvYm1P+l9gMKK/QSvkAY4eFI/F/7dNdhFa+6s 03WsHwOPySnNl0C8RLlGZrgGNvf5upI9wpT2QD8fZu8QPcUo14dOOKGhsT3Vt3N2Xsfz jNCbI1daeAMYzEOF5k+/52Kcgvpjbbd1ZJorRlAFSppDB08ydUZoSHLoh0bXliV119yC tyWxnr6yN/1x8ngIwCnTTq6z3enqkxHT7u0Gob0KyEf1crq1MQb3JzblYwR/nihHzcHC ZK14++eId0uzOYOuwdG4frYt1cxu7q2wA7WvAPLwPwotre1YMk4rWNPG7CM0tgU1zuH6 v3bg== X-Google-Smtp-Source: AJdET5cd+Vxy+CiHtQ9mm6FtFF35wdB6lNLfr2BV8z1ME65fDt3kZ6JEKazzaGEHLM0pA02L2pbaZA== X-Received: by 2002:a05:6000:1182:: with SMTP id g2mr4510493wrx.310.1541687790933; Thu, 08 Nov 2018 06:36:30 -0800 (PST) Received: from andreyknvl0.muc.corp.google.com ([2a00:79e0:15:10:84be:a42a:826d:c530]) by smtp.gmail.com with ESMTPSA id k5-v6sm5421068wre.82.2018.11.08.06.36.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Nov 2018 06:36:30 -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 v8 7/8] arm64: update Documentation/arm64/tagged-pointers.txt Date: Thu, 8 Nov 2018 15:36:14 +0100 Message-Id: <8526edb07fd5a762847306bba89fbadbb19210b7.1541687720.git.andreyknvl@google.com> X-Mailer: git-send-email 2.19.1.930.g4563a0d9d0-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