Messages in this thread | | | Date | Tue, 8 Feb 2022 09:49:35 +0100 | From | David Hildenbrand <> | Subject | Re: [PATCH v4 02/12] mm/memfd: Introduce MFD_INACCESSIBLE flag |
| |
On 07.02.22 19:51, Vlastimil Babka wrote: > On 1/18/22 14:21, Chao Peng wrote: >> Introduce a new memfd_create() flag indicating the content of the >> created memfd is inaccessible from userspace. It does this by force >> setting F_SEAL_INACCESSIBLE seal when the file is created. It also set >> F_SEAL_SEAL to prevent future sealing, which means, it can not coexist >> with MFD_ALLOW_SEALING. >> >> The pages backed by such memfd will be used as guest private memory in >> confidential computing environments such as Intel TDX/AMD SEV. Since >> page migration/swapping is not yet supported for such usages so these >> pages are currently marked as UNMOVABLE and UNEVICTABLE which makes >> them behave like long-term pinned pages. > > Shouldn't the amount of such memory allocations be restricted? E.g. similar > to secretmem_mmap() doing mlock_future_check().
I've raised this already in the past and Kirill wanted to look into it [1].
We'll most certainly need a way to limit/control the amount of unswappable + unmovable ("worse than mlock" memory) a user/process can consume via this mechanism.
[1] https://lkml.kernel.org/r/20211122135933.arjxpl7wyskkwvwv@box.shutemov.name
-- Thanks,
David / dhildenb
| |