From patchwork Tue May 12 16:36:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Martin X-Patchwork-Id: 11543509 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 69318139A for ; Tue, 12 May 2020 16:37:54 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2F6D2206CC for ; Tue, 12 May 2020 16:37:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Er0y6Pgj" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2F6D2206CC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=KAmXA3JUNiat4x9iIHIqhhksWmrIGKMXWSGmCDypyhA=; b=Er0y6PgjzG3DB0oqPwtSxD0NNJ X1RxTgCOr993rcnlb3ORTAzLaMMnmQyN4+skjw7JZPhGxH6wlmn4LavrL2d+8bw6VShZV2DfYbDgi Q4DRPPpJihOfV2XnsZrnr97W4u4J9/biEFcAeIlCgG/YARFRQdiDqfXExBWaWy9daW3Rc6Fa/fG2q lWkQEtTBRVpusDiNVrZ5yIjRFk8BQob297jQA3ax3Hs52KAYna5l8fo85eKptkwlS6yte1ZBmObnB 37hWjg12HMY5VE+LWsyUhHiVRRUdUV0Yi/LBmytS6kcJnkGyPJ7bqXcUC2XZbd3fL10e2zWw7ilHZ CeMxzu4w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jYXug-0007re-EV; Tue, 12 May 2020 16:37:50 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jYXud-0007qS-L7 for linux-arm-kernel@lists.infradead.org; Tue, 12 May 2020 16:37:49 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9622B1FB; Tue, 12 May 2020 09:37:46 -0700 (PDT) Received: from e103592.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id E73F43F305; Tue, 12 May 2020 09:37:45 -0700 (PDT) From: Dave Martin To: mtk.manpages@gmail.com Subject: [PATCH 01/14] prctl.2: tfix clarify that prctl can apply to threads Date: Tue, 12 May 2020 17:36:46 +0100 Message-Id: <1589301419-24459-2-git-send-email-Dave.Martin@arm.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1589301419-24459-1-git-send-email-Dave.Martin@arm.com> References: <1589301419-24459-1-git-send-email-Dave.Martin@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200512_093747_734180_60603122 X-CRM114-Status: GOOD ( 10.53 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [217.140.110.172 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-man@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org The current synopsis for prctl(2) misleadingly claims that prctl operates on a process. Rather, some (in fact, most) prctls operate on a thread. The wording probably dates back to the old days when Linux didn't really have threads at all. Reword as appropriate. Signed-off-by: Dave Martin --- man2/prctl.2 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/man2/prctl.2 b/man2/prctl.2 index 7a5af76..7932ada 100644 --- a/man2/prctl.2 +++ b/man2/prctl.2 @@ -53,7 +53,7 @@ .\" .TH PRCTL 2 2020-04-11 "Linux" "Linux Programmer's Manual" .SH NAME -prctl \- operations on a process +prctl \- operations on a process or thread .SH SYNOPSIS .nf .B #include @@ -63,6 +63,10 @@ prctl \- operations on a process .fi .SH DESCRIPTION .BR prctl () +manipulates various aspects of the behavior +of the calling thread or process. +.PP +.BR prctl () is called with a first argument describing what to do (with values defined in \fI\fP), and further arguments with a significance depending on the first one. From patchwork Tue May 12 16:36:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Martin X-Patchwork-Id: 11543511 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 11736139A for ; Tue, 12 May 2020 16:38:11 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AC7FE20714 for ; Tue, 12 May 2020 16:38:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="TDmh3RLX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AC7FE20714 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=l/KQpjTUrBE/Nq6fKG+awadFVxEjYiLJ7ECvNM8AdjY=; b=TDmh3RLXbFDVn7FCuprC1lfgct urTptiPAtVL2vYVKKLREugNfsH21C7oFsHKkXbLGo3XfAFdGUl4Nx0A29gh+gYMiTa/xN5dvDQ4qV +ChGrkuMAKxXKw7v0y2pHJnGysSzvBJXcwdeTcYiqKPq2oWTRtzCVzkeGeinXcOPm1hufw7CdTs6I nlYJLohmY45eWj0a5s8S+WZDvGyzrU41CA969AZJFWeKw74yw0O5N929A0MGjCjtvec1G/xA8YUUQ t33+VBjHUcjq/SRTx4Ls1QhxnJvdCNjBSJj7JXmhIBt+eq0g3RhpQnwT1iie8X8yFon56ZjUa73P7 zZPO/Qfw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jYXuu-000882-Gu; Tue, 12 May 2020 16:38:04 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jYXud-0007qd-SM for linux-arm-kernel@lists.infradead.org; Tue, 12 May 2020 16:37:49 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7C404D6E; Tue, 12 May 2020 09:37:47 -0700 (PDT) Received: from e103592.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id CA7123F305; Tue, 12 May 2020 09:37:46 -0700 (PDT) From: Dave Martin To: mtk.manpages@gmail.com Subject: [PATCH 02/14] prctl.2: Add health warning Date: Tue, 12 May 2020 17:36:47 +0100 Message-Id: <1589301419-24459-3-git-send-email-Dave.Martin@arm.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1589301419-24459-1-git-send-email-Dave.Martin@arm.com> References: <1589301419-24459-1-git-send-email-Dave.Martin@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200512_093747_952936_2322BABB X-CRM114-Status: UNSURE ( 9.18 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [217.140.110.172 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-man@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org In reality, almost every prctl interferes with assumptions that the compiler and C library / runtime rely on. prctl() can therefore make userspace explode in a variety ways that are likely to be hard to debug. This is not obvious to the uninitiated, so add a warning. Signed-off-by: Dave Martin --- man2/prctl.2 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/man2/prctl.2 b/man2/prctl.2 index 7932ada..a35b748 100644 --- a/man2/prctl.2 +++ b/man2/prctl.2 @@ -66,6 +66,11 @@ prctl \- operations on a process or thread manipulates various aspects of the behavior of the calling thread or process. .PP +Note that careless use of +.BR prctl () +can confuse the userspace run-time environment, +so these operations should be used with care (if at all). +.PP .BR prctl () is called with a first argument describing what to do (with values defined in \fI\fP), and further From patchwork Tue May 12 16:36:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Martin X-Patchwork-Id: 11543513 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7AE69139A for ; Tue, 12 May 2020 16:38:24 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 38C3E20714 for ; Tue, 12 May 2020 16:38:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="NUJ2/wI7" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 38C3E20714 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=ZSZNhybnsb4SsG2IcNKXttY5fRQ4xEO/4C+wfxBb16c=; b=NUJ2/wI7n+g5onuEomsgMIc5sb gj3nAsmYSv8TP27LKCa0kplUXAYoO+aNYj8ATCyKCV+GqNz6vX4RMKwVMRV/+DHq5v62Lm5Pug00v AwxGSXmAG3atSV2eqPC2UNiJ6SyGAC10GcJkI6GSkDWiibmrFPOZPkfP2SgfpYVZaq+UOrSNbm3u3 q/mnp3UD9gy7d715W2ILggX/YktfoJQuGNWmveRMNMll/rUnJwMyG2Ehp8qBhfCr+Zm1mvm3YBKGg nyl2ZbtYsQZzS+afMgsdF0QpYVaDLZP5F4LgN9zSlkrCm0izr1wz1sW3m6Neafdohg1Zux7IfyX0A a3MYpZQA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jYXv9-0008Og-7n; Tue, 12 May 2020 16:38:19 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jYXuf-0007qu-4i for linux-arm-kernel@lists.infradead.org; Tue, 12 May 2020 16:37:50 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 60BA511B3; Tue, 12 May 2020 09:37:48 -0700 (PDT) Received: from e103592.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id B0B593F305; Tue, 12 May 2020 09:37:47 -0700 (PDT) From: Dave Martin To: mtk.manpages@gmail.com Subject: [PATCH 03/14] prctl.2: tfix mis-description of thread ID values in procfs Date: Tue, 12 May 2020 17:36:48 +0100 Message-Id: <1589301419-24459-4-git-send-email-Dave.Martin@arm.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1589301419-24459-1-git-send-email-Dave.Martin@arm.com> References: <1589301419-24459-1-git-send-email-Dave.Martin@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200512_093749_252841_7FE11132 X-CRM114-Status: UNSURE ( 9.16 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [217.140.110.172 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-man@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Under PR_SET_NAME, the [tid] value seen in procfs as /proc/self/task/[tid] is mistakenly described as the name of the thread, whereas really the name is on /proc/self/task/[tid]/comm. Fix it. Signed-off-by: Dave Martin --- man2/prctl.2 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/man2/prctl.2 b/man2/prctl.2 index a35b748..9736434 100644 --- a/man2/prctl.2 +++ b/man2/prctl.2 @@ -808,8 +808,10 @@ and retrieved using The attribute is likewise accessible via .IR /proc/self/task/[tid]/comm , where -.I tid -is the name of the calling thread. +.I [tid] +is the the thread ID of the calling thread, as returned by +.BR gettid (2). +.\" prctl PR_GET_NAME .TP .BR PR_GET_NAME " (since Linux 2.6.11)" Return the name of the calling thread, From patchwork Tue May 12 16:36:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Martin X-Patchwork-Id: 11543535 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3B5B4139A for ; Tue, 12 May 2020 16:40:57 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EA50A20714 for ; Tue, 12 May 2020 16:40:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="IsRh1V0a" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EA50A20714 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=Pbky/vjXOKy2TPBqEJgKjLD4YczgAo+Wlq5cAcwaaro=; b=IsRh1V0aIkniBLgcLvDbasi9U3 oERZTo74qEMFEgQHlxJJowtL/PaFHr1PD87hXJCSLzH5R14NSetukJ6PpkVhLC0YBF9jul6oZNA3j w++AfjgmrdKJPxb7KK6HjCrEcqOYm+IRcc6ei9tnDddQcQqwXX1nCWUPEUxSLIeqav7dt6ztntW0t 85fDCRRqfkKRQl5gMzctjy6sz8Am4uh/onE7v505rtZqqMZMPDmxXrjl/gP8rGMvxF/w8SUE0Qe6m JEYoqC4wSx+mvsprfisDqvWkx0R6q0Ibplkh1oFuSbtXh8lRvSf4z8dRAH4j145Nx9rTPgUJGvl57 JW6eXv/w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jYXxb-0004Mm-Vr; Tue, 12 May 2020 16:40:52 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jYXuk-0007tn-SP for linux-arm-kernel@lists.infradead.org; Tue, 12 May 2020 16:37:58 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4488E1FB; Tue, 12 May 2020 09:37:49 -0700 (PDT) Received: from e103592.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 93F723F305; Tue, 12 May 2020 09:37:48 -0700 (PDT) From: Dave Martin To: mtk.manpages@gmail.com Subject: [PATCH 04/14] prctl.2: srcfix add comments for navigation Date: Tue, 12 May 2020 17:36:49 +0100 Message-Id: <1589301419-24459-5-git-send-email-Dave.Martin@arm.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1589301419-24459-1-git-send-email-Dave.Martin@arm.com> References: <1589301419-24459-1-git-send-email-Dave.Martin@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200512_093755_132200_4852F1C0 X-CRM114-Status: GOOD ( 18.66 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [217.140.110.172 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-man@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org The prctl.2 source is unnecessarily hard to navigate, not least because prctl option flags are traditionally named PR_* and so look just like prctl names. For each actual prctl, add a comment of the form .\" prctl PR_FOO to make it move obvious where each top-level prctl starts. Of course, we could add some clever macros, but let's not confuse dumb parsers. Signed-off-by: Dave Martin --- man2/prctl.2 | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/man2/prctl.2 b/man2/prctl.2 index 9736434..e5b2b4b 100644 --- a/man2/prctl.2 +++ b/man2/prctl.2 @@ -77,6 +77,7 @@ is called with a first argument describing what to do arguments with a significance depending on the first one. The first argument can be: .\" +.\" prctl PR_CAP_AMBIENT .TP .BR PR_CAP_AMBIENT " (since Linux 4.3)" .\" commit 58319057b7847667f0c9585b9de0e8932b0fdb08 @@ -130,6 +131,7 @@ library in the form of .BR cap_set_ambient (3), and .BR cap_reset_ambient (3). +.\" prctl PR_CAPBSET_READ .TP .BR PR_CAPBSET_READ " (since Linux 2.6.25)" Return (as the function result) 1 if the capability specified in @@ -152,6 +154,7 @@ A higher-level interface layered on top of this operation is provided in the .BR libcap (3) library in the form of .BR cap_get_bound (3). +.\" prctl PR_CAPBSET_DROP .TP .BR PR_CAPBSET_DROP " (since Linux 2.6.25)" If the calling thread has the @@ -178,6 +181,7 @@ A higher-level interface layered on top of this operation is provided in the .BR libcap (3) library in the form of .BR cap_drop_bound (3). +.\" prctl PR_SET_CHILD_SUBREAPER .TP .BR PR_SET_CHILD_SUBREAPER " (since Linux 3.4)" .\" commit ebec18a6d3aa1e7d84aab16225e87fd25170ec2b @@ -224,11 +228,13 @@ Some frameworks (e.g., .BR systemd (1)) employ a subreaper process for similar reasons. +.\" prctl PR_GET_CHILD_SUBREAPER .TP .BR PR_GET_CHILD_SUBREAPER " (since Linux 3.4)" Return the "child subreaper" setting of the caller, in the location pointed to by .IR "(int\ *) arg2" . +.\" prctl PR_SET_DUMPABLE .TP .BR PR_SET_DUMPABLE " (since Linux 2.3.20)" Set the state of the "dumpable" attribute, @@ -297,6 +303,7 @@ the ownership of files in the process's .IR /proc/[pid] directory is affected as described in .BR proc (5). +.\" prctl PR_GET_DUMPABLE .TP .BR PR_GET_DUMPABLE " (since Linux 2.3.20)" Return (as the function result) the current state of the calling @@ -304,6 +311,7 @@ process's dumpable attribute. .\" Since Linux 2.6.13, the dumpable flag can have the value 2, .\" but in 2.6.13 PR_GET_DUMPABLE simply returns 1 if the dumpable .\" flags has a nonzero value. This was fixed in 2.6.14. +.\" prctl PR_SET_ENDIAN .TP .BR PR_SET_ENDIAN " (since Linux 2.6.18, PowerPC only)" Set the endian-ness of the calling process to the value given @@ -314,11 +322,13 @@ in \fIarg2\fP, which should be one of the following: or .B PR_ENDIAN_PPC_LITTLE (PowerPC pseudo little endian). +.\" prctl PR_GET_ENDIAN .TP .BR PR_GET_ENDIAN " (since Linux 2.6.18, PowerPC only)" Return the endian-ness of the calling process, in the location pointed to by .IR "(int\ *) arg2" . +.\" prctl PR_SET_FP_MODE .TP .BR PR_SET_FP_MODE " (since Linux 4.0, only on MIPS)" .\" commit 9791554b45a2acc28247f66a5fd5bbc212a6b8c8 @@ -425,6 +435,7 @@ The arguments and .IR arg5 are ignored. +.\" prctl PR_GET_FP_MODE .TP .BR PR_GET_FP_MODE " (since Linux 4.0, only on MIPS)" Return (as the function result) @@ -442,6 +453,7 @@ The arguments and .IR arg5 are ignored. +.\" prctl PR_SET_FPEMU .TP .BR PR_SET_FPEMU " (since Linux 2.4.18, 2.5.9, only on ia64)" Set floating-point emulation control bits to \fIarg2\fP. @@ -452,11 +464,13 @@ to silently emulate floating-point operation accesses, or to not emulate floating-point operations and send .B SIGFPE instead. +.\" prctl PR_GET_FPEMU .TP .BR PR_GET_FPEMU " (since Linux 2.4.18, 2.5.9, only on ia64)" Return floating-point emulation control bits, in the location pointed to by .IR "(int\ *) arg2" . +.\" prctl PR_SET_FPEXC .TP .BR PR_SET_FPEXC " (since Linux 2.4.21, 2.5.32, only on PowerPC)" Set floating-point exception mode to \fIarg2\fP. @@ -470,11 +484,13 @@ Pass \fBPR_FP_EXC_SW_ENABLE\fP to use FPEXC for FP exception enables, \fBPR_FP_EXC_NONRECOV\fP for async nonrecoverable exception mode, \fBPR_FP_EXC_ASYNC\fP for async recoverable exception mode, \fBPR_FP_EXC_PRECISE\fP for precise exception mode. +.\" prctl PR_GET_FPEXC .TP .BR PR_GET_FPEXC " (since Linux 2.4.21, 2.5.32, only on PowerPC)" Return floating-point exception mode, in the location pointed to by .IR "(int\ *) arg2" . +.\" prctl PR_SET_KEEPCAPS .TP .BR PR_SET_KEEPCAPS " (since Linux 2.2.18)" Set the state of the calling thread's "keep capabilities" flag. @@ -485,6 +501,7 @@ must be either 0 (clear the flag) or 1 (set the flag). The "keep capabilities" value will be reset to 0 on subsequent calls to .BR execve (2). +.\" prctl PR_GET_KEEPCAPS .TP .BR PR_GET_KEEPCAPS " (since Linux 2.2.18)" Return (as the function result) the current state of the calling thread's @@ -492,6 +509,7 @@ Return (as the function result) the current state of the calling thread's See .BR capabilities (7) for a description of this flag. +.\" prctl PR_MCE_KILL .TP .BR PR_MCE_KILL " (since Linux 2.6.32)" Set the machine check memory corruption kill policy for the calling thread. @@ -532,6 +550,7 @@ The policy is inherited by children. The remaining unused .BR prctl () arguments must be zero for future compatibility. +.\" prctl PR_MCE_KILL_GET .TP .BR PR_MCE_KILL_GET " (since Linux 2.6.32)" Return (as the function result) @@ -539,6 +558,7 @@ the current per-process machine check kill policy. All unused .BR prctl () arguments must be zero. +.\" prctl PR_SET_MM .TP .BR PR_SET_MM " (since Linux 3.3)" .\" commit 028ee4be34a09a6d48bdf30ab991ae933a7bc036 @@ -716,6 +736,7 @@ This feature is available only if the kernel is built with the .BR CONFIG_CHECKPOINT_RESTORE option enabled. .RE +.\" prctl PR_MPX_ENABLE_MANAGEMENT .TP .BR PR_MPX_ENABLE_MANAGEMENT ", " PR_MPX_DISABLE_MANAGEMENT " (since Linux 3.19) " .\" commit fe3d197f84319d3bce379a9c0dc17b1f48ad358c @@ -791,6 +812,7 @@ had been called. .IP For further information on Intel MPX, see the kernel source file .IR Documentation/x86/intel_mpx.txt . +.\" prctl PR_SET_NAME .TP .BR PR_SET_NAME " (since Linux 2.6.9)" Set the name of the calling thread, @@ -819,6 +841,7 @@ in the buffer pointed to by .IR "(char\ *) arg2" . The buffer should allow space for up to 16 bytes; the returned string will be null-terminated. +.\" prctl PR_SET_NO_NEW_PRIVS .TP .BR PR_SET_NO_NEW_PRIVS " (since Linux 3.5)" Set the calling thread's @@ -862,6 +885,7 @@ For more information, see the kernel source file before Linux 4.13). See also .BR seccomp (2). +.\" prctl PR_GET_NO_NEW_PRIVS .TP .BR PR_GET_NO_NEW_PRIVS " (since Linux 3.5)" Return (as the function result) the value of the @@ -873,6 +897,7 @@ behavior. A value of 1 indicates .BR execve (2) will operate in the privilege-restricting mode described above. +.\" prctl PR_SET_PDEATHSIG .TP .BR PR_SET_PDEATHSIG " (since Linux 2.1.57)" Set the parent-death signal @@ -922,11 +947,13 @@ or a binary that has associated capabilities (see .BR capabilities (7)); otherwise, this value is preserved across .BR execve (2). +.\" prctl PR_GET_PDEATHSIG .TP .BR PR_GET_PDEATHSIG " (since Linux 2.3.15)" Return the current value of the parent process death signal, in the location pointed to by .IR "(int\ *) arg2" . +.\" prctl PR_SET_PTRACER .TP .BR PR_SET_PTRACER " (since Linux 3.4)" .\" commit 2d514487faf188938a4ee4fb3464eeecfbdcf8eb @@ -959,6 +986,7 @@ For further information, see the kernel source file (or .IR Documentation/security/Yama.txt before Linux 4.13). +.\" prctl PR_SET_SECCOMP .TP .BR PR_SET_SECCOMP " (since Linux 2.6.23)" .\" See http://thread.gmane.org/gmane.linux.kernel/542632 @@ -1035,6 +1063,7 @@ For further information, see the kernel source file (or .IR Documentation/prctl/seccomp_filter.txt before Linux 4.13). +.\" prctl PR_GET_SECCOMP .TP .BR PR_GET_SECCOMP " (since Linux 2.6.23)" Return (as the function result) @@ -1061,18 +1090,21 @@ field of the file provides a method of obtaining the same information, without the risk that the process is killed; see .BR proc (5). +.\" prctl PR_SET_SECUREBITS .TP .BR PR_SET_SECUREBITS " (since Linux 2.6.26)" Set the "securebits" flags of the calling thread to the value supplied in .IR arg2 . See .BR capabilities (7). +.\" prctl PR_GET_SECUREBITS .TP .BR PR_GET_SECUREBITS " (since Linux 2.6.26)" Return (as the function result) the "securebits" flags of the calling thread. See .BR capabilities (7). +.\" prctl PR_GET_SPECULATION_CTRL .TP .BR PR_GET_SPECULATION_CTRL " (since Linux 4.17)" Return (as the function result) @@ -1119,6 +1151,7 @@ and .I arg5 arguments must be specified as 0; otherwise the call fails with the error .BR EINVAL . +.\" prctl PR_SET_SPECULATION_CTRL .TP .BR PR_SET_SPECULATION_CTRL " (since Linux 4.17)" .\" commit b617cfc858161140d69cc0b5cc211996b557a1c7 @@ -1174,6 +1207,7 @@ call failing with the error .BR ENXIO . For further details, see the kernel source file .IR Documentation/admin-guide/kernel-parameters.txt . +.\" prctl PR_SET_THP_DISABLE .TP .BR PR_SET_THP_DISABLE " (since Linux 3.15)" .\" commit a0715cc22601e8830ace98366c0c2bd8da52af52 @@ -1191,6 +1225,7 @@ The setting of the "THP disable" flag is inherited by a child created via and is preserved across .BR execve (2). .\" +.\" prctl PR_TASK_PERF_EVENTS_DISABLE .TP .BR PR_TASK_PERF_EVENTS_DISABLE " (since Linux 2.6.31)" Disable all performance counters attached to the calling process, @@ -1207,6 +1242,7 @@ Originally called renamed (retaining the same numerical value) in Linux 2.6.32. .\" +.\" prctl PR_TASK_PERF_EVENTS_ENABLE .TP .BR PR_TASK_PERF_EVENTS_ENABLE " (since Linux 2.6.31)" The converse of @@ -1220,11 +1256,13 @@ renamed .\" commit cdd6c482c9ff9c55475ee7392ec8f672eddb7be6 in Linux 2.6.32. .\" +.\" prctl PR_GET_THP_DISABLE .TP .BR PR_GET_THP_DISABLE " (since Linux 3.15)" Return (as the function result) the current setting of the "THP disable" flag for the calling thread: either 1, if the flag is set, or 0, if it is not. +.\" prctl PR_GET_TID_ADDRESS .TP .BR PR_GET_TID_ADDRESS " (since Linux 3.5)" .\" commit 300f786b2683f8bb1ec0afb6e1851183a479c86d @@ -1246,6 +1284,7 @@ system call does not have a compat implementation for the AMD64 x32 and MIPS n32 ABIs, and the kernel writes out a pointer using the kernel's pointer size, this operation expects a user-space buffer of 8 (not 4) bytes on these ABIs. +.\" prctl PR_SET_TIMERSLACK .TP .BR PR_SET_TIMERSLACK " (since Linux 2.6.28)" .\" See https://lwn.net/Articles/369549/ @@ -1316,10 +1355,12 @@ can be examined and changed via the file .IR /proc/[pid]/timerslack_ns . See .BR proc (5). +.\" prctl PR_GET_TIMERSLACK .TP .BR PR_GET_TIMERSLACK " (since Linux 2.6.28)" Return (as the function result) the "current" timer slack value of the calling thread. +.\" prctl PR_SET_TIMING .TP .BR PR_SET_TIMING " (since Linux 2.6.0)" .\" Precisely: Linux 2.6.0-test4 @@ -1338,11 +1379,13 @@ is not currently implemented .\" PR_TIMING_TIMESTAMP doesn't do anything in 2.6.26-rc8, .\" and looking at the patch history, it appears .\" that it never did anything. +.\" prctl PR_GET_TIMING .TP .BR PR_GET_TIMING " (since Linux 2.6.0)" .\" Precisely: Linux 2.6.0-test4 Return (as the function result) which process timing method is currently in use. +.\" prctl PR_SET_TSC .TP .BR PR_SET_TSC " (since Linux 2.6.26, x86 only)" Set the state of the flag determining whether the timestamp counter @@ -1356,12 +1399,14 @@ to allow it to be read, or to generate a .B SIGSEGV when the process tries to read the timestamp counter. +.\" prctl PR_GET_TSC .TP .BR PR_GET_TSC " (since Linux 2.6.26, x86 only)" Return the state of the flag determining whether the timestamp counter can be read, in the location pointed to by .IR "(int\ *) arg2" . +.\" prctl PR_SET_UNALIGN .TP .B PR_SET_UNALIGN (Only on: ia64, since Linux 2.3.48; parisc, since Linux 2.6.15; @@ -1385,6 +1430,7 @@ flag in operation of the .BR setsysinfo () system call on Tru64). +.\" prctl PR_GET_UNALIGN .TP .B PR_GET_UNALIGN (See @@ -1392,6 +1438,7 @@ system call on Tru64). for information on versions and architectures.) Return unaligned access control bits, in the location pointed to by .IR "(unsigned int\ *) arg2" . +.\" prctl PR_SET_IO_FLUSHER .TP .BR PR_SET_IO_FLUSHER " (since Linux 5.6)" If a user process is involved in the block layer or filesystem I/O path, @@ -1420,6 +1467,7 @@ and is preserved across Examples of IO_FLUSHER applications are FUSE daemons, SCSI device emulation daemons, and daemons that perform error handling like multipath path recovery applications. +.\" prctl PR_GET_IO_FLUSHER .TP .B PR_GET_IO_FLUSHER (Since Linux 5.6) Return (as the function result) the IO_FLUSHER state of the caller. From patchwork Tue May 12 16:36:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Martin X-Patchwork-Id: 11543515 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 249DD159A for ; Tue, 12 May 2020 16:38:50 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DBC95206CC for ; Tue, 12 May 2020 16:38:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="lQKddzDZ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DBC95206CC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=siclMeIBx/bPuE401o1vmPVnko3pyX9jzEjtiLUn39A=; b=lQKddzDZpcAm+3wWnteOQs90Ud dT7BajgSKqR/wM0W0kIO3I/V6F1T7kjyBjkIPKxOzCxejivQldn8IGE50schEL0/mwMfnukZuS/na bEKlqIBe3x2sjkzcJBhUCABMovECvztP2TvdZFtNmHi1+LQgUIYl92DxHDD5dSdzmNbsfa/IGkNlS 2t+9+QgV0AxWGStNyOLuuteVJEntjsmFcIeMC9DfXc9WYnexs6hcZvH3Z2T1Kx9yKie1IdEp94wum AAftUJ12gplJM9gDW12a/dZXUECxts9WRAqiNpgO89HsilYf/9pYbD9ONQ5Vja8WwqzlKGYH2LFky WBFLaYWg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jYXvV-0000CR-Ng; Tue, 12 May 2020 16:38:41 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jYXuh-0007si-A0 for linux-arm-kernel@lists.infradead.org; Tue, 12 May 2020 16:37:53 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0BFEED6E; Tue, 12 May 2020 09:37:50 -0700 (PDT) Received: from e103592.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 773B13F305; Tue, 12 May 2020 09:37:49 -0700 (PDT) From: Dave Martin To: mtk.manpages@gmail.com Subject: [PATCH 05/14] prctl.2: tfix listing order of prctls Date: Tue, 12 May 2020 17:36:50 +0100 Message-Id: <1589301419-24459-6-git-send-email-Dave.Martin@arm.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1589301419-24459-1-git-send-email-Dave.Martin@arm.com> References: <1589301419-24459-1-git-send-email-Dave.Martin@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200512_093751_469493_20B5C4D4 X-CRM114-Status: GOOD ( 11.52 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [217.140.110.172 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-man@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org The prctl list has historically been sorted by prctl name (ignoring any SET_ or GET_ prefix) to make individual prctls easier to find. Some noise seems to have crept in since. Sort the list back into order. Similarly, reorder the list of prctls specified to return non-zero values on success. Content movement only. No semantic change. Signed-off-by: Dave Martin --- man2/prctl.2 | 138 +++++++++++++++++++++++++++++------------------------------ 1 file changed, 69 insertions(+), 69 deletions(-) diff --git a/man2/prctl.2 b/man2/prctl.2 index e5b2b4b..1611448 100644 --- a/man2/prctl.2 +++ b/man2/prctl.2 @@ -490,6 +490,52 @@ Pass \fBPR_FP_EXC_SW_ENABLE\fP to use FPEXC for FP exception enables, Return floating-point exception mode, in the location pointed to by .IR "(int\ *) arg2" . +.\" prctl PR_SET_IO_FLUSHER +.TP +.BR PR_SET_IO_FLUSHER " (since Linux 5.6)" +If a user process is involved in the block layer or filesystem I/O path, +and can allocate memory while processing I/O requests it must set +\fIarg2\fP to 1. +This will put the process in the IO_FLUSHER state, +which allows it special treatment to make progress when allocating memory. +If \fIarg2\fP is 0, the process will clear the IO_FLUSHER state, and +the default behavior will be used. +.IP +The calling process must have the +.BR CAP_SYS_RESOURCE +capability. +.IP +.IR arg3 , +.IR arg4 , +and +.IR arg5 +must be zero. +.IP +The IO_FLUSHER state is inherited by a child process created via +.BR fork (2) +and is preserved across +.BR execve (2). +.IP +Examples of IO_FLUSHER applications are FUSE daemons, SCSI device +emulation daemons, and daemons that perform error handling like multipath +path recovery applications. +.\" prctl PR_GET_IO_FLUSHER +.TP +.B PR_GET_IO_FLUSHER (Since Linux 5.6) +Return (as the function result) the IO_FLUSHER state of the caller. +A value of 1 indicates that the caller is in the IO_FLUSHER state; +0 indicates that the caller is not in the IO_FLUSHER state. +.IP +The calling process must have the +.BR CAP_SYS_RESOURCE +capability. +.IP +.IR arg2 , +.IR arg3 , +.IR arg4 , +and +.IR arg5 +must be zero. .\" prctl PR_SET_KEEPCAPS .TP .BR PR_SET_KEEPCAPS " (since Linux 2.2.18)" @@ -1207,23 +1253,6 @@ call failing with the error .BR ENXIO . For further details, see the kernel source file .IR Documentation/admin-guide/kernel-parameters.txt . -.\" prctl PR_SET_THP_DISABLE -.TP -.BR PR_SET_THP_DISABLE " (since Linux 3.15)" -.\" commit a0715cc22601e8830ace98366c0c2bd8da52af52 -Set the state of the "THP disable" flag for the calling thread. -If -.I arg2 -has a nonzero value, the flag is set, otherwise it is cleared. -Setting this flag provides a method -for disabling transparent huge pages -for jobs where the code cannot be modified, and using a malloc hook with -.BR madvise (2) -is not an option (i.e., statically allocated data). -The setting of the "THP disable" flag is inherited by a child created via -.BR fork (2) -and is preserved across -.BR execve (2). .\" .\" prctl PR_TASK_PERF_EVENTS_DISABLE .TP @@ -1256,6 +1285,23 @@ renamed .\" commit cdd6c482c9ff9c55475ee7392ec8f672eddb7be6 in Linux 2.6.32. .\" +.\" prctl PR_SET_THP_DISABLE +.TP +.BR PR_SET_THP_DISABLE " (since Linux 3.15)" +.\" commit a0715cc22601e8830ace98366c0c2bd8da52af52 +Set the state of the "THP disable" flag for the calling thread. +If +.I arg2 +has a nonzero value, the flag is set, otherwise it is cleared. +Setting this flag provides a method +for disabling transparent huge pages +for jobs where the code cannot be modified, and using a malloc hook with +.BR madvise (2) +is not an option (i.e., statically allocated data). +The setting of the "THP disable" flag is inherited by a child created via +.BR fork (2) +and is preserved across +.BR execve (2). .\" prctl PR_GET_THP_DISABLE .TP .BR PR_GET_THP_DISABLE " (since Linux 3.15)" @@ -1438,67 +1484,21 @@ system call on Tru64). for information on versions and architectures.) Return unaligned access control bits, in the location pointed to by .IR "(unsigned int\ *) arg2" . -.\" prctl PR_SET_IO_FLUSHER -.TP -.BR PR_SET_IO_FLUSHER " (since Linux 5.6)" -If a user process is involved in the block layer or filesystem I/O path, -and can allocate memory while processing I/O requests it must set -\fIarg2\fP to 1. -This will put the process in the IO_FLUSHER state, -which allows it special treatment to make progress when allocating memory. -If \fIarg2\fP is 0, the process will clear the IO_FLUSHER state, and -the default behavior will be used. -.IP -The calling process must have the -.BR CAP_SYS_RESOURCE -capability. -.IP -.IR arg3 , -.IR arg4 , -and -.IR arg5 -must be zero. -.IP -The IO_FLUSHER state is inherited by a child process created via -.BR fork (2) -and is preserved across -.BR execve (2). -.IP -Examples of IO_FLUSHER applications are FUSE daemons, SCSI device -emulation daemons, and daemons that perform error handling like multipath -path recovery applications. -.\" prctl PR_GET_IO_FLUSHER -.TP -.B PR_GET_IO_FLUSHER (Since Linux 5.6) -Return (as the function result) the IO_FLUSHER state of the caller. -A value of 1 indicates that the caller is in the IO_FLUSHER state; -0 indicates that the caller is not in the IO_FLUSHER state. -.IP -The calling process must have the -.BR CAP_SYS_RESOURCE -capability. -.IP -.IR arg2 , -.IR arg3 , -.IR arg4 , -and -.IR arg5 -must be zero. .SH RETURN VALUE On success, +.BR PR_CAP_AMBIENT + PR_CAP_AMBIENT_IS_SET , +.BR PR_CAPBSET_READ , .BR PR_GET_DUMPABLE , .BR PR_GET_FP_MODE , +.BR PR_GET_IO_FLUSHER , .BR PR_GET_KEEPCAPS , +.BR PR_MCE_KILL_GET , .BR PR_GET_NO_NEW_PRIVS , +.BR PR_GET_SECUREBITS , +.BR PR_GET_SPECULATION_CTRL , .BR PR_GET_THP_DISABLE , -.BR PR_CAPBSET_READ , .BR PR_GET_TIMING , .BR PR_GET_TIMERSLACK , -.BR PR_GET_SECUREBITS , -.BR PR_GET_SPECULATION_CTRL , -.BR PR_MCE_KILL_GET , -.BR PR_CAP_AMBIENT + PR_CAP_AMBIENT_IS_SET , -.BR PR_GET_IO_FLUSHER , and (if it returns) .BR PR_GET_SECCOMP return the nonnegative values described above. From patchwork Tue May 12 16:36:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Martin X-Patchwork-Id: 11543517 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C8B55159A for ; Tue, 12 May 2020 16:38:57 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5DD5F206CC for ; Tue, 12 May 2020 16:38:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="gTY0X3Yl" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5DD5F206CC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=U7P1XEeJA6GRPF8fxtgxAkjkPGGayefZ8CFVL3AMm3I=; b=gTY0X3YlO68iMhWoR2PxyynH0D /KfvVbquED+hi58pzctHg/0OI2TkxvDxxb7fSdnjGOLr7BjX3b1rKOz3dcWkm4cVmnOs7p/qTD2ZF XW20psyPWXPofYxr/JxTdm2ey9JDzJJXioZmgEGwPVrMDzmIVQMfNi7FnfkqB3IkVNJPuCbSQ5oUg HbkzzAwZCJVAAZ922c/0tN/jIsSmvzVWC+xiNnxNVc8Zl5FCvkc3wf1tUd1tPBpf00x2Pj+QEEfXZ SfaRxalcMad+0pS041nimf+AbEGHTrq0kY3leAXB1RhjmiNb6vsgHY1GgEwOUqwpj0pMBc/BK6wlM eiidUMxg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jYXvh-0000QQ-RP; Tue, 12 May 2020 16:38:53 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jYXuh-0007tn-M8 for linux-arm-kernel@lists.infradead.org; Tue, 12 May 2020 16:37:54 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id ED164106F; Tue, 12 May 2020 09:37:50 -0700 (PDT) Received: from e103592.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 40D3B3F305; Tue, 12 May 2020 09:37:50 -0700 (PDT) From: Dave Martin To: mtk.manpages@gmail.com Subject: [PATCH 06/14] prctl.2: ffix quotation mark tweaks Date: Tue, 12 May 2020 17:36:51 +0100 Message-Id: <1589301419-24459-7-git-send-email-Dave.Martin@arm.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1589301419-24459-1-git-send-email-Dave.Martin@arm.com> References: <1589301419-24459-1-git-send-email-Dave.Martin@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200512_093751_861331_6A53FBB0 X-CRM114-Status: GOOD ( 18.25 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [217.140.110.172 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-man@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Convert quote marks used for information terms in prose to use \(oq .. \(cq, for better graphical rendering. Signed-off-by: Dave Martin --- Note, this can lead to misrendering on badly-configured systems. However, many man pages do it. In the C locale (or with -Tascii) the quotes still render as ' . --- man2/prctl.2 | 71 ++++++++++++++++++++++++++++++------------------------------ 1 file changed, 36 insertions(+), 35 deletions(-) diff --git a/man2/prctl.2 b/man2/prctl.2 index 1611448..7a3fc5c 100644 --- a/man2/prctl.2 +++ b/man2/prctl.2 @@ -188,7 +188,7 @@ library in the form of If .I arg2 is nonzero, -set the "child subreaper" attribute of the calling process; +set the \(oqchild subreaper\(cq attribute of the calling process; if .I arg2 is zero, unset the attribute. @@ -210,7 +210,7 @@ signal and will be able to .BR wait (2) on the process to discover its termination status. .IP -The setting of the "child subreaper" attribute +The setting of the \(oqchild subreaper\(cq attribute is not inherited by children created by .BR fork (2) and @@ -231,13 +231,13 @@ employ a subreaper process for similar reasons. .\" prctl PR_GET_CHILD_SUBREAPER .TP .BR PR_GET_CHILD_SUBREAPER " (since Linux 3.4)" -Return the "child subreaper" setting of the caller, +Return the \(oqchild subreaper\(cq setting of the caller, in the location pointed to by .IR "(int\ *) arg2" . .\" prctl PR_SET_DUMPABLE .TP .BR PR_SET_DUMPABLE " (since Linux 2.3.20)" -Set the state of the "dumpable" attribute, +Set the state of the \(oqdumpable\(cq attribute, which determines whether core dumps are produced for the calling process upon delivery of a signal whose default behavior is to produce a core dump. .IP @@ -263,7 +263,7 @@ for security reasons, this feature has been removed. in .BR proc (5).) .IP -Normally, the "dumpable" attribue is set to 1. +Normally, the \(oqdumpable\(cq attribue is set to 1. However, it is reset to the current value contained in the file .IR /proc/sys/fs/\:suid_dumpable (which by default has the value 0), @@ -539,19 +539,19 @@ must be zero. .\" prctl PR_SET_KEEPCAPS .TP .BR PR_SET_KEEPCAPS " (since Linux 2.2.18)" -Set the state of the calling thread's "keep capabilities" flag. +Set the state of the calling thread's \(oqkeep capabilities\(cq flag. The effect of this flag is described in .BR capabilities (7). .I arg2 must be either 0 (clear the flag) or 1 (set the flag). -The "keep capabilities" value will be reset to 0 on subsequent calls to +The \(oqkeep capabilities\(cq value will be reset to 0 on subsequent calls to .BR execve (2). .\" prctl PR_GET_KEEPCAPS .TP .BR PR_GET_KEEPCAPS " (since Linux 2.2.18)" Return (as the function result) the current state of the calling thread's -"keep capabilities" flag. +\(oqkeep capabilities\(cq flag. See .BR capabilities (7) for a description of this flag. @@ -806,8 +806,8 @@ and a set of special instruction prefixes that tell the CPU on which instructions it should do bounds enforcement. There is a limited number of these registers and when there are more pointers than registers, -their contents must be "spilled" into a set of tables. -These tables are called "bounds tables" and the MPX +their contents must be \(oqspilled\(cq into a set of tables. +These tables are called \(oqbounds tables\(cq and the MPX .BR prctl () operations control whether the kernel manages their allocation and freeing. @@ -833,7 +833,8 @@ These calls fail if the CPU or kernel does not support MPX. Kernel support for MPX is enabled via the .BR CONFIG_X86_INTEL_MPX configuration option. -You can check whether the CPU supports MPX by looking for the 'mpx' +You can check whether the CPU supports MPX by looking for the +.I mpx CPUID bit, like with the following command: .IP .in +4n @@ -954,7 +955,7 @@ parent dies. .IP .IR Warning : .\" https://bugzilla.kernel.org/show_bug.cgi?id=43300 -the "parent" in this case is considered to be the +the \(oqparent\(cq in this case is considered to be the .I thread that created this process. In other words, the signal will be sent when that thread terminates @@ -1005,20 +1006,20 @@ in the location pointed to by .\" commit 2d514487faf188938a4ee4fb3464eeecfbdcf8eb .\" commit bf06189e4d14641c0148bea16e9dd24943862215 This is meaningful only when the Yama LSM is enabled and in mode 1 -("restricted ptrace", visible via +(\(oqrestricted ptrace\(cq, visible via .IR /proc/sys/kernel/yama/ptrace_scope ). -When a "ptracer process ID" is passed in \fIarg2\fP, +When a \(oqptracer process ID\(cq is passed in \fIarg2\fP, the caller is declaring that the ptracer process can .BR ptrace (2) the calling process as if it were a direct process ancestor. Each .B PR_SET_PTRACER -operation replaces the previous "ptracer process ID". +operation replaces the previous \(oqptracer process ID\(cq. Employing .B PR_SET_PTRACER with .I arg2 -set to 0 clears the caller's "ptracer process ID". +set to 0 clears the caller's \(oqptracer process ID\(cq. If .I arg2 is @@ -1139,7 +1140,7 @@ without the risk that the process is killed; see .\" prctl PR_SET_SECUREBITS .TP .BR PR_SET_SECUREBITS " (since Linux 2.6.26)" -Set the "securebits" flags of the calling thread to the value supplied in +Set the \(oqsecurebits\(cq flags of the calling thread to the value supplied in .IR arg2 . See .BR capabilities (7). @@ -1147,7 +1148,7 @@ See .TP .BR PR_GET_SECUREBITS " (since Linux 2.6.26)" Return (as the function result) -the "securebits" flags of the calling thread. +the \(oqsecurebits\(cq flags of the calling thread. See .BR capabilities (7). .\" prctl PR_GET_SPECULATION_CTRL @@ -1289,7 +1290,7 @@ in Linux 2.6.32. .TP .BR PR_SET_THP_DISABLE " (since Linux 3.15)" .\" commit a0715cc22601e8830ace98366c0c2bd8da52af52 -Set the state of the "THP disable" flag for the calling thread. +Set the state of the \(oqTHP disable\(cq flag for the calling thread. If .I arg2 has a nonzero value, the flag is set, otherwise it is cleared. @@ -1298,14 +1299,14 @@ for disabling transparent huge pages for jobs where the code cannot be modified, and using a malloc hook with .BR madvise (2) is not an option (i.e., statically allocated data). -The setting of the "THP disable" flag is inherited by a child created via +The setting of the \(oqTHP disable\(cq flag is inherited by a child created via .BR fork (2) and is preserved across .BR execve (2). .\" prctl PR_GET_THP_DISABLE .TP .BR PR_GET_THP_DISABLE " (since Linux 3.15)" -Return (as the function result) the current setting of the "THP disable" +Return (as the function result) the current setting of the \(oqTHP disable\(cq flag for the calling thread: either 1, if the flag is set, or 0, if it is not. .\" prctl PR_GET_TID_ADDRESS @@ -1336,21 +1337,21 @@ this operation expects a user-space buffer of 8 (not 4) bytes on these ABIs. .\" See https://lwn.net/Articles/369549/ .\" commit 6976675d94042fbd446231d1bd8b7de71a980ada Each thread has two associated timer slack values: -a "default" value, and a "current" value. -This operation sets the "current" timer slack value for the calling thread. +a \(oqdefault\(cq value, and a \(oqcurrent\(cq value. +This operation sets the \(oqcurrent\(cq timer slack value for the calling thread. .I arg2 -is an unsigned long value, then maximum "current" value is ULONG_MAX and -the minimum "current" value is 1. +is an unsigned long value, then maximum \(oqcurrent\(cq value is ULONG_MAX and +the minimum \(oqcurrent\(cq value is 1. If the nanosecond value supplied in .IR arg2 -is greater than zero, then the "current" value is set to this value. +is greater than zero, then the \(oqcurrent\(cq value is set to this value. If .I arg2 is equal to zero, -the "current" timer slack is reset to the -thread's "default" timer slack value. +the \(oqcurrent\(cq timer slack is reset to the +thread's \(oqdefault\(cq timer slack value. .IP -The "current" timer slack is used by the kernel to group timer expirations +The \(oqcurrent\(cq timer slack is used by the kernel to group timer expirations for the calling thread that are close to one another; as a consequence, timer expirations for the thread may be up to the specified number of nanoseconds late (but will never expire early). @@ -1382,11 +1383,11 @@ a real-time scheduling policy (see .BR sched_setscheduler (2)). .IP When a new thread is created, -the two timer slack values are made the same as the "current" value +the two timer slack values are made the same as the \(oqcurrent\(cq value of the creating thread. -Thereafter, a thread can adjust its "current" timer slack value via +Thereafter, a thread can adjust its \(oqcurrent\(cq timer slack value via .BR PR_SET_TIMERSLACK . -The "default" value can't be changed. +The \(oqdefault\(cq value can't be changed. The timer slack values of .IR init (PID 1), the ancestor of all processes, @@ -1396,7 +1397,7 @@ The timer slack value is inherited by a child created via and is preserved across .BR execve (2). .IP -Since Linux 4.6, the "current" timer slack value of any process +Since Linux 4.6, the \(oqcurrent\(cq timer slack value of any process can be examined and changed via the file .IR /proc/[pid]/timerslack_ns . See @@ -1405,7 +1406,7 @@ See .TP .BR PR_GET_TIMERSLACK " (since Linux 2.6.28)" Return (as the function result) -the "current" timer slack value of the calling thread. +the \(oqcurrent\(cq timer slack value of the calling thread. .\" prctl PR_SET_TIMING .TP .BR PR_SET_TIMING " (since Linux 2.6.0)" @@ -1817,7 +1818,7 @@ is and the caller does not have the .B CAP_SETPCAP capability, -or tried to unset a "locked" flag, +or tried to unset a \(oqlocked\(cq flag, or tried to set a flag whose corresponding locked flag was set (see .BR capabilities (7)). From patchwork Tue May 12 16:36:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Martin X-Patchwork-Id: 11543523 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3622D139A for ; Tue, 12 May 2020 16:39:49 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F084E20714 for ; Tue, 12 May 2020 16:39:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ig6dbd20" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F084E20714 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=bfPwrWJSMrcCt6Row6eTot7WLoX1IjC1El/eJOeudZM=; b=ig6dbd20Uyjd+Lpz3spP4Kj7dK 337rOK5thDY2h+SjvcoTNrzDPiCKmBoBZzQh2fmBg9OTwNRc1IWJyERn2PO7B08PlA78/uavPckaN zwJIGCa7WfQ85UVgIpjx64LcppQgrvaXWEHr1K2ThboyNzek4c+MqE23+7aqBwlDY7lUsmcdGrH9f B+JDTdektXp69vrD5xySnpuwldeNTQVtQokFp/wIDr3U8zPXVjTrsp+OrRd7UpTvZuls/XPXcGgTC DAD+OroVnnV3lZ2DH/O4BH+Z23P6M6w0nIdt+gxx8bOeb1e/12WkNV80MS6XbUlb9/Dt9lL8W1svy KhnEznzg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jYXwU-00019r-A0; Tue, 12 May 2020 16:39:42 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jYXui-0007v0-U3 for linux-arm-kernel@lists.infradead.org; Tue, 12 May 2020 16:37:55 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1CA6711D4; Tue, 12 May 2020 09:37:52 -0700 (PDT) Received: from e103592.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 2E5883F305; Tue, 12 May 2020 09:37:51 -0700 (PDT) From: Dave Martin To: mtk.manpages@gmail.com Subject: [PATCH 07/14] prctl.2: Document removal of Intel MPX prctls Date: Tue, 12 May 2020 17:36:52 +0100 Message-Id: <1589301419-24459-8-git-send-email-Dave.Martin@arm.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1589301419-24459-1-git-send-email-Dave.Martin@arm.com> References: <1589301419-24459-1-git-send-email-Dave.Martin@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200512_093753_048906_2242E690 X-CRM114-Status: UNSURE ( 9.26 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [217.140.110.172 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-man@vger.kernel.org, Thomas Gleixner , Dave Hansen , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org The Intel MPX API was removed from Linux 5.4. See Linux commit f240652b6032 ("x86/mpx: Remove MPX APIs") Document this change. Signed-off-by: Dave Martin Cc: Dave Hansen Cc: Thomas Gleixner Acked-by: Dave Hansen --- man2/prctl.2 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/man2/prctl.2 b/man2/prctl.2 index 7a3fc5c..a84fb1d 100644 --- a/man2/prctl.2 +++ b/man2/prctl.2 @@ -784,7 +784,7 @@ option enabled. .RE .\" prctl PR_MPX_ENABLE_MANAGEMENT .TP -.BR PR_MPX_ENABLE_MANAGEMENT ", " PR_MPX_DISABLE_MANAGEMENT " (since Linux 3.19) " +.BR PR_MPX_ENABLE_MANAGEMENT ", " PR_MPX_DISABLE_MANAGEMENT " (since Linux 3.19, removed in Linux 5.4; only on x86) " .\" commit fe3d197f84319d3bce379a9c0dc17b1f48ad358c .\" See also http://lwn.net/Articles/582712/ .\" See also https://gcc.gnu.org/wiki/Intel%20MPX%20support%20in%20the%20GCC%20compiler @@ -859,6 +859,12 @@ had been called. .IP For further information on Intel MPX, see the kernel source file .IR Documentation/x86/intel_mpx.txt . +.IP +.\" commit f240652b6032b48ad7fa35c5e701cc4c8d697c0b +.\" See also https://lkml.kernel.org/r/20190705175321.DB42F0AD@viggo.jf.intel.com +Due to a lack of toolchain support, +.BR PR_MPX_ENABLE_MANAGEMENT " and " PR_MPX_DISABLE_MANAGEMENT +are not supported by Linux 5.4 or later. .\" prctl PR_SET_NAME .TP .BR PR_SET_NAME " (since Linux 2.6.9)" From patchwork Tue May 12 16:36:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Martin X-Patchwork-Id: 11543519 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A0605159A for ; Tue, 12 May 2020 16:39:18 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7E86B206CC for ; Tue, 12 May 2020 16:39:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="LxdxfH/6" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7E86B206CC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=GUVNE8tVxv9GqdcCkL0YGXu+lmpWMj9FhEFeO35Izp0=; b=LxdxfH/653LCzGKG7KZ7evFZct 2Opw86eKi+YU9Ma2ciF5JPLLkgt7EAJHFBDWErMsOzA2xufQoY9SOiVZQnvLVY9LsBZ+zAG3SEfG/ WSRjcRrDLHpY9lPUik8Jr/hO2CIcVyVoFHLqwaGlLgIV90BRLclwV7o2N+jwcvn3jti4jb+Kysf2+ VN9so1qV9lBkzsm3jrcwSMh7ednsbyhmx4cQgpLO2cQdqMxmTyrT63/whPtP+XmUy0nxUl2Ixlqj3 g60Tkn1S7XoGPOeoVU/4TjrdSkIL1FZIrfvuLcHQEzUyyq2Oap12JDgCJCV3xbwOh/k3sj5NFvuK5 rw36uxIg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jYXvy-0000hR-9U; Tue, 12 May 2020 16:39:10 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jYXuj-0007ve-RL for linux-arm-kernel@lists.infradead.org; Tue, 12 May 2020 16:37:55 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0A1F212FC; Tue, 12 May 2020 09:37:53 -0700 (PDT) Received: from e103592.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 50A783F305; Tue, 12 May 2020 09:37:52 -0700 (PDT) From: Dave Martin To: mtk.manpages@gmail.com Subject: [PATCH 08/14] prctl.2: Work around bogus constant "maxsig" in PR_SET_PDEATHSIG Date: Tue, 12 May 2020 17:36:53 +0100 Message-Id: <1589301419-24459-9-git-send-email-Dave.Martin@arm.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1589301419-24459-1-git-send-email-Dave.Martin@arm.com> References: <1589301419-24459-1-git-send-email-Dave.Martin@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200512_093753_968198_284B214E X-CRM114-Status: UNSURE ( 9.57 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [217.140.110.172 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-man@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org The description of PR_SET_PDEATHSIG refers to "maxsig", which is apparently intended to stand for the maximum defined signal number. maxsig seems not to be a thing, even in the kernel. Reword to use the standard constant NSIG. (Discussion of SIGRTMIN and SIGRTMAX seems out of scope here, and anyway is not relevant to the kernel.) Signed-off-by: Dave Martin --- man2/prctl.2 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/man2/prctl.2 b/man2/prctl.2 index a84fb1d..1e04859 100644 --- a/man2/prctl.2 +++ b/man2/prctl.2 @@ -955,7 +955,9 @@ will operate in the privilege-restricting mode described above. .BR PR_SET_PDEATHSIG " (since Linux 2.1.57)" Set the parent-death signal of the calling process to \fIarg2\fP (either a signal value -in the range 1..maxsig, or 0 to clear). +in the range 1 .. +.BR NSIG " \-" +1, or 0 to clear). This is the signal that the calling process will get when its parent dies. .IP From patchwork Tue May 12 16:36:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Martin X-Patchwork-Id: 11543521 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 654DC139A for ; Tue, 12 May 2020 16:39:29 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2181B206CC for ; Tue, 12 May 2020 16:39:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="n/l5yZ3D" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2181B206CC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=2fj6Oy6wRyC4CjwLE6aolQPIguameBsGUZ0jXyTJEgk=; b=n/l5yZ3DdwXTEXDNR0qg4+QnwU xzPhuLxC9OICeagDkL4YFOz3ZMlKPeoUn7r5l7JFAC5NWr1NVkt8rMFfrC3otI0D4pdKd9NS9lhcB EqAQogY3lpC4ITylAhwd/1NutstTNKPH8xfnjgZkZRMWt9M4licSjR1zh5TYMfjn4OKdSXUwoMzNb GHY741VQgV6Rec5YhxmjCikgg/EMk7LL2yjxB+N3w1wxp3vphw6J1vgN/nIcmBZnfgsRM3BXzW9Ei mlWSfqtZ7gSeJfsJQsutYOhX93TB8cczaJzxYJPN+H6bm6KPOLsT07eZM71Munsjro/ZhpUzmlPjA GkbwctwQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jYXwC-0000ur-JB; Tue, 12 May 2020 16:39:24 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jYXuk-0007si-K5 for linux-arm-kernel@lists.infradead.org; Tue, 12 May 2020 16:37:56 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id EA6B7D6E; Tue, 12 May 2020 09:37:53 -0700 (PDT) Received: from e103592.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 3D0983F305; Tue, 12 May 2020 09:37:53 -0700 (PDT) From: Dave Martin To: mtk.manpages@gmail.com Subject: [PATCH 09/14] prctl.2: tfix minor punctuation in SPECULATION_CTRL prctls Date: Tue, 12 May 2020 17:36:54 +0100 Message-Id: <1589301419-24459-10-git-send-email-Dave.Martin@arm.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1589301419-24459-1-git-send-email-Dave.Martin@arm.com> References: <1589301419-24459-1-git-send-email-Dave.Martin@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200512_093754_718092_32B78256 X-CRM114-Status: UNSURE ( 8.07 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [217.140.110.172 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-man@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Fix a few very minor bits of punctuation in PR_SET_SPECULATION_CTRL and PR_GET_SPECULATION_CTRL. Signed-off-by: Dave Martin --- man2/prctl.2 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/man2/prctl.2 b/man2/prctl.2 index 1e04859..e8eaf95 100644 --- a/man2/prctl.2 +++ b/man2/prctl.2 @@ -1175,13 +1175,13 @@ The return value uses bits 0-3 with the following meaning: .TP .BR PR_SPEC_PRCTL Mitigation can be controlled per thread by -.B PR_SET_SPECULATION_CTRL +.BR PR_SET_SPECULATION_CTRL . .TP .BR PR_SPEC_ENABLE The speculation feature is enabled, mitigation is disabled. .TP .BR PR_SPEC_DISABLE -The speculation feature is disabled, mitigation is enabled +The speculation feature is disabled, mitigation is enabled. .TP .BR PR_SPEC_FORCE_DISABLE Same as @@ -1228,11 +1228,11 @@ which is one of the following: The speculation feature is enabled, mitigation is disabled. .TP .BR PR_SPEC_DISABLE -The speculation feature is disabled, mitigation is enabled +The speculation feature is disabled, mitigation is enabled. .TP .BR PR_SPEC_FORCE_DISABLE Same as -.B PR_SPEC_DISABLE +.BR PR_SPEC_DISABLE , but cannot be undone. A subsequent .B From patchwork Tue May 12 16:36:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Martin X-Patchwork-Id: 11543525 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1A6F9139A for ; Tue, 12 May 2020 16:40:07 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E34F520730 for ; Tue, 12 May 2020 16:40:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="spq8F2CP" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E34F520730 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=w7/lcUL3WXaCHXBfcWOQYY6Oixu1FQvQlj/H0NuiBiE=; b=spq8F2CPewvpb/QsT+HQXKRQ4Y LikyvAmVLPkTUS1h8OlLXh9kaO4llXNsDs5wq264xQKRUdaIn7TgQ71fXprvhd/mwIr+ro9PdSY79 Rg8ZwqrBj61T2EboP1wSZaAh9xoy14yTDjOK5/IXD7tNT9aqnPYijyL7KOMp/u70PUIeRjK8Wy6nF 3qG88VfgXzyyAu4hkL15ek1Gep4XEoa6aE0kU7StzZmhpsSrSIVwHRAksDMTEN/lKnpnEtnAknC2u 74/G+u7l8TU69YNjucCtCwyL0BU57EItIpI2tD38rp4oNwBCpyc34H7zH5/Dxa8XKA8uXkP5O8vkA sLn7LWyQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jYXwn-0001OF-8Y; Tue, 12 May 2020 16:40:01 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jYXum-0007yG-09 for linux-arm-kernel@lists.infradead.org; Tue, 12 May 2020 16:37:58 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 19354106F; Tue, 12 May 2020 09:37:55 -0700 (PDT) Received: from e103592.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 2A0F23F305; Tue, 12 May 2020 09:37:54 -0700 (PDT) From: Dave Martin To: mtk.manpages@gmail.com Subject: [PATCH 10/14] prctl.2: Add PR_SPEC_INDIRECT_BRANCH for SPECULATION_CTRL prctls Date: Tue, 12 May 2020 17:36:55 +0100 Message-Id: <1589301419-24459-11-git-send-email-Dave.Martin@arm.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1589301419-24459-1-git-send-email-Dave.Martin@arm.com> References: <1589301419-24459-1-git-send-email-Dave.Martin@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200512_093756_154998_14D132D7 X-CRM114-Status: UNSURE ( 9.54 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [217.140.110.172 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-man@vger.kernel.org, Thomas Gleixner , Tim Chen , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Add the PR_SPEC_INDIRECT_BRANCH "misfeature" added in Linux 4.20 for PR_SET_SPECULATION_CTRL and PR_GET_SPECULATION_CTRL. Signed-off-by: Dave Martin Cc: Tim Chen Cc: Thomas Gleixner --- man2/prctl.2 | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/man2/prctl.2 b/man2/prctl.2 index e8eaf95..66417cf 100644 --- a/man2/prctl.2 +++ b/man2/prctl.2 @@ -1213,11 +1213,20 @@ arguments must be specified as 0; otherwise the call fails with the error .\" commit 356e4bfff2c5489e016fdb925adbf12a1e3950ee Sets the state of the speculation misfeature specified in .IR arg2 . -Currently, the only permitted value for this argument is +Currently, this argument must be one of: +.RS +.TP .B PR_SPEC_STORE_BYPASS -(otherwise the call fails with the error +speculative store bypass control, or +.\" commit 9137bb27e60e554dab694eafa4cca241fa3a694f +.TP +.BR PR_SPEC_INDIRECT_BRANCH " (since Linux 4.20)" +indirect branch speculation control. +.RE +.IP +(Otherwise the call fails with the error .BR ENODEV ). -This setting is a per-thread attribute. +These settings are per-thread attributes. The .IR arg3 argument is used to hand in the control value, @@ -1235,13 +1244,16 @@ Same as .BR PR_SPEC_DISABLE , but cannot be undone. A subsequent -.B -prctl(..., PR_SPEC_ENABLE) +.BR prctl (\c +.IR arg2 , +.BR PR_SPEC_ENABLE ) +with the same value for +.I arg2 will fail with the error .BR EPERM . .RE .IP -Any other value in +Any unsupported value in .IR arg3 will result in the call failing with the error .BR ERANGE . From patchwork Tue May 12 16:36:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Martin X-Patchwork-Id: 11543533 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A464E139A for ; Tue, 12 May 2020 16:40:33 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7B0B3206CC for ; Tue, 12 May 2020 16:40:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="BjG1Pc/M" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7B0B3206CC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=5Np5J8SjXtiFX1zgCSY6dHtLJCA62oXNZjTcCJOWubc=; b=BjG1Pc/MdhV1GPGjfe5Eu5WxB1 tRKQmfU1vDOcnB57xfLcBoUlHDm+ffxgbLDhaAAi2Qogjwws4BdQrKrCs65hs7LvV5wFNvfAEwlaB rEaS0QViQrIOR/GuP6B8gmNwdmcHX8u7J++ybgnD4KeSeSoapmC/J1NGVoMTk4luq6Cxq1ruuqlqt 1vJ7w4HvSpBaRVy+VUZLkq9/FUUIY+hUmHSVZiugC9/fnC66paM6K4RiGwgaeUNIly2lSMANs2Hgi IByYas8Y9MLluZbQ8ntYgtN0NKulHibwWpLFllQQnTRmg+Q6XMJ3LKiOXu9xL8i/7+qgOeWFbh0s7 kmhYXqbg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jYXxB-0001jL-OW; Tue, 12 May 2020 16:40:25 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jYXum-0007ve-Ba for linux-arm-kernel@lists.infradead.org; Tue, 12 May 2020 16:37:58 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3A648D6E; Tue, 12 May 2020 09:37:56 -0700 (PDT) Received: from e103592.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 4D2873F305; Tue, 12 May 2020 09:37:55 -0700 (PDT) From: Dave Martin To: mtk.manpages@gmail.com Subject: [PATCH 11/14] prctl.2: Add PR_SPEC_DISABLE_NOEXEC for SPECULATION_CTRL prctls Date: Tue, 12 May 2020 17:36:56 +0100 Message-Id: <1589301419-24459-12-git-send-email-Dave.Martin@arm.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1589301419-24459-1-git-send-email-Dave.Martin@arm.com> References: <1589301419-24459-1-git-send-email-Dave.Martin@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200512_093756_456071_87641F83 X-CRM114-Status: UNSURE ( 9.36 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [217.140.110.172 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-man@vger.kernel.org, Thomas Gleixner , linux-arm-kernel@lists.infradead.org, Waiman Long MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Add the PR_SPEC_DISABLE_NOEXEC mode added in Linux 5.1 for the PR_SPEC_STORE_BYPASS "misfeature" of PR_SET_SPECULATION_CTRL and PR_GET_SPECULATION_CTRL. Signed-off-by: Dave Martin Cc: Waiman Long Cc: Thomas Gleixner --- man2/prctl.2 | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/man2/prctl.2 b/man2/prctl.2 index 66417cf..2361b44 100644 --- a/man2/prctl.2 +++ b/man2/prctl.2 @@ -1187,6 +1187,12 @@ The speculation feature is disabled, mitigation is enabled. Same as .B PR_SPEC_DISABLE but cannot be undone. +.TP +.BR PR_SPEC_DISABLE_NOEXEC " (since Linux 5.1)" +Same as +.BR PR_SPEC_DISABLE , +but but the state will be cleared on +.BR execve (2). .RE .IP If all bits are 0, @@ -1251,6 +1257,17 @@ with the same value for .I arg2 will fail with the error .BR EPERM . +.\" commit 71368af9027f18fe5d1c6f372cfdff7e4bde8b48 +.TP +.BR PR_SPEC_DISABLE_NOEXEC " (since Linux 5.1)" +Same as +.BR PR_SPEC_DISABLE , +but but the state will be cleared on +.BR execve (2). +Currently only supported for +.I arg2 +equal to +.B PR_SPEC_STORE_BYPASS. .RE .IP Any unsupported value in @@ -1898,11 +1915,12 @@ was .BR PR_SET_SPECULATION_CTRL and .IR arg3 -is neither +is not .BR PR_SPEC_ENABLE , .BR PR_SPEC_DISABLE , +.BR PR_SPEC_FORCE_DISABLE , nor -.BR PR_SPEC_FORCE_DISABLE . +.BR PR_SPEC_DISABLE_NOEXEC . .SH VERSIONS The .BR prctl () From patchwork Tue May 12 16:36:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Martin X-Patchwork-Id: 11543539 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 02D58139A for ; Tue, 12 May 2020 16:41:22 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D414C206CC for ; Tue, 12 May 2020 16:41:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ZcY4E0MX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D414C206CC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=91cuUI9bPidSPvVcaDTi2wpEz12UlTMisjRDCeYso74=; b=ZcY4E0MXHmyoe+7G9YWoC/nZTH zoh99vH/9LqaaMSAqycN5sHNc9EOoKxEJOluNRE1j+6FiPGuZuq3JlOSL3Mq/VrCATSlgqbDFlvoP xO1vY5ToRQw6+GaDd8xKzTPlxZZIgTfbzPuGTHA5fwwvgTrenq6WuxaXA+0mK81mqmrQ79jgfYY71 /hblqbwU8bdwBkGXXD4+Z6dx+9HUvK5QbixFX8Oj5v3BmI5Nf7jDWqF7bMegGHS7VwzKXDJVfvM1F TnPz0hLhL42HJSI3pEgwAubtusTb78Biwl4+5U2D11Y675zXPUEmmf5QL/WYnAl8sl8ayoCzIOG6l 2Z91ToKQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jYXxx-0004eM-5A; Tue, 12 May 2020 16:41:13 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jYXun-0007si-Db for linux-arm-kernel@lists.infradead.org; Tue, 12 May 2020 16:37:59 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 26EE011B3; Tue, 12 May 2020 09:37:57 -0700 (PDT) Received: from e103592.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 6EDD23F305; Tue, 12 May 2020 09:37:56 -0700 (PDT) From: Dave Martin To: mtk.manpages@gmail.com Subject: [PATCH 12/14] prctl.2: Clarify the unsupported hardware case of EINVAL Date: Tue, 12 May 2020 17:36:57 +0100 Message-Id: <1589301419-24459-13-git-send-email-Dave.Martin@arm.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1589301419-24459-1-git-send-email-Dave.Martin@arm.com> References: <1589301419-24459-1-git-send-email-Dave.Martin@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200512_093757_542189_45BB05E2 X-CRM114-Status: GOOD ( 10.36 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [217.140.110.172 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-man@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org prctls that are architecture-specific won't work on other architectures, and arch-specific prctls that manipulate optional hardware features likewise won't work if that hardware feature is not present. The established pattern seems to be to treat such prctls as if they are unimplemented, when attempted on the wrong hardware. Cover these cases with some generic weasel words in the closet existing EINVAL clause. Signed-off-by: Dave Martin --- man2/prctl.2 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/man2/prctl.2 b/man2/prctl.2 index 2361b44..7f511d2 100644 --- a/man2/prctl.2 +++ b/man2/prctl.2 @@ -1616,7 +1616,8 @@ is an invalid address. .B EINVAL The value of .I option -is not recognized. +is not recognized, +or not supported on this system. .TP .B EINVAL .I option From patchwork Tue May 12 16:36:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Martin X-Patchwork-Id: 11543543 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 400D5159A for ; Tue, 12 May 2020 16:41:52 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0F3E720714 for ; Tue, 12 May 2020 16:41:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="BIHLAS5q" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0F3E720714 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=j2FfRnouzhZgjkr7lsjETfIIQ4Rjad3TD2q4Hd77OKQ=; b=BIHLAS5q+9XfX5YKCbbmPvfbQx msI2U9Ejgh81l7erRSg94x9v1R8HnsM9GIPQeJyAH4JTKIKxvOmUnGYxiRW+QQmRhNmqak54Hwj4v 96NW/6E7/BozrqhmcqoEbOQssgrhReuzi+B4gXQzW5u9bMI1+OSBzGbgcit+axsDZrlhV2tk8WyEm YGDwDr94EjKO5+tDcXitrp8EeyRcFltBWcHCWvznYS0kKpRJDe3FHNZcEQ4gZVkAYjsIoNByXCAae NUSfJuyQoMZk9a9qxCc/lXJfx/Dx0EYdNKNQwGjeVKK9zJj6xJ/OwZ3vM7ZAhRoT9c0FTQgZhrKko 4ifH3SGQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jYXyZ-000589-4p; Tue, 12 May 2020 16:41:51 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jYXuo-0007yG-Ly for linux-arm-kernel@lists.infradead.org; Tue, 12 May 2020 16:38:00 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 25D1012FC; Tue, 12 May 2020 09:37:58 -0700 (PDT) Received: from e103592.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 5BFC83F305; Tue, 12 May 2020 09:37:57 -0700 (PDT) From: Dave Martin To: mtk.manpages@gmail.com Subject: [PATCH 13/14] prctl.2: Add SVE prctls (arm64) Date: Tue, 12 May 2020 17:36:58 +0100 Message-Id: <1589301419-24459-14-git-send-email-Dave.Martin@arm.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1589301419-24459-1-git-send-email-Dave.Martin@arm.com> References: <1589301419-24459-1-git-send-email-Dave.Martin@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200512_093758_865485_A9952B94 X-CRM114-Status: GOOD ( 13.91 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [217.140.110.172 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-man@vger.kernel.org, Will Deacon , linux-arm-kernel@lists.infradead.org, Catalin Marinas MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Add documentation for the the PR_SVE_SET_VL and PR_SVE_GET_VL prctls added in Linux 4.15 for arm64. Signed-off-by: Dave Martin Cc: Catalin Marinas Cc: Will Deacon --- I wrote the SVE support originally, so I probably have this one halfway right. The explantion added is not exhaustive, but I didn't want it to be too verbose. I may trim it a bit and move the detail to a dedicated page later on, but this is better than nothing in the meantime. --- man2/prctl.2 | 112 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 112 insertions(+) diff --git a/man2/prctl.2 b/man2/prctl.2 index 7f511d2..dd16227 100644 --- a/man2/prctl.2 +++ b/man2/prctl.2 @@ -1291,6 +1291,104 @@ call failing with the error .BR ENXIO . For further details, see the kernel source file .IR Documentation/admin-guide/kernel-parameters.txt . +.\" prctl PR_SVE_SET_VL +.\" commit 2d2123bc7c7f843aa9db87720de159a049839862 +.\" linux-5.6/Documentation/arm64/sve.rst +.TP +.BR PR_SVE_SET_VL " (since Linux 4.15, only on arm64)" +Configure the thread's SVE vector length, +as specified by +.IR arg2 . +Arguments +.IR arg3 ", " arg4 " and " arg5 +are ignored. +.IP +The bits of +.I arg2 +corresponding to +.B SVE_VL_LEN_MASK +must be set to the desired vector length in bytes. +In addition, +.I arg2 +may include zero or more of the following flags: +.RS +.TP +.B PR_SVE_VL_INHERIT +Inherit the configured vector length across +.BR execve (2). +.TP +.B PR_SVE_SET_VL_ONEXEC +Defer the change until the next +.BR execve (2) +in this thread. +If +.B PR_SVE_VL_INHERIT +is also included in +.IR arg2 , +it takes effect +.I after +this deferred change. +.RE +.IP +On success, the vector length and flags are set as requested, +and any deferred change that was pending immediately before the +.B PR_SVE_SET_VL +call is canceled. +If +.B PR_SVE_SET_VL_ONEXEC +was included in +.IR arg2 , +the returned value describes the configuration +scheduled to take effect at the next +.BR execve (2). +Otherwise, the effect is immediate and +the returned value describes the new configuration. +The returned value is encoded in the same way as the return value of +.BR PR_SVE_GET_VL . +.IP +If neither of the above flags is included in +.IR arg2 , +a subsequent +.BR execve (2) +resets the vector length to the default value configured in +.IR /proc/sys/abi/sve_default_vector_length . +.IP +The actual vector length configured by this operation +is the greatest vector length supported by the platform +that does not exceed +.I arg2 +& +.BR PR_SVE_VL_LEN_MASK . +.IP +The configuration (including any pending deferred change) +is inherited across +.BR fork (2) +and +.BR clone (2). +.\" prctl PR_SVE_GET_VL +.TP +.BR PR_SVE_GET_VL " (since Linux 4.15, only on arm64)" +Get the thread's current SVE vector length configuration, +as configured by +.BR PR_SVE_SET_VL . +.IP +If successful, the return value describes the +.I current +configuration. +The bits corresponding to +.B PR_SVE_VL_LEN_MASK +contain the currently configured vector length in bytes. +The bit corresponding to +.B PR_SVE_VL_INHERIT +indicates whether the vector length will be inherited +across +.BR execve (2). +.IP +Note that there is no way determine whether there is +a pending vector length change that has not yet taken effect. +.IP +Providing that the kernel and platform support SVE, +this operation always succeeds. .\" .\" prctl PR_TASK_PERF_EVENTS_DISABLE .TP @@ -1534,6 +1632,8 @@ On success, .BR PR_GET_NO_NEW_PRIVS , .BR PR_GET_SECUREBITS , .BR PR_GET_SPECULATION_CTRL , +.BR PR_SVE_GET_VL , +.BR PR_SVE_SET_VL , .BR PR_GET_THP_DISABLE , .BR PR_GET_TIMING , .BR PR_GET_TIMERSLACK , @@ -1817,6 +1917,18 @@ and unused arguments to .BR prctl () are not 0. .TP +.B EINVAL +.I option +was +.B PR_SVE_SET_VL +and +.I arg2 +contains invalid flags, or +.I arg2 +& +.B SVE_VL_LEN_MASK +is not a valid vector length. +.TP .B ENODEV .I option was From patchwork Tue May 12 16:36:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Martin X-Patchwork-Id: 11543541 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E12F2139A for ; Tue, 12 May 2020 16:41:34 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6DFB2206CC for ; Tue, 12 May 2020 16:41:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="il4tSYNq" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6DFB2206CC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=cVpjY+ULRz5Wi01tzv1YPhIx331/o6XfvHGKP3KznCI=; b=il4tSYNq6KiswKi40jeihixaCw r+k8ryfYOWbdqAsKP/hl2z5C3DTzyOSNuAUnDWLCbVRb2YbcHrD8EfyW0v8NX3i5d0qnP9zYHUbjG Dsl7pPDHWSFup+vwP5bMZULZMNBPV/fgxg+th138pJLHZ1eP6OZm4/wdvfvI0OwlocSL1o6HWS4Lj zE2CaAjfLvX03GOD5hAVE+JjoguccJXKiSdkrXnkmUYqIktD/bV8rUkC3YXhJqpxyko0FtcgpwZld i3IJ0LMD5SyyzPIM7/bxmcNsucb45PKyId9LQ6Gd4s1e1MAHkRG9PBwjM1q1kfHCI3LGaDhcTL+o3 DN5yxadw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jYXyF-0004t6-O7; Tue, 12 May 2020 16:41:31 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jYXup-0007ve-Fo for linux-arm-kernel@lists.infradead.org; Tue, 12 May 2020 16:38:01 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5C23D1FB; Tue, 12 May 2020 09:37:59 -0700 (PDT) Received: from e103592.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 5B7423F305; Tue, 12 May 2020 09:37:58 -0700 (PDT) From: Dave Martin To: mtk.manpages@gmail.com Subject: [PATCH 14/14] prctl.2: Add PR_PAC_RESET_KEYS (arm64) Date: Tue, 12 May 2020 17:36:59 +0100 Message-Id: <1589301419-24459-15-git-send-email-Dave.Martin@arm.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1589301419-24459-1-git-send-email-Dave.Martin@arm.com> References: <1589301419-24459-1-git-send-email-Dave.Martin@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200512_093759_581231_8EB672C2 X-CRM114-Status: GOOD ( 10.56 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [217.140.110.172 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-man@vger.kernel.org, Catalin Marinas , Amit Daniel Kachhap , Mark Rutland , Will Deacon , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Add documentation for the PR_PAC_RESET_KEYS ioctl added in Linux 5.0 for arm64. Signed-off-by: Dave Martin Cc: Will Deacon Cc: Catalin Marinas Cc: Amit Daniel Kachhap Cc: Mark Rutland --- Note that the comment about PR_PAC_RESET_KEYS(0) being the recommended way to set up a fresh execution context is not present in the existing kernel documentation. I vaguely remember some discussion to this effect; in any case, it seems sensible, given that there must have been _some_ rationale for this feature... Shout if it sounds wrong! --- man2/prctl.2 | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/man2/prctl.2 b/man2/prctl.2 index dd16227..7ea60e2 100644 --- a/man2/prctl.2 +++ b/man2/prctl.2 @@ -950,6 +950,46 @@ behavior. A value of 1 indicates .BR execve (2) will operate in the privilege-restricting mode described above. +.\" prctl PR_PAC_RESET_KEYS +.\" commit ba830885656414101b2f8ca88786524d4bb5e8c1 +.TP +.BR PR_PAC_RESET_KEYS " (since Linux 5.0, only on arm64)" +Securely reset the thread's pointer authentication keys +to fresh random values generated by the kernel. +.IP +The set of keys to be reset is specified by +.IR arg2 , +which must be a logical OR of zero or more of the following: +.RS +.TP +.B PR_PAC_APIAKEY +instruction authentication key A +.TP +.B PR_PAC_APIBKEY +instruction authentication key B +.TP +.B PR_PAC_APDAKEY +data authentication key A +.TP +.B PR_PAC_APDBKEY +data authentication key B +.TP +.B PR_PAC_APGAKEY +generic authentication \(lqA\(rq key. +.IP +(Yes folks, there really is no generic B key.) +.RE +.IP +As a special case, if +.I arg2 +is zero then all the keys are reset. +Since new keys could be added in future, +this is the recommended way to completely wipe the existing keys +when creating a new execution context. +.IP +The remaining arguments +.IR arg3 ", " arg4 " and " arg5 +must all be zero. .\" prctl PR_SET_PDEATHSIG .TP .BR PR_SET_PDEATHSIG " (since Linux 2.1.57)" @@ -1920,6 +1960,27 @@ are not 0. .B EINVAL .I option was +.B PR_PAC_RESET_KEYS +and +.I arg2 +contains non-zero bits other than +.BR +.BR PR_PAC_APIAKEY , +.BR PR_PAC_APIBKEY , +.BR PR_PAC_APDAKEY , +.B PR_PAC_APDBKEY +and +.BR PR_PAC_APGAKEY ; +or +.IR arg3 , +.I arg4 +and +.I arg5 +were not all zero. +.TP +.B EINVAL +.I option +was .B PR_SVE_SET_VL and .I arg2