From: Po-Yu Chuang <ratbert.chuang@gmail.com>
To: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org, linux@arm.linux.org.uk,
tony@atomide.com, nicolas.pitre@linaro.org, joe@perches.com,
Po-Yu Chuang <ratbert@faraday-tech.com>
Subject: [PATCH] arm: cmpxchg syscall should data abort if page not write or not young
Date: Mon, 14 Mar 2011 18:28:36 +0800 [thread overview]
Message-ID: <1300098516-1601-1-git-send-email-ratbert.chuang@gmail.com> (raw)
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
next reply other threads:[~2011-03-14 10:28 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-14 10:28 Po-Yu Chuang [this message]
2011-03-14 10:40 ` [PATCH] arm: cmpxchg syscall should data abort if page not write or not young 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
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=1300098516-1601-1-git-send-email-ratbert.chuang@gmail.com \
--to=ratbert.chuang@gmail.com \
--cc=joe@perches.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=nicolas.pitre@linaro.org \
--cc=ratbert@faraday-tech.com \
--cc=tony@atomide.com \
/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;
as well as URLs for NNTP newsgroup(s).