* Re: [PATCH] fuse: mark DAX VMA page protections as decrypted [not found] <20260727210718.125872-1-psalian@google.com> @ 2026-08-18 11:38 ` Miklos Szeredi 2026-08-18 13:42 ` Tom Lendacky 0 siblings, 1 reply; 3+ messages in thread From: Miklos Szeredi @ 2026-08-18 11:38 UTC (permalink / raw) To: Punit Salian Cc: linux-fsdevel, linux-kernel, Stefan Hajnoczi, Vivek Goyal, Tom Lendacky, linux-coco, x86 [Cc: Tom Lendacky + lists] On Mon, 27 Jul 2026 at 23:07, Punit Salian <psalian@google.com> wrote: > > In confidential computing guest environments (such as AMD SEV-SNP or > Intel TDX), direct memory access (DAX) mappings between the guest kernel > and host-backed FUSE/virtiofs shared memory regions must be accessed > using shared (decrypted) page protections. > > Modify fuse_dax_mmap() to apply pgprot_decrypted() to vma->vm_page_prot > when establishing FUSE DAX memory mappings. This ensures guest page > table entries for shared DAX buffers are explicitly marked as decrypted, > preventing memory encryption faults when accessing host-shared DAX memory. > > Signed-off-by: Punit Salian <psalian@google.com> > --- > fs/fuse/dax.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/fs/fuse/dax.c b/fs/fuse/dax.c > index a15c464c8d19..00e316a7f805 100644 > --- a/fs/fuse/dax.c > +++ b/fs/fuse/dax.c > @@ -826,6 +826,7 @@ int fuse_dax_mmap(struct file *file, struct vm_area_struct *vma) > file_accessed(file); > vma->vm_ops = &fuse_dax_vm_ops; > vm_flags_set(vma, VM_MIXEDMAP | VM_HUGEPAGE); > + vma->vm_page_prot = pgprot_decrypted(vma->vm_page_prot); > > return 0; > } > -- Needs review from someone understanding this technology. Thanks, Miklos ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] fuse: mark DAX VMA page protections as decrypted 2026-08-18 11:38 ` [PATCH] fuse: mark DAX VMA page protections as decrypted Miklos Szeredi @ 2026-08-18 13:42 ` Tom Lendacky 2026-08-18 16:00 ` Gupta, Pankaj 0 siblings, 1 reply; 3+ messages in thread From: Tom Lendacky @ 2026-08-18 13:42 UTC (permalink / raw) To: Miklos Szeredi, Punit Salian, Pankaj Gupta Cc: linux-fsdevel, linux-kernel, Stefan Hajnoczi, Vivek Goyal, linux-coco, x86 On 8/18/26 06:38, Miklos Szeredi wrote: > [Cc: Tom Lendacky + lists] Adding @Pankaj Gupta to take a look. Thanks, Tom > > On Mon, 27 Jul 2026 at 23:07, Punit Salian <psalian@google.com> wrote: >> >> In confidential computing guest environments (such as AMD SEV-SNP or >> Intel TDX), direct memory access (DAX) mappings between the guest kernel >> and host-backed FUSE/virtiofs shared memory regions must be accessed >> using shared (decrypted) page protections. >> >> Modify fuse_dax_mmap() to apply pgprot_decrypted() to vma->vm_page_prot >> when establishing FUSE DAX memory mappings. This ensures guest page >> table entries for shared DAX buffers are explicitly marked as decrypted, >> preventing memory encryption faults when accessing host-shared DAX memory. >> >> Signed-off-by: Punit Salian <psalian@google.com> >> --- >> fs/fuse/dax.c | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/fs/fuse/dax.c b/fs/fuse/dax.c >> index a15c464c8d19..00e316a7f805 100644 >> --- a/fs/fuse/dax.c >> +++ b/fs/fuse/dax.c >> @@ -826,6 +826,7 @@ int fuse_dax_mmap(struct file *file, struct vm_area_struct *vma) >> file_accessed(file); >> vma->vm_ops = &fuse_dax_vm_ops; >> vm_flags_set(vma, VM_MIXEDMAP | VM_HUGEPAGE); >> + vma->vm_page_prot = pgprot_decrypted(vma->vm_page_prot); >> >> return 0; >> } >> -- > > Needs review from someone understanding this technology. > > Thanks, > Miklos ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] fuse: mark DAX VMA page protections as decrypted 2026-08-18 13:42 ` Tom Lendacky @ 2026-08-18 16:00 ` Gupta, Pankaj 0 siblings, 0 replies; 3+ messages in thread From: Gupta, Pankaj @ 2026-08-18 16:00 UTC (permalink / raw) To: Tom Lendacky, Miklos Szeredi, Punit Salian Cc: linux-fsdevel, linux-kernel, Stefan Hajnoczi, Vivek Goyal, linux-coco, x86 >>> In confidential computing guest environments (such as AMD SEV-SNP or >>> Intel TDX), direct memory access (DAX) mappings between the guest kernel >>> and host-backed FUSE/virtiofs shared memory regions must be accessed >>> using shared (decrypted) page protections. >>> >>> Modify fuse_dax_mmap() to apply pgprot_decrypted() to vma->vm_page_prot >>> when establishing FUSE DAX memory mappings. This ensures guest page >>> table entries for shared DAX buffers are explicitly marked as decrypted, >>> preventing memory encryption faults when accessing host-shared DAX memory. >>> >>> Signed-off-by: Punit Salian <psalian@google.com> >>> --- >>> fs/fuse/dax.c | 1 + >>> 1 file changed, 1 insertion(+) >>> >>> diff --git a/fs/fuse/dax.c b/fs/fuse/dax.c >>> index a15c464c8d19..00e316a7f805 100644 >>> --- a/fs/fuse/dax.c >>> +++ b/fs/fuse/dax.c >>> @@ -826,6 +826,7 @@ int fuse_dax_mmap(struct file *file, struct vm_area_struct *vma) >>> file_accessed(file); >>> vma->vm_ops = &fuse_dax_vm_ops; >>> vm_flags_set(vma, VM_MIXEDMAP | VM_HUGEPAGE); >>> + vma->vm_page_prot = pgprot_decrypted(vma->vm_page_prot); For virtio-pmem on host with SEV support we addressed similar issue by marking FS DAX device memory decrypted in memremap_pages() (commit 867400af90f1, "mm/memremap.c: map FS_DAX device memory as decrypted"), since the device memory is mapped though the kernel address space there. For virtio-fs DAX we don't seem to have such a central location so VMA level handling seems reasonable fix to me. That said, I'm not entirely certain about all of the security implications in a CoCo environment, given that the host is generally considered untrusted and virtio-fs involves sharing host-backed memory with the guest. Till we get some mechanism to access this memory as encrypted, we can have this support with existing security practices for virtio-fs: Acked-by: Pankaj Gupta <pankaj.gupta@amd.com> ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-08-18 16:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20260727210718.125872-1-psalian@google.com>
2026-08-18 11:38 ` [PATCH] fuse: mark DAX VMA page protections as decrypted Miklos Szeredi
2026-08-18 13:42 ` Tom Lendacky
2026-08-18 16:00 ` Gupta, Pankaj
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox