Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp157907imu; Wed, 12 Dec 2018 14:06:53 -0800 (PST) X-Google-Smtp-Source: AFSGD/V4tJ7/fC4M1/3AGKx9FVXw2GGGgBFHLR7prRI7sp4ZHll6r+8WowJoemYVxLwkIpX2mPar X-Received: by 2002:a17:902:7044:: with SMTP id h4mr21158798plt.35.1544652413696; Wed, 12 Dec 2018 14:06:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544652413; cv=none; d=google.com; s=arc-20160816; b=zPPXyF6nH2oGPa+ingz9tHpFr60lVvk6IhIRAFX0NsboJ5Mf/5iLt7bqs9uX/dlaOQ DQZgCbjIFt2WzHCYsFa+IVjgFNEkLBfX3s5IGuWS3nhItiRlDphgbQjgrGZc5OVBvWUd hVkTor1oN2YRGwcN4wTQZmIYPjHcGak6XLBM9X0SnrpCMINVfWpu4Zu3hRjW2Bl1UB3R 0viC66M4gxJTw0N38LIHFeUP03UyY3qBD7cROlCKWPF9VZdQgt9PAvlWOM53jzz3+qub mWlukctH7Ij+1UjUWuxfdA27d2YVPmoXZc/JAyOXTSzR5JvuA3lU4xeOi0CZPcAqaiiU t3LA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=hazJnQDZsZo3kVuPkNhwMYMauryGhG8I6tzG46lyL1E=; b=fFKQhHz4a0FU8WdlYJNXBvNuLZg+6JYhyqQpR2rqvzNX7cb1fAh1W0d7lz6BAWn8xP /yVvOzbs/M7hNG4b8+M/wRWFn0KrZ92Bq3ka/Lyhl1GwTypQdrVUIygx8/c/xkwtPV0Y BDE6ZHtzUO6/uRwFZUzHnhqbtsUT78UU477qL4idCrGisvxManQ4Y3oOHiq9A3SRlkCQ zUM5g+V54QUjRXvHD+MdzxGxhferWD+nGGkT8qo9lsuiTPx6ntwG4S3jz72di5aO7bgF OUEc8eCFAivT5Nu46C5JYfaOqgA+9lifHf20v+3q+uPlgFrkHTcgn2SL5rnOp/6R6shW 9hQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=Vf41e4Yx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t1si15158418pgj.542.2018.12.12.14.06.38; Wed, 12 Dec 2018 14:06:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=Vf41e4Yx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728392AbeLLWF0 (ORCPT + 99 others); Wed, 12 Dec 2018 17:05:26 -0500 Received: from mail-pg1-f196.google.com ([209.85.215.196]:36944 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726263AbeLLWFZ (ORCPT ); Wed, 12 Dec 2018 17:05:25 -0500 Received: by mail-pg1-f196.google.com with SMTP id 80so8974671pge.4 for ; Wed, 12 Dec 2018 14:05:25 -0800 (PST) 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-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=hazJnQDZsZo3kVuPkNhwMYMauryGhG8I6tzG46lyL1E=; b=iC8QkH0ZslLW+SAMfWqSIhfLxacKgge//fSmLiyFi/HRbNDq40QCGEmxTGxl/7+gXc lUqxIsDQ/ZWZdMjZwHz2UF2unoZ7ofLTdfLONIkwrqizEpuzXmKbmycT2shw2vWJXpX+ ebeeXD73HSxh8uIaapAsE/LYGnpmhFth+EFodJuW4iWKGf8xtgtbC/tVrMrbaTGv53LF nLZO6L8CfdW2jKkQubsIUxRPldJ962r2FHl36N55DZCyVNPjcvauAYFIW0BQTIIFt3oe IsiFAPgiNVzSl3cohu22fEVtInzFbYm4uANDm6BXmKGrGs1Cl8K4/msrUzHq4Na+c/VS +O4w== X-Gm-Message-State: AA+aEWZVTtDPGTbk88k6qmkzn5tm72xd4pxMEhNkr9yEzOodtod/dsa0 ULhpW5ViGh0QkS7d5wk3TyTapQ== 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=20Lureau?= , 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 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 -- 2.20.0.rc1.387.gf8505762e3-goog