diff options
author | Andreas Schwab <schwab@linux-m68k.org> | 2012-07-27 18:20:34 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-08-09 11:27:53 -0400 |
commit | d3be3eeedbc5b39f93b27c6ece2879c1d417eed5 (patch) | |
tree | 9ffa732a83f67d7b9e671a0ae388f085a656ed6f /arch | |
parent | 3b6ae1807d29f8cacd63fddf513110f9308b4c8e (diff) |
m68k: Make sys_atomic_cmpxchg_32 work on classic m68k
commit 9e2760d18b3cf179534bbc27692c84879c61b97c 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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/m68k/kernel/sys_m68k.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/m68k/kernel/sys_m68k.c b/arch/m68k/kernel/sys_m68k.c index 8623f8dc16f..9a5932ec368 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, | |||
479 | goto bad_access; | 479 | goto bad_access; |
480 | } | 480 | } |
481 | 481 | ||
482 | mem_value = *mem; | 482 | /* |
483 | * No need to check for EFAULT; we know that the page is | ||
484 | * present and writable. | ||
485 | */ | ||
486 | __get_user(mem_value, mem); | ||
483 | if (mem_value == oldval) | 487 | if (mem_value == oldval) |
484 | *mem = newval; | 488 | __put_user(newval, mem); |
485 | 489 | ||
486 | pte_unmap_unlock(pte, ptl); | 490 | pte_unmap_unlock(pte, ptl); |
487 | up_read(&mm->mmap_sem); | 491 | up_read(&mm->mmap_sem); |