Re: bug: data corruption introduced by commit 83d116c53058 ("mm: fix double page fault on arm64 if PTE_AF is cleared")

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

 



Hi, Justin,

Justin He <Justin.He@xxxxxxx> writes:
>> Thanks for the report. But this commit 83d116c53058 doesn't add the
>> new clear_page code path. Besides the pte_mkyoung part, It just refines
>> the codes(no functional change) and add a WARN_ON_ONCE to indicate
>> there is any obscure case before.
>
> I can't reproduce it with your provided test file on my arm64 qemu with
> a pmem device.
> Could you do me a favor that just revert 83d116c53058 but keep that
> WARN_ON_ONCE after clear_page()? Is there any difference?
> Thanks for your help

Below is the patch I used to put the WARN_ON_ONCE after the clear_page,
just to be sure that's what you intended.  So with 83d116c53058
reverted, and the below patch applied, the WARN_ON_ONCE does not
trigger.

-Jeff

diff --git a/mm/memory.c b/mm/memory.c
index 3bab0d3976ea..3fea34375c7f 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -2259,8 +2259,10 @@ static inline void cow_user_page(struct page *dst, struct page *src, unsigned lo
 		 * in which case we just give up and fill the result with
 		 * zeroes.
 		 */
-		if (__copy_from_user_inatomic(kaddr, uaddr, PAGE_SIZE))
+		if (__copy_from_user_inatomic(kaddr, uaddr, PAGE_SIZE)) {
+			WARN_ON_ONCE(1);
 			clear_page(kaddr);
+		}
 		kunmap_atomic(kaddr);
 		flush_dcache_page(dst);
 	} else






[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