summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@linux-m68k.org>2012-07-28 00:20:34 +0200
committerGeert Uytterhoeven <geert@linux-m68k.org>2012-08-03 00:48:24 +0200
commit9e2760d18b3cf179534bbc27692c84879c61b97c (patch)
tree2b2b308f8ff8db41b3ecec941f3f5caf1aac62e8 /arch
parent1525e06e4414dbe053ea10cbd8cc03bb150e8e27 (diff)
downloadlinux-9e2760d18b3cf179534bbc27692c84879c61b97c.tar.bz2
m68k: Make sys_atomic_cmpxchg_32 work on classic m68k
User space access must always go through uaccess accessors, since on classic m68k user space and kernel space are completely separate. Signed-off-by: Andreas Schwab <schwab@linux-m68k.org> Tested-by: Thorsten Glaser <tg@debian.org> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Cc: stable@vger.kernel.org
Diffstat (limited to 'arch')
-rw-r--r--arch/m68k/kernel/sys_m68k.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/m68k/kernel/sys_m68k.c b/arch/m68k/kernel/sys_m68k.c
index 8623f8dc16f8..9a5932ec3689 100644
--- a/arch/m68k/kernel/sys_m68k.c
+++ b/arch/m68k/kernel/sys_m68k.c
@@ -479,9 +479,13 @@ sys_atomic_cmpxchg_32(unsigned long newval, int oldval, int d3, int d4, int d5,
goto bad_access;
}
- mem_value = *mem;
+ /*
+ * No need to check for EFAULT; we know that the page is
+ * present and writable.
+ */
+ __get_user(mem_value, mem);
if (mem_value == oldval)
- *mem = newval;
+ __put_user(newval, mem);
pte_unmap_unlock(pte, ptl);
up_read(&mm->mmap_sem);