From patchwork Sun Jan 13 00:14:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Fernandes X-Patchwork-Id: 10761185 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 28B8813B5 for ; Sun, 13 Jan 2019 00:15:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1903E289EC for ; Sun, 13 Jan 2019 00:15:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0C86B28A24; Sun, 13 Jan 2019 00:15:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 00C43289EC for ; Sun, 13 Jan 2019 00:15:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2B9838E0005; Sat, 12 Jan 2019 19:14:57 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 2698D8E0002; Sat, 12 Jan 2019 19:14:57 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 158648E0005; Sat, 12 Jan 2019 19:14:57 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by kanga.kvack.org (Postfix) with ESMTP id D9E708E0002 for ; Sat, 12 Jan 2019 19:14:56 -0500 (EST) Received: by mail-qk1-f200.google.com with SMTP id z126so13167662qka.10 for ; Sat, 12 Jan 2019 16:14:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=OixqdVEoBSDrkAHasDpQua+Q1wKGVCQ1PcDyZD5bqY4=; b=akMW8xg6KHYZ3PZVkxERQpeAFWQnl9cOU/5OStNR3PE3lumdMTOi2sLeD0PaQrFFVO F9ZD+XYA6YaGyGXAK8Mob3ME2dPH3D+MeCKleiqi2szxvbtvWL4xgcKKG5aqiMzveevV 6w1iLqnzN/UjzheAJjn8ow1d202g8RnvNwT7XHtvuPjrvXQ7cDCk34CiL2VTggJ2+Dhl myKcdmK9cMo3taRjMV+uERBpmWa6e4i6zHTojTMbfb6IXVXfzxvtf7PKFczg5LItNBwz b22EVCZIXgo7sxiID8FJHf+bXRy37uAfCwIGuOTxc6YiI8vxFcSPSA24jdjBH+3tfCQZ YV0g== X-Gm-Message-State: AJcUukd4IXPcEaEfOAVFXfprDAuMqd6812ZVHvMuB8955w/Bbk5FXQ7R lgHphS2/a+3gvByMxVX3ZcpZJKFPA1UP/FmC0/YYTPJkUC6UlKsS035s3Sui7GotF2Ph59rQ4L9 +g7UDYxaEdJcd2ePmrxeZ/SrTaLJ+Mzu2t8b3h3QrAYAqrkzWLVzwa+vWQm2FIba3+XnrbKhjDN beqIKLFxSazpKLEVSLHBNZJNpBotRHvg17y3OaixSUlRHOlGWvmBEq9SJcJVUIMY7STTGMmYk/E uGvMSkWKTOfU8wvc6DH0voWEtyRyssTGhV8PtUrv7pc1vuj3vQp6ieXGaEyUw6akdmkwmj6TX3/ x/uRaE3HgCMbazQgDNui3RQXHgpJyxwPXjS1Dv07qkvwjgoQJoZoi/e7RFAGzHhfiyU4+MVMWZQ q X-Received: by 2002:a37:660f:: with SMTP id a15mr17644497qkc.328.1547338496629; Sat, 12 Jan 2019 16:14:56 -0800 (PST) X-Received: by 2002:a37:660f:: with SMTP id a15mr17644480qkc.328.1547338495990; Sat, 12 Jan 2019 16:14:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547338495; cv=none; d=google.com; s=arc-20160816; b=gDLvcOJdKJ7IoN1IWeqXhWdAdMUedVZJJ5QjSTlSy9O4ZK8wPiuxhCVPYRb7Vk+BR5 y+s6OyYX06jpUh6h7D7j+ctf5DCDiQ7LTY0eUHDgEnzWjD++ifPdmRgYDn26MKZ4G4t8 a9y+/3EIo7802+eDacTupeb9DeRZICPXhg5dBy+431JduzR20pKeVV3JRgP8zlRp6/5y QxRTDQaXZYMTaPGigSrlUZo0VhUpu/+WFrHPl2xwm4cYxrZlVtMqEmZSjnT/IiD5y0tc XIzLR4p+UILuY6YA2HdDoOz/W7zRiCMDybSUDyf/7Y+2SwjQMSQN8nVuSSNsd6KdvGol 0SgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=OixqdVEoBSDrkAHasDpQua+Q1wKGVCQ1PcDyZD5bqY4=; b=X6JjVnTmIy1ozqUd7ezGu8KyEMlXuBxon49J3ee/63vfEl/TgSgDWwdA1DzL6t7iGp j5HWLw+k1mi4D+OPPQ7aHe0Bla/Xar5qJUe0+8Ez6ulFc15E20x+uE1eBBK7bqegfT9g cD2/JtNZqLenA4SSjXpjJL+dpomTTJfx5v78yH9BkkcIENULyabi/HtW0wI1c0mbZCkI /jUkjxIm0Sjxf4sRzinWNNIRsPSCtLZXffDsNCy9moPr0Sub9BkdeP87Ptr5DbiApaxT Zk4I+EdIKa21duTcqOMC5+HI4HYJAhsDGFU5VTrbpVjnBjuNezWvTz1DOcasMxHwyTiW Vb1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=hbTkhyIl; spf=pass (google.com: domain of joel@joelfernandes.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=joel@joelfernandes.org Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id e63sor6824684qkc.79.2019.01.12.16.14.55 for (Google Transport Security); Sat, 12 Jan 2019 16:14:55 -0800 (PST) Received-SPF: pass (google.com: domain of joel@joelfernandes.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=hbTkhyIl; spf=pass (google.com: domain of joel@joelfernandes.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=joel@joelfernandes.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OixqdVEoBSDrkAHasDpQua+Q1wKGVCQ1PcDyZD5bqY4=; b=hbTkhyIl9mxXWsJKnfmpKmBukMyy1OtAJFhGQ7e0T/HrUS8ojkqzwvz89EbTDY4WJK zlEg3dJdZNIBRT7AiAPWz/3ipLir0cbC9kXUIUy+K4bhvAQgF4UVnM+1dzePMa3ph92y YE6uWxOQsN6qNHylFZzb60sbQQDyBuY11NiJ8= X-Google-Smtp-Source: ALg8bN6i2Kb2QgUrD78QgT6UkYpMtASdWu0lYC1jWiGvfNkm9qvDZt5Xx76aZzrZNXTCkV0YxRvzEw== X-Received: by 2002:a37:ab03:: with SMTP id u3mr17667678qke.24.1547338495684; Sat, 12 Jan 2019 16:14:55 -0800 (PST) Received: from joelaf.cam.corp.google.com ([2620:0:1004:1100:cfd0:d2ee:d54d:ab6d]) by smtp.gmail.com with ESMTPSA id p48sm50525149qtp.62.2019.01.12.16.14.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 12 Jan 2019 16:14:54 -0800 (PST) From: Joel Fernandes To: linux-kernel@vger.kernel.org, mtk.manpages@gmail.com Cc: "Joel Fernandes (Google)" , Andrew Morton , Andy Lutomirski , dancol@google.com, Hugh Dickins , Jann Horn , John Stultz , linux-api@vger.kernel.org, linux-man@vger.kernel.org, linux-mm@kvack.org, marcandre.lureau@redhat.com, Matthew Wilcox , Mike Kravetz , Shuah Khan , Stephen Rothwell Subject: [PATCH -manpage 2/2] memfd_create.2: Update manpage with new memfd F_SEAL_FUTURE_WRITE seal Date: Sat, 12 Jan 2019 19:14:46 -0500 Message-Id: <20190113001446.158789-3-joel@joelfernandes.org> X-Mailer: git-send-email 2.20.1.97.g81188d93c3-goog In-Reply-To: <20190113001446.158789-1-joel@joelfernandes.org> References: <20190113001446.158789-1-joel@joelfernandes.org> MIME-Version: 1.0 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP From: "Joel Fernandes (Google)" More details of the seal can be found in the LKML patch: https://lore.kernel.org/lkml/20181120052137.74317-1-joel@joelfernandes.org/T/#t Signed-off-by: Joel Fernandes (Google) --- man2/memfd_create.2 | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/man2/memfd_create.2 b/man2/memfd_create.2 index 3cd392d1b..fce2bf8d0 100644 --- a/man2/memfd_create.2 +++ b/man2/memfd_create.2 @@ -280,7 +280,15 @@ in order to restrict further modifications on the file. (If placing the seal .BR F_SEAL_WRITE , then it will be necessary to first unmap the shared writable mapping -created in the previous step.) +created in the previous step. Otherwise, behavior similar to +.BR F_SEAL_WRITE +can be achieved, by using +.BR F_SEAL_FUTURE_WRITE +which will prevent future writes via +.BR mmap (2) +and +.BR write (2) +from succeeding, while keeping existing shared writable mappings). .IP 4. A second process obtains a file descriptor for the .BR tmpfs (5) @@ -425,6 +433,7 @@ main(int argc, char *argv[]) fprintf(stderr, "\\t\\tg \- F_SEAL_GROW\\n"); fprintf(stderr, "\\t\\ts \- F_SEAL_SHRINK\\n"); fprintf(stderr, "\\t\\tw \- F_SEAL_WRITE\\n"); + fprintf(stderr, "\\t\\tW \- F_SEAL_FUTURE_WRITE\\n"); fprintf(stderr, "\\t\\tS \- F_SEAL_SEAL\\n"); exit(EXIT_FAILURE); } @@ -463,6 +472,8 @@ main(int argc, char *argv[]) seals |= F_SEAL_SHRINK; if (strchr(seals_arg, \(aqw\(aq) != NULL) seals |= F_SEAL_WRITE; + if (strchr(seals_arg, \(aqW\(aq) != NULL) + seals |= F_SEAL_FUTURE_WRITE; if (strchr(seals_arg, \(aqS\(aq) != NULL) seals |= F_SEAL_SEAL; @@ -518,6 +529,8 @@ main(int argc, char *argv[]) printf(" GROW"); if (seals & F_SEAL_WRITE) printf(" WRITE"); + if (seals & F_SEAL_FUTURE_WRITE) + printf(" FUTURE_WRITE"); if (seals & F_SEAL_SHRINK) printf(" SHRINK"); printf("\\n");