linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Christoph Hellwig <hch@lst.de>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	Andy Lutomirski <luto@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>, Fei Li <fei1.li@intel.com>,
	x86@kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH 1/3] virt: acrn: stop using follow_pfn
Date: Tue, 26 Mar 2024 18:06:50 +0100	[thread overview]
Message-ID: <e0bcac0d-b5bb-4356-aff8-5c077ab4c66f@redhat.com> (raw)
In-Reply-To: <20240326060447.GA7108@lst.de>

On 26.03.24 07:04, Christoph Hellwig wrote:
> On Mon, Mar 25, 2024 at 11:33:31AM +0100, David Hildenbrand wrote:
>> ... I have similar patches lying around here (see bwlow). I added some
>> actual access permission checks.
>>
>> (I also realized, that if we get an anon folio in a COW mapping via follow_pte()
>> here, I suspect one might be able to do some nasty things. Just imagine if we
>> munmap(), free the anon folio, and then it gets used in other context ... At
>> least KVM/vfio handle that using references+MMU notifiers.)
> 
> How about you just send out your series that seems to go further and
> I retract mine?

Let's go with yours first and I'll rebase.

Regarding above issue, I still have not made up my mind: likely we 
should reject any PFN in acrn that has a valid "struct page", and that 
page does not have PG_reserved set. That's what VFIO effectively does IIRC.

-- 
Cheers,

David / dhildenb



  reply	other threads:[~2024-03-26 17:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-24 23:45 remove follow_pfn Christoph Hellwig
2024-03-24 23:45 ` [PATCH 1/3] virt: acrn: stop using follow_pfn Christoph Hellwig
2024-03-25 10:33   ` David Hildenbrand
2024-03-26  6:04     ` Christoph Hellwig
2024-03-26 17:06       ` David Hildenbrand [this message]
2024-03-24 23:45 ` [PATCH 2/3] mm: remove follow_pfn Christoph Hellwig
2024-03-25 10:33   ` David Hildenbrand
2024-03-24 23:45 ` [PATCH 3/3] mm: move follow_phys to arch/x86/mm/pat/memtype.c Christoph Hellwig
2024-03-25 10:28   ` Ingo Molnar
2024-03-25 10:36   ` David Hildenbrand
2024-03-28  8:46 remove follow_pfn v2 Christoph Hellwig
2024-03-28  8:46 ` [PATCH 1/3] virt: acrn: stop using follow_pfn Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e0bcac0d-b5bb-4356-aff8-5c077ab4c66f@redhat.com \
    --to=david@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=dave.hansen@linux.intel.com \
    --cc=fei1.li@intel.com \
    --cc=hch@lst.de \
    --cc=linux-mm@kvack.org \
    --cc=luto@kernel.org \
    --cc=peterz@infradead.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox