Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1691627ybv; Sat, 8 Feb 2020 03:58:28 -0800 (PST) X-Google-Smtp-Source: APXvYqyzqZurQ3vgQwLIHAdziSrK1dNETJMAm9g3aZOTvTxigtGnIgNebXYfaxwYFX5bWlRdpgBf X-Received: by 2002:a9d:6457:: with SMTP id m23mr3213905otl.162.1581163107999; Sat, 08 Feb 2020 03:58:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581163107; cv=none; d=google.com; s=arc-20160816; b=GBiPoAB2gLyU2C5nSLzZuYAG7plurUKJlX0pJ8aY9hUVdykE7db7KGCJQ0TGHMDVZJ WmKWd/eUhBW7yFR5oG6ETGBKEqhTXy9AI79Eqbgh6+3U8EjDQQqmKJVyPCGUIj+1rxNd 2vfwD11l3WbInV5I/omELj8ctteHttJMzVHx4fe99uk3HZerQ0EUJMw7m5X/j3QPYP+2 08KKuG+gAKJO6ObSkqkgdbSG6YeGcwkZYDRXckX3nCNSo/t8i5x+2z8uiLyb1PzO6NTV KQdvcyrag5pgsAfsoZlN9qRFjFRoPbXSn7JbEfzSBUyZaNMLDPOV+2oYgjmXJtbqGcK0 6lHw== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject:cc:dkim-signature; bh=vBE5AVqXC0jJd2IELgOKKd2Jzb73ungCmQ/Jq8SLGcI=; b=gGP8PtElW5S/vfMRdb5nGY5PXEy9lKZcGtyPxrONxJax4abaHW1pALCV3nsXAT16q0 fU3ROF7N0WrM3PTQHOxhDXYuSoeh2mUpetfOu2m89YXj+jEU8aWwxePZoE5OWHSs4qOT pwHQUyssHfrd0qeIKVFzcBz1bt/UcX3HtM0ixjhupmNlKOwtMpgTDxTK3bYfZQbuLRI9 BvH5yTmXVTHg0daarqK+0PQe4lD20IR93johHUyZ1DuyQckOlQxdPMZgrXMM7ej4sHYo aD+qPX1Mgc71Scnw9xc2dXpsI5pK7BnmZjPOMHqx02WZmEJBpsFAdK99vnPDQb1vfZJD SRpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="peE/kTj5"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j16si1314669otq.23.2020.02.08.03.58.15; Sat, 08 Feb 2020 03:58:27 -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=@gmail.com header.s=20161025 header.b="peE/kTj5"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727154AbgBHL6N (ORCPT + 99 others); Sat, 8 Feb 2020 06:58:13 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:40100 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726970AbgBHL6N (ORCPT ); Sat, 8 Feb 2020 06:58:13 -0500 Received: by mail-wm1-f67.google.com with SMTP id t14so5500351wmi.5; Sat, 08 Feb 2020 03:58:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=cc:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=vBE5AVqXC0jJd2IELgOKKd2Jzb73ungCmQ/Jq8SLGcI=; b=peE/kTj5TpVgBJdlfxiUZ7HXDSWPeUe9DfOIg62trcM3APZC98dqNWTA6fXFuyjtkQ jsDrYKyYH3TEP1ybToSY4wHygUmePyYK0KI/n+iBY01ZXUxJUwVejt9kFL94PZAo95Sf DTlzq+SDWnDi8022/pHuDQ+lClked+nu+0gmbPZ3o2Lh0unwFfDTrs1G36mBkVIOThmU zL/ulG9pkHNfGtZh9WLbZNTTwEzEFLFMc/nsC7KYSEwm+7RKrCO9c4BMv2zy3rnlXAXH HE1vPKsBrKlyTLjP+Ili4ZWrrbaB6k0E3e1UbxI+JePpj0Op1NvQt8/i2Tqe4QoHPvBA v9BQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:cc:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=vBE5AVqXC0jJd2IELgOKKd2Jzb73ungCmQ/Jq8SLGcI=; b=hmOtQ4axgaV6IB5Q4Ey1IvD+367FWyoYyGwqVsVaWp9PHPaK9eWOTp4UZ/Zkz8Kugv 9FknO9NewLkzJ7K8/u2SjebdD4/q8NyUxyp0aIxpzkknpNjYWNn8IlZNuc8g9rEY1MtE JboVszkmts3udFuadXWZLVwWHbMIAWy95eCIYiXU4o+9pfWsjYNZ67kX3CK6xRpk7jOj fMfOpOubrvzOSFuWX8AbhWI8NLp1k4ds1CNNkicsTeKXS7tPGoCJzbPGnkYyXq7g6f1s 5KiLkMeg68USwjdU5RUnUv7ABwas8EH11z3Gg4FPToyojPHoIjCWu72BNWmWe+V7zUXq /9wQ== X-Gm-Message-State: APjAAAUGaHfXUAu4iUJNZinu9N6srYb+cbTRra7Dv8+dJ/JDnU/M9sCp xDpmfWsRs2vqYZNvOPPyP4g= X-Received: by 2002:a7b:c242:: with SMTP id b2mr4078411wmj.19.1581163089060; Sat, 08 Feb 2020 03:58:09 -0800 (PST) Received: from ?IPv6:2001:a61:251f:d701:c8c9:6ecf:205c:abb7? ([2001:a61:251f:d701:c8c9:6ecf:205c:abb7]) by smtp.gmail.com with ESMTPSA id g7sm7365690wrq.21.2020.02.08.03.58.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 08 Feb 2020 03:58:08 -0800 (PST) Cc: mtk.manpages@gmail.com, Andrew Morton , Andy Lutomirski , dancol@google.com, Jann Horn , John Stultz , kernel-team@android.com, linux-api@vger.kernel.org, linux-man@vger.kernel.org, linux-mm@kvack.org, Matthew Wilcox , Mike Kravetz , Shuah Khan , Stephen Rothwell Subject: Re: [PATCH -manpage 1/2] fcntl.2: Update manpage with new memfd F_SEAL_FUTURE_WRITE seal To: "Joel Fernandes (Google)" , linux-kernel@vger.kernel.org References: <20190314214844.207430-1-joel@joelfernandes.org> <20190314214844.207430-2-joel@joelfernandes.org> From: "Michael Kerrisk (man-pages)" Message-ID: <11efee1c-0b65-2e51-0aa6-7f61fd2958c5@gmail.com> Date: Sat, 8 Feb 2020 12:58:07 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 MIME-Version: 1.0 In-Reply-To: <20190314214844.207430-2-joel@joelfernandes.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Joel, On 3/14/19 10:48 PM, Joel Fernandes (Google) wrote: > 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) Thanks. Patch (finally) applied! Cheers, Michael > --- > man2/fcntl.2 | 15 +++++++++++++++ > 1 file changed, 15 insertions(+) > > diff --git a/man2/fcntl.2 b/man2/fcntl.2 > index fce4f4c2b3bd..e01e2c075b5b 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 > -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/