From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C1424CD6107 for ; Mon, 9 Oct 2023 16:34:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376996AbjJIQej (ORCPT ); Mon, 9 Oct 2023 12:34:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376275AbjJIQei (ORCPT ); Mon, 9 Oct 2023 12:34:38 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D2099E for ; Mon, 9 Oct 2023 09:34:37 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4A4E5C433C8; Mon, 9 Oct 2023 16:34:35 +0000 (UTC) Date: Mon, 9 Oct 2023 17:34:32 +0100 From: Catalin Marinas To: Florent Revest Cc: alx@kernel.org, linux-man@vger.kernel.org, joey.gouly@arm.com, akpm@linux-foundation.org, keescook@chromium.org Subject: Re: [PATCH] prctl.2: Document PR_SET_MDWE and PR_GET_MDWE Message-ID: References: <20231003155010.3651349-1-revest@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231003155010.3651349-1-revest@chromium.org> Precedence: bulk List-ID: X-Mailing-List: linux-man@vger.kernel.org On Tue, Oct 03, 2023 at 05:50:10PM +0200, Florent Revest wrote: > Memory-Deny-Write-Execute is a W^X process control originally introduced > by Joey Gouly. I'm the author of the PR_MDWE_NO_INHERIT flag. > > Signed-off-by: Florent Revest > --- > man2/prctl.2 | 27 +++++++++++++++++++++++++++ > 1 file changed, 27 insertions(+) > > diff --git a/man2/prctl.2 b/man2/prctl.2 > index d845b0905..67e6e2ff0 100644 > --- a/man2/prctl.2 > +++ b/man2/prctl.2 > @@ -2041,6 +2041,33 @@ the copy will be truncated. > Return (as the function result) > the full length of the auxiliary vector. > \fIarg4\fP and \fIarg5\fP must be 0. > +.TP > +.BR PR_SET_MDWE " (since Linux 6.3)" > +.\" commit b507808ebce23561d4ff8c2aa1fb949fe402bc61 > +Set the process' Memory-Deny-Write-Execute protection mask. > +.IR arg2 > +must be a bitmask of: > +.RS > +.\" > +.TP > +.B PR_MDWE_REFUSE_EXEC_GAIN > +New memory mapping protections can't be writable and executable. Non-executable > +mappings can't become executable. > +.TP > +.B PR_MDWE_NO_INHERIT " (since Linux 6.6)" > +.\" commit 2a87e5520554034e8c423479740f95bea4a086a0 > +Do not propagate MDWE protection to child processes on Should this mention that PR_MDWE_NO_INHERIT requires PR_MDWE_REFUSE_EXEC_GAIN (unless I forgot how this was supposed to work). -- Catalin