[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZcFwlu9+LQQWWOz4@dread.disaster.area>
Date: Tue, 6 Feb 2024 10:34:46 +1100
From: Dave Chinner <david@...morbit.com>
To: James Gowans <jgowans@...zon.com>
Cc: linux-kernel@...r.kernel.org, Eric Biederman <ebiederm@...ssion.com>,
kexec@...ts.infradead.org, Joerg Roedel <joro@...tes.org>,
Will Deacon <will@...nel.org>, iommu@...ts.linux.dev,
Alexander Viro <viro@...iv.linux.org.uk>,
Christian Brauner <brauner@...nel.org>,
linux-fsdevel@...r.kernel.org, Paolo Bonzini <pbonzini@...hat.com>,
Sean Christopherson <seanjc@...gle.com>, kvm@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>, linux-mm@...ck.org,
Alexander Graf <graf@...zon.com>,
David Woodhouse <dwmw@...zon.co.uk>,
"Jan H . Schoenherr" <jschoenh@...zon.de>,
Usama Arif <usama.arif@...edance.com>,
Anthony Yznaga <anthony.yznaga@...cle.com>,
Stanislav Kinsburskii <skinsburskii@...ux.microsoft.com>,
madvenka@...ux.microsoft.com, steven.sistare@...cle.com,
yuleixzhang@...cent.com
Subject: Re: [RFC 05/18] pkernfs: add file mmap callback
On Mon, Feb 05, 2024 at 12:01:50PM +0000, James Gowans wrote:
> Make the file data useable to userspace by adding mmap. That's all that
> QEMU needs for guest RAM, so that's all be bother implementing for now.
>
> When mmaping the file the VMA is marked as PFNMAP to indicate that there
> are no struct pages for the memory in this VMA. Remap_pfn_range() is
> used to actually populate the page tables. All PTEs are pre-faulted into
> the pgtables at mmap time so that the pgtables are useable when this
> virtual address range is given to VFIO's MAP_DMA.
And so what happens when this file is truncated whilst it is mmap()d
by an application? Ain't that just a great big UAF waiting to be
exploited?
-Dave.
--
Dave Chinner
david@...morbit.com
Powered by blists - more mailing lists