Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4239551ybg; Tue, 29 Oct 2019 04:19:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqyY3d/Yf5+7jmpZxxJr2TkhDartdo5vDLMhV4E4/Ljy2qrZv6M0Y65PKSHYSp57KHb4W44t X-Received: by 2002:a17:906:1f8b:: with SMTP id t11mr2649083ejr.191.1572347992188; Tue, 29 Oct 2019 04:19:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572347992; cv=none; d=google.com; s=arc-20160816; b=UJG/NyJBkhYr9Ch6PwhbXVHGSBLvHwn3RWMANMcltXq2qacxFD6jpuczl5arii7WaS Je+SrUMeER0JIZMYRL06ld4NNlO774DRXQWRYEpQRrMg323PzPAc0vOMsEmw/Sa49pp1 tLArDPHqdtv7qn/s/Y0Jn9EqJWhdyadHz3VZcgm78XSPeK0Fxzm7havjGktzyd7WOE8R 0Hb2HB+UENNa4YEGEW0h2ncuZadobpRY31K88tpx8Z5Hb4LKu7XbUMevJ9AGbO1QsHr5 c9ckFrNiXzej+Tn8nLG05jKxLnXU0ufbOF6nQQ7jADjitccruwFyDglXPZMCICLydi8b 4+xQ== 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:organization:from:references:cc:to:subject :dkim-signature; bh=s7sbbHmvNFaJzygr4NJBUlYrQ4azqMBo1OOsjTf8okk=; b=LW9+EJ9ns4doHVLnutUh9kQqVAVDa22rIo2oVBYJMmp6+fdZNr2zG7TKWq/m/soPL6 xBAluw3kP3k148n6yTcUQxKyBsO6kclimVUGiIgwkRZkDxoUUDfpsQ30HyZBRVA6UbLy m8T8OMV1FKX71cAYI7sWeGzReE9IGowixxgdjaALSvR9g3vFC+w3P/26z3j5wGwtOKfR F4vUSAcwIvJlfAdYTrxcXppHudouJ8hgoc0B9U9LD2O5bT3s34bB2Ntz2JpFcg0D8bsp j8hwjTl0rt1tbpK3v3VdBkX9JM/8ZpN2+IH9ASmQcFkTig4aZ8eMo2VhEJyhkOKkz4FG pYJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="d/XsJyzt"; 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=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 93si10164855edo.408.2019.10.29.04.19.28; Tue, 29 Oct 2019 04:19:52 -0700 (PDT) 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=@redhat.com header.s=mimecast20190719 header.b="d/XsJyzt"; 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=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731929AbfJ2LCp (ORCPT + 99 others); Tue, 29 Oct 2019 07:02:45 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:56595 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726357AbfJ2LCp (ORCPT ); Tue, 29 Oct 2019 07:02:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1572346964; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=s7sbbHmvNFaJzygr4NJBUlYrQ4azqMBo1OOsjTf8okk=; b=d/XsJyztV0/rs+6igdnuuZDfxcNimrykhwPdBMMHME0J/ntl07uHEdxbQIdPSxi5+ItZ7E EknoK+JRtDnj+5ubz/rD2b0vHecvM3bFotRh9b96+HdY9czHGI26g3MNZKYV5FF/NpS7Ud 8HUwhnUm+qERPFWO0AYe3mlwa85BN4Q= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-271-QvSRTwhiPeOIPJAKsYgcDw-1; Tue, 29 Oct 2019 07:02:40 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 61D031800D67; Tue, 29 Oct 2019 11:02:38 +0000 (UTC) Received: from [10.36.117.183] (ovpn-117-183.ams2.redhat.com [10.36.117.183]) by smtp.corp.redhat.com (Postfix) with ESMTP id D59DD600F4; Tue, 29 Oct 2019 11:02:34 +0000 (UTC) Subject: Re: [PATCH RFC] mm: add MAP_EXCLUSIVE to create exclusive user mappings To: Mike Rapoport , linux-kernel@vger.kernel.org Cc: 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 References: <1572171452-7958-1-git-send-email-rppt@kernel.org> <1572171452-7958-2-git-send-email-rppt@kernel.org> From: David Hildenbrand Organization: Red Hat GmbH Message-ID: <085ed07e-e646-f7a4-0370-06f33a2a4e4a@redhat.com> Date: Tue, 29 Oct 2019 12:02:34 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1 MIME-Version: 1.0 In-Reply-To: <1572171452-7958-2-git-send-email-rppt@kernel.org> Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: QvSRTwhiPeOIPJAKsYgcDw-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 27.10.19 11:17, Mike Rapoport wrote: > From: Mike Rapoport >=20 > The mappings created with MAP_EXCLUSIVE are visible only in the context o= f > the owning process and can be used by applications to store secret > information that will not be visible not only to other processes but to t= he > kernel as well. >=20 > The pages in these mappings are removed from the kernel direct map and > marked with PG_user_exclusive flag. When the exclusive area is unmapped, > the pages are mapped back into the direct map. >=20 Just a thought, the kernel is still able to indirectly read the contents=20 of these pages by doing a kdump from kexec environment, right?. Also, I=20 wonder what would happen if you map such pages via /dev/mem into another=20 user space application and e.g., use them along with kvm [1]. [1] https://lwn.net/Articles/778240/ --=20 Thanks, David / dhildenb