mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 20:07:46 +09:00
m68k: Make sys_atomic_cmpxchg_32 work on classic m68k
commit 9e2760d18b 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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
3b6ae1807d
commit
d3be3eeedb
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user