Skip to content

Commit

Permalink
m68k: Make sys_atomic_cmpxchg_32 work on classic m68k
Browse files Browse the repository at this point in the history
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>
Cc: stable@vger.kernel.org
  • Loading branch information
Andreas Schwab authored and Geert Uytterhoeven committed Aug 2, 2012
1 parent 1525e06 commit 9e2760d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions arch/m68k/kernel/sys_m68k.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 9e2760d

Please sign in to comment.