linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: futex: fix clobbering oldval
@ 2011-09-22  2:53 mhban
  2011-09-22 17:26 ` Will Deacon
  0 siblings, 1 reply; 8+ messages in thread
From: mhban @ 2011-09-22  2:53 UTC (permalink / raw)
  To: linux-arm-kernel

This patch fixes clobbering oldval bug. oldval should be preserved for next
compare operation.

Change-Id: I2a63bc1bdb8de330eb9e1ac02d7da1f77e6e8c3c
Signed-off-by: Minho Ban <mhban@samsung.com>
---
 arch/arm/include/asm/futex.h |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/include/asm/futex.h b/arch/arm/include/asm/futex.h
index d2d733c..b0f2e8e 100644
--- a/arch/arm/include/asm/futex.h
+++ b/arch/arm/include/asm/futex.h
@@ -30,14 +30,14 @@
 	__asm__ __volatile__(					\
 	"1:	ldrex	%1, [%2]\n"				\
 	"	" insn "\n"					\
-	"2:	strex	%1, %0, [%2]\n"				\
-	"	teq	%1, #0\n"				\
+	"2:	strex	r5, %0, [%2]\n"				\
+	"	teq	r5, #0\n"				\
 	"	bne	1b\n"					\
 	"	mov	%0, #0\n"				\
 	__futex_atomic_ex_table("%4")				\
 	: "=&r" (ret), "=&r" (oldval)				\
 	: "r" (uaddr), "r" (oparg), "Ir" (-EFAULT)		\
-	: "cc", "memory")
+	: "r5", "cc", "memory")
 
 static inline int
 futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
-- 
1.7.0.4

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

end of thread, other threads:[~2011-12-06 21:14 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-22  2:53 [PATCH] ARM: futex: fix clobbering oldval mhban
2011-09-22 17:26 ` Will Deacon
2011-09-23  0:18   ` mhban
2011-09-23  8:43     ` Will Deacon
2011-12-06 18:58   ` Jon Masters
2011-12-06 19:11     ` Will Deacon
2011-12-06 19:38       ` Jon Masters
2011-12-06 21:14         ` Will Deacon

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).