All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFD] clear virtual machine memory when virtual machine is turned off
@ 2021-12-02 10:19 fei luo
  2021-12-02 12:47 ` David Hildenbrand
  0 siblings, 1 reply; 7+ messages in thread
From: fei luo @ 2021-12-02 10:19 UTC (permalink / raw)
  To: akpm, mike.kravetz, arnd, linux-kernel, linux-mm, linux-arch

[-- 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 --]

^ permalink raw reply	[flat|nested] 7+ messages in thread
* [RFD] Clear virtual machine memory when virtual machine is turned off
@ 2021-12-02 10:41 fei luo
  0 siblings, 0 replies; 7+ messages in thread
From: fei luo @ 2021-12-02 10:41 UTC (permalink / raw)
  To: mike.kravetz, akpm, arnd, linux-kernel, linux-mm, linux-arch

Hi,

When running the kvm virtual machine in Linux, because the virtual
machine may contain sensitive data, the user may not want this
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 munmap(2) called or when the program exits.

Of course, the page clear operation not only occurs when munmap(2)
called or program exits, but also needs 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?

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-12-03 18:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-02 10:19 [RFD] clear virtual machine memory when virtual machine is turned off fei luo
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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.