From patchwork Wed Jul 6 08:20:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chao Peng X-Patchwork-Id: 12907556 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 46CE8CCA483 for ; Wed, 6 Jul 2022 08:26:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D917C6B0075; Wed, 6 Jul 2022 04:26:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D43A68E0001; Wed, 6 Jul 2022 04:26:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BE3A56B007B; Wed, 6 Jul 2022 04:26:36 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id AF44F6B0075 for ; Wed, 6 Jul 2022 04:26:36 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay12.hostedemail.com (Postfix) with ESMTP id 8333A120BF2 for ; Wed, 6 Jul 2022 08:26:36 +0000 (UTC) X-FDA: 79655993592.28.5C1A1C1 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by imf22.hostedemail.com (Postfix) with ESMTP id D486EC0038 for ; Wed, 6 Jul 2022 08:26:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1657095995; x=1688631995; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=XcUkjLL+YpWw11P834waxgWm/NgeT+vT/ACdu5U5CAo=; b=TI3faxoQR6ZuKMCMuBKWORhm8a1+Ti/deZk6ez15mqu5KUeOxnBjPquu DOXGwjDiUFHgLT5eDzMOEsETjfuLSVX5/tsuTJbfS6Ndxbda8IWoTPv2c go8GAeFQyasyijmrzzmcCj4ZIU4f4ozxh6OBXGkJUfsDppjMEQeALIyA8 9j8EjU17hxqoNwViw7T8vuMPUDYKcu0C5MEHlEwWVeecRTnbX9IxtoXMq FSpxHJ0YidfepqZrzFPeR9OeWc31YQOp7SUnhj66kYIpEpuel7xOxhDsW k9ox1IESOnBrenWuQT/gRI2rbzX8vcwVvaEOmUOVip0EBu1wpxWfOcgU0 g==; X-IronPort-AV: E=McAfee;i="6400,9594,10399"; a="284416780" X-IronPort-AV: E=Sophos;i="5.92,249,1650956400"; d="scan'208";a="284416780" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jul 2022 01:26:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,249,1650956400"; d="scan'208";a="567968372" Received: from chaop.bj.intel.com ([10.240.192.101]) by orsmga006.jf.intel.com with ESMTP; 06 Jul 2022 01:26:16 -0700 From: Chao Peng To: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-api@vger.kernel.org, linux-doc@vger.kernel.org, qemu-devel@nongnu.org, linux-kselftest@vger.kernel.org Cc: Paolo Bonzini , Jonathan Corbet , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H . Peter Anvin" , Hugh Dickins , Jeff Layton , "J . Bruce Fields" , Andrew Morton , Shuah Khan , Mike Rapoport , Steven Price , "Maciej S . Szmigiero" , Vlastimil Babka , Vishal Annapurve , Yu Zhang , Chao Peng , "Kirill A . Shutemov" , luto@kernel.org, jun.nakajima@intel.com, dave.hansen@intel.com, ak@linux.intel.com, david@redhat.com, aarcange@redhat.com, ddutile@redhat.com, dhildenb@redhat.com, Quentin Perret , Michael Roth , mhocko@suse.com, Muchun Song Subject: [PATCH v7 14/14] memfd_create.2: Describe MFD_INACCESSIBLE flag Date: Wed, 6 Jul 2022 16:20:16 +0800 Message-Id: <20220706082016.2603916-15-chao.p.peng@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220706082016.2603916-1-chao.p.peng@linux.intel.com> References: <20220706082016.2603916-1-chao.p.peng@linux.intel.com> MIME-Version: 1.0 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1657095996; a=rsa-sha256; cv=none; b=LkTg8MsdjZFzGik2x79jw3KW5L5STav0mJ/JIUys2zPyGmCCOV+jkh69sJslI/MPGcC6/4 +tFG1tRFjpNWiNy5y5iLt5515tRQTZKFXnyCDcQTiMlvWvVKyOPgpdh+4Pw5Grq3VViZ0A 6Bte7Lyphl/4il6oPcLEpa1JjMZEDJE= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=TI3faxoQ; spf=none (imf22.hostedemail.com: domain of chao.p.peng@linux.intel.com has no SPF policy when checking 134.134.136.24) smtp.mailfrom=chao.p.peng@linux.intel.com; dmarc=pass (policy=none) header.from=intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1657095996; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=s0PmNFMVrgbcNaF1lAqnEQG+Ua5kmxwwsaBZQBQihaw=; b=8FgS7xidAv9J/Lw+kEPsR4mrni5I5OwsUATkYjdt0RAy/BTUNzv/JFbU+1Fwkd3AOphknd PDklVtKuo1ZNXRh0d8WKP2Ovmyk98LCGQu0IT7C9m07/5sG/aOXlF296xV70kkh4Y+nD/H cVdATGh7X5R5ixpYAjRf9ntH6kemvTg= X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: D486EC0038 X-Rspam-User: Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=TI3faxoQ; spf=none (imf22.hostedemail.com: domain of chao.p.peng@linux.intel.com has no SPF policy when checking 134.134.136.24) smtp.mailfrom=chao.p.peng@linux.intel.com; dmarc=pass (policy=none) header.from=intel.com X-Stat-Signature: x1zkqo3wtusygj9aqs8ogfpeu9911rtb X-HE-Tag: 1657095995-163143 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: Signed-off-by: Chao Peng --- man2/memfd_create.2 | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/man2/memfd_create.2 b/man2/memfd_create.2 index 89e9c4136..2698222ae 100644 --- a/man2/memfd_create.2 +++ b/man2/memfd_create.2 @@ -101,6 +101,19 @@ meaning that no other seals can be set on the file. .\" FIXME Why is the MFD_ALLOW_SEALING behavior not simply the default? .\" Is it worth adding some text explaining this? .TP +.BR MFD_INACCESSIBLE +Disallow userspace access through ordinary MMU accesses via +.BR read (2), +.BR write (2) +and +.BR mmap (2). +The file size cannot be changed once initialized. +This flag cannot coexist with +.B MFD_ALLOW_SEALING +and when this flag is set, the initial set of seals will be +.B F_SEAL_SEAL, +meaning that no other seals can be set on the file. +.TP .BR MFD_HUGETLB " (since Linux 4.14)" .\" commit 749df87bd7bee5a79cef073f5d032ddb2b211de8 The anonymous file will be created in the hugetlbfs filesystem using