From patchwork Wed Dec 12 22:05:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Fernandes X-Patchwork-Id: 10727189 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 7E0B716B1 for ; Wed, 12 Dec 2018 22:05:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6D3622B174 for ; Wed, 12 Dec 2018 22:05:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6097C2B920; Wed, 12 Dec 2018 22:05:28 +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 E47652B174 for ; Wed, 12 Dec 2018 22:05:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0A6528E014D; Wed, 12 Dec 2018 17:05:27 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 056C18E00E5; Wed, 12 Dec 2018 17:05:27 -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 EAF0D8E014D; Wed, 12 Dec 2018 17:05:26 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) by kanga.kvack.org (Postfix) with ESMTP id AD1C18E00E5 for ; Wed, 12 Dec 2018 17:05:26 -0500 (EST) Received: by mail-pg1-f199.google.com with SMTP id d71so7858pgc.1 for ; Wed, 12 Dec 2018 14:05:26 -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:mime-version:content-transfer-encoding; bh=hazJnQDZsZo3kVuPkNhwMYMauryGhG8I6tzG46lyL1E=; b=AosRhV9w+yQyaJOFATlWEvnEo8NnVbvyRKCrBcb/vshQp/JXAlu1G+sCuJpPEbLYl7 dgMK7zfWwfavbfi7wTUAgpon2loRiD9uadylnCRG27rNobBtIq6axb6PdvmWqxTWXnXd QQvGIeRxi+CoEwFqsMC1vifSF5+b/D8vkYDdjxvFooJbtYUWqMzYKx5T+phtaCf5PDCF bfVU/nCpvIGoglD1LNA5aNLdqlwtvli2+RW8fdd9/hTOY5/msAC4IMHkzRA5DygGezHc 9KLxWWQlDpoAo0xMCmQvIaXOzYtZeA1nA0pHqpTFEvBFsT5ypWtL1wR/YMHoV9lFXarJ wFXA== X-Gm-Message-State: AA+aEWZfoj74dRxLS7FxblgBePnk1xJktkbRiP1uSTDf0KuGRremMtpM sXY0udRsSKt1HgJsz3WtbuIuDcCrrUV8iBEvgcb6e/dsirvcX6mefp1l/YoZLtxqoKj60LNa9JN phXGQRYpKihLxtCihYdc5oNK/3Svc6Pru0/2X1K7yZKI6tteac3NfEVzrfAM6B7T7HyWWPUCeOJ g3mFD3a5lT680i0pnSG1rbH7mxMg2JOooA8eDEgZ92pO3Si+ExcwA5xrAAPUB1trxfmRdRA/nz2 HMkgaYorSEYXLjfr/qMNYeD23HeeJRQNT09RWf6d9NSc2rfCtODZ/CFPeusjT8cTVQy+AdTTHp9 azwBVIGA/Mk5sekGhO3+m8JOCUbby9+3nD8VNh3mdsZ4LbWu5DBojqOwywkxdXhiAlHAHLXFlbG n X-Received: by 2002:a17:902:722:: with SMTP id 31mr21573176pli.271.1544652326365; Wed, 12 Dec 2018 14:05:26 -0800 (PST) X-Received: by 2002:a17:902:722:: with SMTP id 31mr21573127pli.271.1544652325607; Wed, 12 Dec 2018 14:05:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544652325; cv=none; d=google.com; s=arc-20160816; b=KOQzXqs+Ws7L3Aoqj7KDqhkNnf/I6vINrPjF+J79/Mhpyqdry6HwmjiGERgg5O2PJT jVUZ2mBZvXttXhlk7/ZymNkMqAgpGWZlQUV5+0gQSf1o42gJpCWPJ3H4h25AZ92ygoxR JDqhAtr5qx2y9yN7e+F3QzN8gxB4N6PJIQ5PUyMFWqo30EOrhouD9JSBi766wf4zMeWn hJWiMiE5dxKHiLFVdopPBu4xIHl11fx48o2+mrSPAOhao4r30T7TZMXlBxFAIo/okVs5 5pBCH4Vt1vHSBCSFYGjJQAipPFDqqqGdnSB+75pEsmaiQiV+bqckMpt7uHx68a4Re+S+ KJFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=hazJnQDZsZo3kVuPkNhwMYMauryGhG8I6tzG46lyL1E=; b=TMxjziwnn76W/57Zj7GwBvY0WO5PVtpSngiYpNZn9SidqIZWmN85A32JBdUumbmyDo WAz8iuT6EaG53mnyvKR7UJMjRa/jINye9RgPkAcE5SW7bwuKRCNk40mYme9QLMqIEDoj +yG6EpGUzP1YUL6QJSSmCgt8juxdHmqpjcP1phn3oRd6qEk6asqoBcU0j4OKE9g3A9dW DHYQ+Iw5dBkbH/yq0N+dgGOwa+VOrB69f6A0UclbO95PUiwXFtB4/uyQD2hZv+ZkzXcn JOlCE9qOuazNZug4d6+flDRkTlGDvWDa+dfA0F0ix911treYDIQbRVLrDn98wxD5qrje ffDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=Vf41e4Yx; 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 h192sor28427243pgc.77.2018.12.12.14.05.25 for (Google Transport Security); Wed, 12 Dec 2018 14:05:25 -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=Vf41e4Yx; 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:mime-version :content-transfer-encoding; bh=hazJnQDZsZo3kVuPkNhwMYMauryGhG8I6tzG46lyL1E=; b=Vf41e4Yx1yFJ/qMtwPCXfH5U9sPY8Qa5MpupPB4LH9Rv3EsBZ4dHInvMbAiw2IO3u2 IvJGs2J/vGZkOBAiu6eezLzuhKhSq01APD4NdKLJv+i+J8EpJv9chqwu7RiG8xoAj6za mlgfCbpUY6EZwf/59Y9FM1BXMB6rWfJMjwtCE= X-Google-Smtp-Source: AFSGD/UR0Mwu86+321x5T7dF9/t4NyB49dG3jQFLqx5naDqVEJMTq2cBzgRG7HOnsM2H72Hg5sH1ng== X-Received: by 2002:a63:cc12:: with SMTP id x18mr19610673pgf.33.1544652324034; Wed, 12 Dec 2018 14:05:24 -0800 (PST) Received: from joelaf.mtv.corp.google.com ([2620:0:1000:1601:3aef:314f:b9ea:889f]) by smtp.gmail.com with ESMTPSA id o1sm29340869pgn.63.2018.12.12.14.05.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Dec 2018 14:05:22 -0800 (PST) From: "Joel Fernandes (Google)" To: linux-man@vger.kernel.org Cc: "Joel Fernandes (Google)" , Andrew Morton , Andy Lutomirski , dancol@google.com, Hugh Dickins , Jann Horn , John Stultz , linux-api@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Matthew Wilcox , Mike Kravetz , Shuah Khan , Stephen Rothwell Subject: [PATCH -manpage 1/2] fcntl.2: Update manpage with new memfd F_SEAL_FUTURE_WRITE seal Date: Wed, 12 Dec 2018 14:05:13 -0800 Message-Id: <20181212220514.205269-1-joel@joelfernandes.org> X-Mailer: git-send-email 2.20.0.rc1.387.gf8505762e3-goog 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 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/fcntl.2 | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/man2/fcntl.2 b/man2/fcntl.2 index 03533d65b49d..54772f94964c 100644 --- a/man2/fcntl.2 +++ b/man2/fcntl.2 @@ -1525,6 +1525,21 @@ Furthermore, if there are any asynchronous I/O operations .RB ( io_submit (2)) pending on the file, all outstanding writes will be discarded. +.TP +.BR F_SEAL_FUTURE_WRITE +If this seal is set, the contents of the file can be modified only from +existing writeable mappings that were created prior to the seal being set. +Any attempt to create a new writeable mapping on the memfd via +.BR mmap (2) +will fail with +.BR EPERM. +Also any attempts to write to the memfd via +.BR write (2) +will fail with +.BR EPERM. +This is useful in situations where existing writable mapped regions need to be +kept intact while preventing any future writes. For example, to share a +read-only memory buffer to other processes that only the sender can write to. .\" .SS File read/write hints Write lifetime hints can be used to inform the kernel about the relative