linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: fei luo <morphyluo@gmail.com>
To: akpm@linux-foundation.org, mike.kravetz@oracle.com,
	arnd@arndb.de,  linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	linux-arch@vger.kernel.org
Subject: [RFD] clear virtual machine memory when virtual machine is turned off
Date: Thu, 2 Dec 2021 18:19:38 +0800	[thread overview]
Message-ID: <CAMgLiBskDz7XW9-0=azOgVJ00t8zFOXjdGaH7NLpKDfNH9wsGQ@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 972 bytes --]

Hi,

When running the kvm virtual machine in Linux, because the virtual

machine may contain sensitive data, the user may not want these

data to remain in the memory after the virtual machine is turned off.


Although this part of memory will be cleared before being reused by

user-mode programs , But the sensitive data staying in the memory

for a long time will undoubtedly increase the risk of information leakage,

so I wonder whether it is possible to add a flag (like MAP_UNMAPZERO)

to the mmap(2) system call to indicate that the mapped memory needs

to be cleared zero when unmap called or when the program exits.


Of course, the page clear operation not only occurs when unmap called

or program exits, but also need to consider scenes such as page migration,

swap, balloon etc.


When reusing the page that has been cleared, there is no need to clear it

again, which also speeds up the memory allocation of user-mode programs.


Is this feature feasible?

[-- Attachment #2: Type: text/html, Size: 9391 bytes --]

             reply	other threads:[~2021-12-02 10:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-02 10:19 fei luo [this message]
2021-12-02 12:47 ` David Hildenbrand
2021-12-02 17:27   ` Mike Kravetz
2021-12-03 18:20     ` David Hildenbrand
2021-12-03  2:56   ` fei luo
2021-12-03 18:20     ` David Hildenbrand
2021-12-02 10:41 [RFD] Clear " fei luo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAMgLiBskDz7XW9-0=azOgVJ00t8zFOXjdGaH7NLpKDfNH9wsGQ@mail.gmail.com' \
    --to=morphyluo@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mike.kravetz@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox