提交 9e2760d1 编写于 作者: A Andreas Schwab 提交者: 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: NAndreas Schwab <schwab@linux-m68k.org>
Tested-by: NThorsten Glaser <tg@debian.org>
Signed-off-by: NGeert Uytterhoeven <geert@linux-m68k.org>
Cc: stable@vger.kernel.org
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册