Re: [RFC PATCH 4/5] mm: add do_set_pte_entry()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jan 30, 2023 at 08:55:03PM +0800, Yin Fengwei wrote:
> +++ b/include/linux/mm.h
> @@ -1061,6 +1061,8 @@ static inline pte_t maybe_mkwrite(pte_t pte, struct vm_area_struct *vma)
>  
>  vm_fault_t do_set_pmd(struct vm_fault *vmf, struct page *page);
>  void do_set_pte(struct vm_fault *vmf, struct page *page, unsigned long addr);
> +void do_set_pte_entry(struct vm_fault *vmf, struct page *page,
> +	 unsigned long addr);

indentation

> -void do_set_pte(struct vm_fault *vmf, struct page *page, unsigned long addr)
> +void do_set_pte_entry(struct vm_fault *vmf, struct page *page,
> +	unsigned long addr)

ditto

>  {
>  	struct vm_area_struct *vma = vmf->vma;
>  	bool uffd_wp = pte_marker_uffd_wp(vmf->orig_pte);
> @@ -4276,6 +4277,16 @@ void do_set_pte(struct vm_fault *vmf, struct page *page, unsigned long addr)
>  		entry = maybe_mkwrite(pte_mkdirty(entry), vma);
>  	if (unlikely(uffd_wp))
>  		entry = pte_mkuffd_wp(entry);
> +	set_pte_at(vma->vm_mm, addr, vmf->pte, entry);

I'm not sure this is safe.  As soon as you call set_pte_at(), the page
can be found by GUP.  If it is, and it doesn't have rmap set up, aren't
things going to go horribly wrong?





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux