Permalink
Browse files

m68k: Make sys_atomic_cmpxchg_32 work on classic m68k

commit 9e2760d upstream.

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>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
  • Loading branch information...
andreas-schwab authored and bwhacks committed Jul 27, 2012
1 parent 922c979 commit 56c5dc342e25deddf6fdfbed82a1b9d9bc118113
Showing with 6 additions and 2 deletions.
  1. +6 −2 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);

0 comments on commit 56c5dc3

Please sign in to comment.