Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2150733imu; Sat, 12 Jan 2019 17:15:57 -0800 (PST) X-Google-Smtp-Source: ALg8bN7mRbTUW/YBLThHb0p8WTZuTCsp/pY5qiW3++PrY2bl3Alf24VSlseJCSWtsiAsnwMGtH8x X-Received: by 2002:a62:16d6:: with SMTP id 205mr20094283pfw.256.1547342157060; Sat, 12 Jan 2019 17:15:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547342157; cv=none; d=google.com; s=arc-20160816; b=xBA1kD9hBVFo4KuULOnAXMq5IaTwp9QLofp1VopfNyI7CrU1FLPa+ADPTd27h/CgwH hy1tP1yTYmNcb4iqOKOhCPwVXLrR1Peb+Sp3N9g0CWk0w/7redCNC14/Yfyt8q8Wdabe vzVMPVrkDsLXWcbqppQnxHFFomUUCMWnfO0qcFeAX27A46JD9m0/wwU8xN9eeSIoFyI5 LmDreBBxU60i6QG/wav93JQApyT2thJpPGzaIby7wMCeLUz1Ybd3gmCHCRPt59otlc9p wxuk182T+UqQl/hoPpcMHoDzyaPhCtjPsfwU4QTEEFYQlU9zwZ/8xS+BwalUKesHeQEr Lftw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=BW3VTNVQqX4mnzD/oEEBtMuebL58BPezY1IEYEIRn1w=; b=kibeQIJXkK7kzJ/KRHH3yrmMAvSMY5UZOpsvRJWam1w/OF95y4GVmoBFfYJx+Pf26N k3zqQr8SKsjIZrI+dvgTrzcovXxyvFHs0cZA64cVtJcb2XNhVHe2j/Y4gx+spQgRcM3+ OS6S57Ius7meyYRmU9JtWyx/3GEkxYcqJlGb0ev3enkAoTjAgftb7WLBDURxXnXuc/Wq Hw+COPSDlEz1fwedFZycAO6spIehbdiqsJ/OTvJTUMD4WvlBwzPNYMF7iUJSto58edlJ m6PhhqaYNoAdA1EzchcJ6ieq+YCpbKCLuLP8s1onF0vipzMkVtc1iS6Ssk+/pnmBRZt+ 3rhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=peUl5Dbh; 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 o3si75094408pll.201.2019.01.12.17.15.01; Sat, 12 Jan 2019 17:15:56 -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=peUl5Dbh; 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 S1726578AbfAMAO4 (ORCPT + 99 others); Sat, 12 Jan 2019 19:14:56 -0500 Received: from mail-qt1-f196.google.com ([209.85.160.196]:32976 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726538AbfAMAOz (ORCPT ); Sat, 12 Jan 2019 19:14:55 -0500 Received: by mail-qt1-f196.google.com with SMTP id l11so22973330qtp.0 for ; Sat, 12 Jan 2019 16:14:54 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=BW3VTNVQqX4mnzD/oEEBtMuebL58BPezY1IEYEIRn1w=; b=peUl5Dbhq8cdn9j+FdirPsGEoiLj2/d5iPo7dOWlRbvzMM3kRNWD7uhFRaI/qV5yPp rhJo5aOABoUlL3GlzJPjpzzWK614fwYCr22/2sewDX8kEySrQ9b2/6VNSv7GqOkTAf4g tylwWAhgi7B5toOxRB5y2JgHFUeXq0OGz2d0w= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=BW3VTNVQqX4mnzD/oEEBtMuebL58BPezY1IEYEIRn1w=; b=HRcqkUbn8yGP8iSl7wvm4wlOa1nzkCtUKZ98L0wFJ+E1zy5IsjYwMxi8pX4V1p3HX/ LymmqncpvT/vM9xwc63lJVHCwsQJ0YIZBdldSYoDvWK+Q1f9X2nTQz72OIhucuPlt/j2 K/5urinqDgDFt6I8BCK55szZMygzOW9/kPnDXYp9ELtOwbY0hBebffLcOJnynWXvqv3U bfye2Uae4ccjQZFpknBCAQShx32tRZsMItt39NEOJ2Hi8po922XDoQSchSS9AJI86gDZ 8TDFGOcrunsaUAlqyDkzRciXSj/RRxs9VwhV3pIn0TVmpmVdzg8U5NhUdfPwQkbA3VbU YrkA== X-Gm-Message-State: AJcUukeHwjm5XUNkEqmRqVKoLAvLJuP3VB4wX+cdb9a5Fa4tBhv6x45g eIKWvT7pVPXzkrLTWpYZJb19dqsju18= X-Received: by 2002:ac8:2d2b:: with SMTP id n40mr18332053qta.38.1547338494012; Sat, 12 Jan 2019 16:14:54 -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.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 12 Jan 2019 16:14:53 -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 1/2] fcntl.2: Update manpage with new memfd F_SEAL_FUTURE_WRITE seal Date: Sat, 12 Jan 2019 19:14:45 -0500 Message-Id: <20190113001446.158789-2-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 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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/fcntl.2 | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/man2/fcntl.2 b/man2/fcntl.2 index 03533d65b..54772f949 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.1.97.g81188d93c3-goog