From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 38B02C433E0 for ; Fri, 17 Jul 2020 08:39:55 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id F3E3C2074B for ; Fri, 17 Jul 2020 08:39:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F3E3C2074B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ucw.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 509ED6B0029; Fri, 17 Jul 2020 04:39:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 493296B002A; Fri, 17 Jul 2020 04:39:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 333876B002B; Fri, 17 Jul 2020 04:39:54 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0020.hostedemail.com [216.40.44.20]) by kanga.kvack.org (Postfix) with ESMTP id 202586B0029 for ; Fri, 17 Jul 2020 04:39:54 -0400 (EDT) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id D5DBE1801D3E0 for ; Fri, 17 Jul 2020 08:39:53 +0000 (UTC) X-FDA: 77046919866.17.space95_1c0f7ee26f09 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin17.hostedemail.com (Postfix) with ESMTP id 1CDE61828EE28 for ; Fri, 17 Jul 2020 08:36:07 +0000 (UTC) X-HE-Tag: space95_1c0f7ee26f09 X-Filterd-Recvd-Size: 2779 Received: from jabberwock.ucw.cz (jabberwock.ucw.cz [46.255.230.98]) by imf25.hostedemail.com (Postfix) with ESMTP for ; Fri, 17 Jul 2020 08:36:06 +0000 (UTC) Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id D8FF61C0BDF; Fri, 17 Jul 2020 10:36:02 +0200 (CEST) Date: Fri, 17 Jul 2020 10:36:02 +0200 From: Pavel Machek To: Mike Rapoport Cc: linux-kernel@vger.kernel.org, Alan Cox , Andrew Morton , Andy Lutomirski , Christopher Lameter , Dave Hansen , Idan Yaniv , James Bottomley , "Kirill A. Shutemov" , Matthew Wilcox , Peter Zijlstra , "Reshetova, Elena" , Thomas Gleixner , Tycho Andersen , linux-api@vger.kernel.org, linux-mm@kvack.org, Mike Rapoport Subject: Re: [RFC PATCH v2 0/5] mm: extend memfd with ability to create "secret" memory areas Message-ID: <20200717083601.GB1027@bug> References: <20200706172051.19465-1-rppt@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200706172051.19465-1-rppt@kernel.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Rspamd-Queue-Id: 1CDE61828EE28 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam02 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: Hi! > This is a second version of "secret" mappings implementation backed by a > file descriptor. > > The file descriptor is created using memfd_create() syscall with a new > MFD_SECRET flag. The file descriptor should be configured using ioctl() to > define the desired protection and then mmap() of the fd will create a > "secret" memory mapping. The pages in that mapping will be marked as not > present in the direct map and will have desired protection bits set in the > user page table. For instance, current implementation allows uncached > mappings. > > Hiding secret memory mappings behind an anonymous file allows (ab)use of > the page cache for tracking pages allocated for the "secret" mappings as > well as using address_space_operations for e.g. page migration callbacks. > > The anonymous file may be also used implicitly, like hugetlb files, to > implement mmap(MAP_SECRET) and use the secret memory areas with "native" mm > ABIs. I believe unix userspace normally requires mappings to be... well... protected from other users. How is this "secret" thing different? How do you explain the difference to userland programmers? Best regards, Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html