Re: [willy@xxxxxxxxxxxxx: Re: [syzbot] [mm?] BUG: Bad page map (7)]

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

 



  #ifndef set_ptes
  /**
   * set_ptes - Map consecutive pages to a contiguous range of addresses.
@@ -231,7 +235,10 @@ static inline void set_ptes(struct mm_struct *mm, unsigned long addr,
  		if (--nr == 0)
  			break;
  		ptep++;
-		pte = __pte(pte_val(pte) + (1UL << PFN_PTE_SHIFT));
+		if (__pte_needs_invert(pte_val(pte)))
+			pte = __pte(pte_val(pte) - (1UL << PFN_PTE_SHIFT));
+		else
+			pte = __pte(pte_val(pte) + (1UL << PFN_PTE_SHIFT));
  	}

Maybe we want some pte_advance() [or similar, you get the spirit] instead?

Leaking this inverted-pte logic into common code really does look nasty.

--
Cheers,

David / dhildenb





[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