From patchwork Sun Jan 13 00:14:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Fernandes X-Patchwork-Id: 10761183 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 10D9613BF for ; Sun, 13 Jan 2019 00:14:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 00811289EC for ; Sun, 13 Jan 2019 00:14:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E6F3028A24; Sun, 13 Jan 2019 00:14:58 +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 7C845289EC for ; Sun, 13 Jan 2019 00:14:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8D1608E0004; Sat, 12 Jan 2019 19:14:55 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 882238E0002; Sat, 12 Jan 2019 19:14:55 -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 74D288E0004; Sat, 12 Jan 2019 19:14:55 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by kanga.kvack.org (Postfix) with ESMTP id 491768E0002 for ; Sat, 12 Jan 2019 19:14:55 -0500 (EST) Received: by mail-qk1-f199.google.com with SMTP id j125so13029447qke.12 for ; Sat, 12 Jan 2019 16:14:55 -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=BW3VTNVQqX4mnzD/oEEBtMuebL58BPezY1IEYEIRn1w=; b=LtRL7AmTqjoH5BqqfxEYj9u9DQM5m5kXe2bMJICAeTRTz6xumS0ZY3+yJgI9Bubi7A mKRY8+FnmYegg/SxIP9Eg4oCELWdRrEsnQwtKDw4DR+kSYZvI6p6khhOo56gSzMs27GF 4v33pgk5USyg4989n18iYaQvPLJNrt06jCiwuWXMU5EZ6XS7JYacX89u2QZrlQ5fA6sG bCLnCXvL5fhYPSGBBVWpCjgGJ/Cay+LEv/a5h001vGWCibhwSxzO5kltZToIgx8bI9fc JP2doHTl6I8+ei98XLxwf1on+XLupmYj0XoxezGeoziZQUp2BVI2JH+I1hRsIp7RPTHw KySw== X-Gm-Message-State: AJcUukejPqAx9BzpQ4PYa/moqOivRC8kjrs0l5v5qirCgNQvUhGMWpFb eVaIrpYsG7Tj36HWeRFHDN4v5nJid7xKdWhleKMDpgsUL+Ed2XTIky2OpLzzvFbtJXo7gD+2G5v 0MFSXJ/PCk0Ov6p5yWRHyqqBYMNjdZRwQr8RkG3Bzd20IhHSpoMDYKeW6NfrVCOwgf3JZ4Yfp5i 4DRxhB5+v2AxGdKcbjyKy228QpFWZFIri6Dh5JcSJT+Od86GL98+mw93ioF245ExWJd5kTBAKPh qvLiodse/t1RDyxuLUrYHJy7rQI/FGDQVk70Ty7akslZJTXaY6D5RnHDKG260jxnooA8TEoOFK9 wf+NyDdWn70gU4qatYzFq0vFrL0tGv/qXTJJyvOKe4dLpw9jtQ7VVD034OYnLsu4ayqc7jJmqT8 j X-Received: by 2002:ac8:5509:: with SMTP id j9mr18028217qtq.287.1547338494990; Sat, 12 Jan 2019 16:14:54 -0800 (PST) X-Received: by 2002:ac8:5509:: with SMTP id j9mr18028194qtq.287.1547338494388; Sat, 12 Jan 2019 16:14:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547338494; cv=none; d=google.com; s=arc-20160816; b=eUZPh2t4Z8amBym0NOW5d3Uo2cILv4SGjuhkEF1JfHKed1sT7UhWQXaYGEmDLFGQgO 8XVJwaj4UcePOUyzTVhjlyHQ6Xsf95Gw0lGANJXb1PZTcNDS+5hCihLKaSEbMmKSQzNO KbFrcrl8XNY4oUPIwpOwmENfvDY/uPpIB47ew5273Mzkw+v4Jz0voyjbncpIpiN5QaPy j88MkAAiXzbD1dm2xovWroxhQU3w/De0U54dH400HEBobkfWs0F9S3i0WUz5dJrLyvfL ga7PdUEw7l/TkFp0K/FPaHSyjHxR1TkrorI4PDkxYqAe9FJXrHKOSZdcyVo3QvmFF+VS t81w== 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=BW3VTNVQqX4mnzD/oEEBtMuebL58BPezY1IEYEIRn1w=; b=gIIBhmR9XkcxNH7bNW7Kr3J03rxQfMRaaphXLcyso9JQX+6JE3wY6flExktTVfo6hy 6J6KhOUrTCXvaXay8E2Zn1SXDH9VaepihGLpo/Gia14k0xsUutEN3XWDMV9VgWqO1P9x zaxSMNWhYDRWmOYXPg/kAGRiNxyg3CS4nn/mshuF8vWJaCobBD9QsSBmPsbK2WPs1QAH F/tetJ7dg/bSGPWq2MbL8+Vq1anDYCJ0PGrDwGTdOTWAOufjFyeMSePy5/8Evdkkibo9 SV75rW8rr04H7VwkASpwAK05PCA4S4udpdf35JgxUFUhfhxHrHXXRFqKkOQJdG22qnJ9 t5qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=peUl5Dbh; 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 q6sor80054998qtb.53.2019.01.12.16.14.54 for (Google Transport Security); Sat, 12 Jan 2019 16:14:54 -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=peUl5Dbh; 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=BW3VTNVQqX4mnzD/oEEBtMuebL58BPezY1IEYEIRn1w=; b=peUl5Dbhq8cdn9j+FdirPsGEoiLj2/d5iPo7dOWlRbvzMM3kRNWD7uhFRaI/qV5yPp rhJo5aOABoUlL3GlzJPjpzzWK614fwYCr22/2sewDX8kEySrQ9b2/6VNSv7GqOkTAf4g tylwWAhgi7B5toOxRB5y2JgHFUeXq0OGz2d0w= X-Google-Smtp-Source: ALg8bN63zgmwpiL216eM6LcblB9NCKYZq4Zp16SueCgHnoD1JPEf6gCnBR4grzg3eQxXpHxpN1tz0Q== 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 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/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