Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp578699ybx; Wed, 30 Oct 2019 01:22:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqzs3efOp6/ptpDgPNK3O9hR8udjJlQKKe99ui/wJlnNmnO9MWCAlYcOvA9F4bS0Lj6z2rbS X-Received: by 2002:a50:959a:: with SMTP id w26mr30151825eda.214.1572423773910; Wed, 30 Oct 2019 01:22:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572423773; cv=none; d=google.com; s=arc-20160816; b=fKZ7XIqhcgjlPXg57uTANFLzUGjwvk5ldGMUeoPmG6zSl0KZunuPvrIT19MtOFXPYW ojlD+JUteVX4SzLzUbZmD7MWe53bNaCsn+M6w36/Y5pZHs+OtCjtvmWKpqHVRgWwOgP2 jUuNFAde5M2jQoYBEoS4mHnmWafb6dZh93jD/k1BEC4WhdPBsh/nIAHjw00PkCqebIjB 8/lPDtGi3YsVADS0XkqaLdIcUnEf4IkYWYBVqKVgMWjztU7UF6fJdL2JW2kNaydmloZW 8hMSKftsr9KAJd1cn6wVJRqYfZa3kWZxFjOMSwsyBnaAcJ+js/Pb/B65v67Thg1makVl sq5w== 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=tGP8/Cq/uIP6+eazYurLTr329KXGMw2YjLoiUkgJNCw=; b=BgegqA8VfzQqc+5/4wi6bbLXC6Bk1K9dhUJZBoMSndvQiBxaDjjDnII3WcbPLgfa5d WPXw58GEGSnkzZ+HCeQDD4J1N+09rdFPRcWRYnW3D6FaQw+NloI/JIPWAoz0mdmnAnwk i6T6tKyi0PgR0eunNz09zdJMcrroB5ehGdTqhV5bwKy1QTGQbNsjhG63Y1VINXBAiOjz lBP9tFc+IWyz8YqMgMANUBqrm2holz90yQis58PrCeAoa2vEfjBMny5SqpR8z4cB3FOp rLzrM0tkMCo9qi0y+1cd5bYhgNHq4xJJNUCi3fZarf8VdUeHTWQkNBn+ThWvNrgysGA2 D06A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=JSDcl6LZ; 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 t49si912096edd.198.2019.10.30.01.22.30; Wed, 30 Oct 2019 01:22:53 -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=JSDcl6LZ; 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 S1726316AbfJ3ITp (ORCPT + 99 others); Wed, 30 Oct 2019 04:19:45 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:22758 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725822AbfJ3ITp (ORCPT ); Wed, 30 Oct 2019 04:19:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1572423584; 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=tGP8/Cq/uIP6+eazYurLTr329KXGMw2YjLoiUkgJNCw=; b=JSDcl6LZWYcSgXZeDubSupTVoEvXEQKl1OeK/yVq7WCNXPM1l0G/YIGkBFClkmEiFQkjUn 1tuoElZkQKbZBvrIZRdHRvmUIFRz8onSPWkF8b18k+8YcaXI3n1E3kzLh/JLFRSjWW9CuF vxd2N9MIayLJLv7WsMptI0LRmajLisE= 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-58-CSJ1tpiVO8yEP9kAKb589Q-1; Wed, 30 Oct 2019 04:19:40 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4F500107AD28; Wed, 30 Oct 2019 08:19:38 +0000 (UTC) Received: from [10.36.116.222] (ovpn-116-222.ams2.redhat.com [10.36.116.222]) by smtp.corp.redhat.com (Postfix) with ESMTP id 91E5D60C4B; Wed, 30 Oct 2019 08:19:34 +0000 (UTC) Subject: Re: [PATCH RFC] mm: add MAP_EXCLUSIVE to create exclusive user mappings To: Mike Rapoport 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 References: <1572171452-7958-1-git-send-email-rppt@kernel.org> <1572171452-7958-2-git-send-email-rppt@kernel.org> <085ed07e-e646-f7a4-0370-06f33a2a4e4a@redhat.com> <20191030081529.GB20624@rapoport-lnx> From: David Hildenbrand Organization: Red Hat GmbH Message-ID: <9eae3941-64cf-4ea1-0287-0e64bab192c6@redhat.com> Date: Wed, 30 Oct 2019 09:19:33 +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: <20191030081529.GB20624@rapoport-lnx> Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: CSJ1tpiVO8yEP9kAKb589Q-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 30.10.19 09:15, Mike Rapoport wrote: > On Tue, Oct 29, 2019 at 12:02:34PM +0100, David Hildenbrand wrote: >> On 27.10.19 11:17, Mike Rapoport wrote: >>> From: Mike Rapoport >>> >>> The mappings created with MAP_EXCLUSIVE are visible only in the context= of >>> 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= the >>> kernel as well. >>> >>> 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. >>> >> >> Just a thought, the kernel is still able to indirectly read the contents= of >> these pages by doing a kdump from kexec environment, right? >=20 > Right. >=20 >> Also, I wonder >> what would happen if you map such pages via /dev/mem into another user s= pace >> application and e.g., use them along with kvm [1]. >=20 > Do you mean that one application creates MAP_EXCLUSIVE and another > applications accesses the same physical pages via /dev/mem? Exactly. >=20 > With /dev/mem all physical memory is visible... Okay, so the statement "information that will not be visible not only to=20 other processes but to the kernel as well" is not correct. There are=20 easy ways to access that information if you really want to (might=20 require root permissions, though). --=20 Thanks, David / dhildenb