Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3594196imu; Mon, 10 Dec 2018 04:57:06 -0800 (PST) X-Google-Smtp-Source: AFSGD/WcNU/dT+Y+Vl6iHtxhq7fT0W7iu8lYCKlnhll9tmWKXsGUMp4Lbp+jcvHxjFpFZKvPXiSs X-Received: by 2002:a62:6dc7:: with SMTP id i190mr9555335pfc.166.1544446626685; Mon, 10 Dec 2018 04:57:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544446626; cv=none; d=google.com; s=arc-20160816; b=dwym4cD8yV4Jxbm6HWGzZ5UvMWWonfyUvoJZiYd4WKfjtp2+iq9aN3BpVe7XAtmhzZ cnOHcjMCVfcw2TYnpdgu2Wis7OvTfaNe+2cYWzcScvYJPjqtbNc/Ywmk+RZQIYWL+Uif 3RaFJ75Gc94fg+kZYRXtGPTpxDBuDPkkRmh5JaHFOw88e/8haLKowON+Mu1srkUA7wKl 2MWZR1/wF7n9F9dIqfI9W76Y0A7UtVtmEWFeMk7zJZEzLizU8G7bKX8ofzrivSin/r7q odurniuGbCG5TPyN2QwnFQdpzodqfJ3EnTHEYn4E0wqASaugV656fB37Uk4fwehoTcz+ ZnNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ngEuYePF0Ik8OjXWCCgTn5YSoHew/I/tp51mGRx8kg4=; b=KUBUwZ9x0vz2g+DNc0/X/NC+BuM9lnundD3T32s+K5cc8+meRuugG8cvfUz5KcQavc HutfNxSVTRYCeVI2y+Qvqeo2vBCwxwU2JOVPphfgAE/IwnLNb1+3OwTYQsRFouokiVHa 7akMp2OWVmmU1YDLM9HrQFrY4v+hpQ/PsXmqptZtaeffM2PDwPncy2IuPv5d1ODlmAgJ LSqojFyrM7xvmUpoeoTpTGqL3RQnirTMmwXaK52oW7wmilVtkMuIM06p6y7b5DzQ3BJg WCVbuSOwCAaz3w14rddAzFRHzNiEtpNEvHkualfAbgwwfNJptJcfuFo/gtuhqgEQxxFQ OfpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=CmCoquOI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t3si9586005pgo.585.2018.12.10.04.56.50; Mon, 10 Dec 2018 04:57:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=CmCoquOI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727875AbeLJMvb (ORCPT + 99 others); Mon, 10 Dec 2018 07:51:31 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:50831 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727400AbeLJMvW (ORCPT ); Mon, 10 Dec 2018 07:51:22 -0500 Received: by mail-wm1-f67.google.com with SMTP id n190so10865008wmd.0 for ; Mon, 10 Dec 2018 04:51:20 -0800 (PST) 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-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ngEuYePF0Ik8OjXWCCgTn5YSoHew/I/tp51mGRx8kg4=; b=kKAoxqf8/mALM/J9/eyEjfNg53ucLTHPK4s6a2bU0ThtbGFcPzqLioziDrBun/ap8q BC0R6fIKhtRLnNpJkvl9aNDRLuqiUqSzhR/gY5xLRR6E7GWNaFm8lW/9/7A+3+/QNcmW RMRFh+v8E2WXhVUs7/7QAE1WJgsUZTmp+Jvyyud3A0bh4B6shFfSbD/pDIEQRmEA2+lr 8AfTRPNSWi4yVAuGupLCy8nVnGXjlyvnvzYMjCvZuzn8DhfbbUFIrSON5nShlcD4BhQ2 CBD16nxQt2WCVtYoT67zcVzp98b+mrckpbgfYGeTvPTqtbr+GZ+k23gk9d2zRoJLisyT tqcg== X-Gm-Message-State: AA+aEWYZ5I4geajiBOYpWNjGIdXhCgBT41ciIMtT+Ggd0ne9SivmyXn8 ZEoh1LvgcsT+beAhkAPVJjD6IA== 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 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 -- 2.20.0.rc2.403.gdbc3b29805-goog