linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm: cmpxchg syscall should data abort if page not write or not young
@ 2011-03-14 10:28 Po-Yu Chuang
  2011-03-14 10:40 ` Russell King - ARM Linux
  2011-03-15  6:13 ` [PATCH v2] arm: cmpxchg syscall should data abort if page not write Po-Yu Chuang
  0 siblings, 2 replies; 11+ messages in thread
From: Po-Yu Chuang @ 2011-03-14 10:28 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: linux-kernel, linux, tony, nicolas.pitre, joe, Po-Yu Chuang

From: Po-Yu Chuang <ratbert@faraday-tech.com>

If the page to cmpxchg is user mode read only (not write)
or invalid (not young), we should simulate a data abort first.

Signed-off-by: Po-Yu Chuang <ratbert@faraday-tech.com>
---
 arch/arm/kernel/traps.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index 446aee9..53c8852 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -563,7 +563,8 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs)
 		if (!pmd_present(*pmd))
 			goto bad_access;
 		pte = pte_offset_map_lock(mm, pmd, addr, &ptl);
-		if (!pte_present(*pte) || !pte_dirty(*pte)) {
+		if (!pte_present(*pte) || !pte_write(*pte) ||
+		    !pte_dirty(*pte) || !pte_young(*pte)) {
 			pte_unmap_unlock(pte, ptl);
 			goto bad_access;
 		}
-- 
1.6.3.3


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2011-03-22  2:44 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-14 10:28 [PATCH] arm: cmpxchg syscall should data abort if page not write or not young Po-Yu Chuang
2011-03-14 10:40 ` Russell King - ARM Linux
2011-03-15  3:07   ` Po-Yu Chuang
2011-03-15  6:13 ` [PATCH v2] arm: cmpxchg syscall should data abort if page not write Po-Yu Chuang
2011-03-17  9:18   ` Po-Yu Chuang
2011-03-17 17:01   ` Nicolas Pitre
2011-03-17 17:37     ` Ashwin Chaugule
2011-03-17 17:57       ` Nicolas Pitre
2011-03-18  8:44         ` Po-Yu Chuang
2011-03-21 20:41           ` Nicolas Pitre
2011-03-22  2:40             ` Po-Yu Chuang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).