Commit 9e2760d1 authored by Andreas Schwab's avatar Andreas Schwab Committed by Geert Uytterhoeven

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: default avatarAndreas Schwab <schwab@linux-m68k.org>
Tested-by: default avatarThorsten Glaser <tg@debian.org>
Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Cc: stable@vger.kernel.org
parent 1525e06e
...@@ -479,9 +479,13 @@ sys_atomic_cmpxchg_32(unsigned long newval, int oldval, int d3, int d4, int d5, ...@@ -479,9 +479,13 @@ sys_atomic_cmpxchg_32(unsigned long newval, int oldval, int d3, int d4, int d5,
goto bad_access; 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) if (mem_value == oldval)
*mem = newval; __put_user(newval, mem);
pte_unmap_unlock(pte, ptl); pte_unmap_unlock(pte, ptl);
up_read(&mm->mmap_sem); up_read(&mm->mmap_sem);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment