Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -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);