lkml.org 
[lkml]   [2021]   [Dec]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [RFC v2 PATCH 01/13] mm/shmem: Introduce F_SEAL_GUEST
From
On 11/19/21 05:47, Chao Peng wrote:
> From: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
>
> The new seal type provides semantics required for KVM guest private
> memory support. A file descriptor with the seal set is going to be used
> as source of guest memory in confidential computing environments such as
> Intel TDX and AMD SEV.
>
> F_SEAL_GUEST can only be set on empty memfd. After the seal is set
> userspace cannot read, write or mmap the memfd.

I don't have a strong objection here, but, given that you're only
supporting it for memfd, would a memfd_create() flag be more
straightforward? If nothing else, it would avoid any possible locking
issue.

I'm also very very slightly nervous about a situation in which one
program sends a memfd to an untrusted other process and that process
truncates the memfd and then F_SEAL_GUESTs it. This could be mostly
mitigated by also requiring that no other seals be set when F_SEAL_GUEST
happens, but the alternative MFD_GUEST would eliminate this issue too.

\
 
 \ /
  Last update: 2021-12-03 02:11    [W:0.181 / U:0.568 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site