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=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 308F6CA9EC0 for ; Mon, 28 Oct 2019 20:45:27 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E8D2421721 for ; Mon, 28 Oct 2019 20:45:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=amacapital-net.20150623.gappssmtp.com header.i=@amacapital-net.20150623.gappssmtp.com header.b="fcUjf9zk" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E8D2421721 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amacapital.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 8C3166B000E; Mon, 28 Oct 2019 16:45:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 873626B0269; Mon, 28 Oct 2019 16:45:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 762276B026B; Mon, 28 Oct 2019 16:45:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0183.hostedemail.com [216.40.44.183]) by kanga.kvack.org (Postfix) with ESMTP id 54AAE6B000E for ; Mon, 28 Oct 2019 16:45:26 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with SMTP id DDA69180AD82F for ; Mon, 28 Oct 2019 20:45:25 +0000 (UTC) X-FDA: 76094373810.19.cord60_4c7597369e75d X-HE-Tag: cord60_4c7597369e75d X-Filterd-Recvd-Size: 4550 Received: from mail-pg1-f193.google.com (mail-pg1-f193.google.com [209.85.215.193]) by imf47.hostedemail.com (Postfix) with ESMTP for ; Mon, 28 Oct 2019 20:45:25 +0000 (UTC) Received: by mail-pg1-f193.google.com with SMTP id c8so7760403pgb.2 for ; Mon, 28 Oct 2019 13:45:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amacapital-net.20150623.gappssmtp.com; s=20150623; h=content-transfer-encoding:from:mime-version:subject:date:message-id :references:cc:in-reply-to:to; bh=KOjhDV2bOtkoryUtZNdedbIyz5aUvjz8VRxxdiXfCZg=; b=fcUjf9zk+4oJ62eLTSygNM/iUtrrnBl2+URBZKh9513ri3eVyRIWYt6bIgH6oBx4X0 LB5TPZm0P2iY/11cju/J8f/fRgRBSAwMe0CVXk0tW/1XHV0t8T2PQd/ceyOdSMnCnni5 9LeWRxiN2X+mhcgqmGe1cusQKUg8mFqlilKv2a9SwKST9Q/GowMmIwMwzcO2c2AGkhL4 xKH5DOsYPndupfQyJrxwYB7Z09GUJSFWJ7UqrM1qLKEiwtJqH80kHN5F87HbqAbzaiMR uc5E7aoW6XA++r+uZ3QAikuJFPVAapX76VSsqSRNVeE3589Cdh9fCi9NV4M6qqamGUpI w21Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:content-transfer-encoding:from:mime-version :subject:date:message-id:references:cc:in-reply-to:to; bh=KOjhDV2bOtkoryUtZNdedbIyz5aUvjz8VRxxdiXfCZg=; b=XOhB4Lry5/Q9rizlJw5jo2YLoGRaOJnri7eyXBHynB6xduo9CY4vlOfGUkQ9Jv+gnM nIxVwu//lVLh7sLx62+pERpup0hHGudLCUZfajGfScEGIcu8884QKLQluh5RqEqHyqW0 aGqs/OyM7j0flXmxebQ4nmzpQQZB5lzsd+eDnQy++k8tYZ2L6+kp4yKRW3n0HFlKdEc4 vZ9Y1zICSFvFbHNRIhcAnWCaz7iUR+1pPisOtCjfmjxI/s4/FTPZO9r3x+N9TVA4lRwH ltUMgbtR17uY/4YwFnto0YnwTIsc/Xjmxr078QFEBbpMG+QxfX92b/A5XlHsNAdPXavF ZOrg== X-Gm-Message-State: APjAAAWupaRsmYp0Hv324VI15BJEzFluxbaEih8cwHmCOwZSwn3e+2Jq BkOomwLx0ghskuRmwaoayJjv6g== X-Google-Smtp-Source: APXvYqz+3RSrMew/VEEbk6rofjrWlXLaxsQq8rNZqiU1GY8aOt/v3M5nMsymLZnECmWFFPRlRADoVg== X-Received: by 2002:a63:a03:: with SMTP id 3mr24167392pgk.112.1572295524109; Mon, 28 Oct 2019 13:45:24 -0700 (PDT) Received: from [100.96.218.121] (241.sub-174-237-138.myvzw.com. [174.237.138.241]) by smtp.gmail.com with ESMTPSA id l72sm372781pjb.18.2019.10.28.13.45.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 28 Oct 2019 13:45:22 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Andy Lutomirski Mime-Version: 1.0 (1.0) Subject: Re: [PATCH RFC] mm: add MAP_EXCLUSIVE to create exclusive user mappings Date: Mon, 28 Oct 2019 14:44:23 -0600 Message-Id: References: <1572171452-7958-1-git-send-email-rppt@kernel.org> Cc: linux-kernel@vger.kernel.org, Alexey Dobriyan , Andrew Morton , Andy Lutomirski , Arnd Bergmann , Borislav Petkov , Dave Hansen , James Bottomley , Peter Zijlstra , Steven Rostedt , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , linux-api@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org, Mike Rapoport In-Reply-To: <1572171452-7958-1-git-send-email-rppt@kernel.org> To: Mike Rapoport X-Mailer: iPhone Mail (17A878) 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: > On Oct 27, 2019, at 4:17 AM, Mike Rapoport wrote: >=20 > =EF=BB=BFFrom: Mike Rapoport >=20 > Hi, >=20 > The patch below aims to allow applications to create mappins that have > pages visible only to the owning process. Such mappings could be used to > store secrets so that these secrets are not visible neither to other > processes nor to the kernel. >=20 > I've only tested the basic functionality, the changes should be verified > against THP/migration/compaction. Yet, I'd appreciate early feedback. I=E2=80=99ve contemplated the concept a fair amount, and I think you should c= onsider a change to the API. In particular, rather than having it be a MAP_ f= lag, make it a chardev. You can, at least at first, allow only MAP_SHARED, a= nd admins can decide who gets to use it. It might also play better with the= VM overall, and you won=E2=80=99t need a VM_ flag for it =E2=80=94 you can j= ust wire up .fault to do the right thing.