lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Z9HhTjEWtM58Zfxf@x1.local>
Date: Wed, 12 Mar 2025 15:32:30 -0400
From: Peter Xu <peterx@...hat.com>
To: Nikita Kalyazin <kalyazin@...zon.com>
Cc: James Houghton <jthoughton@...gle.com>, akpm@...ux-foundation.org,
	pbonzini@...hat.com, shuah@...nel.org, kvm@...r.kernel.org,
	linux-kselftest@...r.kernel.org, linux-kernel@...r.kernel.org,
	linux-mm@...ck.org, lorenzo.stoakes@...cle.com, david@...hat.com,
	ryan.roberts@....com, quic_eberman@...cinc.com, graf@...zon.de,
	jgowans@...zon.com, roypat@...zon.co.uk, derekmn@...zon.com,
	nsaenz@...zon.es, xmarcalx@...zon.com
Subject: Re: [RFC PATCH 0/5] KVM: guest_memfd: support for uffd missing

On Wed, Mar 12, 2025 at 05:07:25PM +0000, Nikita Kalyazin wrote:
> However if MISSING is not registered, the kernel will auto-populate with a
> clear page, ie there is no way to inject custom content from userspace.  To
> explain my use case a bit more, the population thread will be trying to copy
> all guest memory proactively, but there will inevitably be cases where a
> page is accessed through pgtables _before_ it gets populated.  It is not
> desirable for such access to result in a clear page provided by the kernel.

IMHO populating with a zero page in the page cache is fine. It needs to
make sure all accesses will go via the pgtable, as discussed below in my
previous email [1], then nobody will be able to see the zero page, not
until someone updates the content then follow up with a CONTINUE to install
the pgtable entry.

If there is any way that the page can be accessed without the pgtable
installation, minor faults won't work indeed.

> 
> > as long as the content can only be accessed from the pgtable (either via
> > mmap() or GUP on top of it), then afaiu it could work similarly like
> > MISSING faults, because anything trying to access it will be trapped.

[1]

-- 
Peter Xu


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ