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

Commit 2e29f50a authored by Al Viro's avatar Al Viro
Browse files

nios2: fix __get_user()



a) should not leave crap on fault
b) should _not_ require access_ok() in any cases.

Cc: stable@vger.kernel.org
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent e33d1f6f
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -142,7 +142,7 @@ extern long strnlen_user(const char __user *s, long n);

#define __get_user_unknown(val, size, ptr, err) do {			\
	err = 0;							\
	if (copy_from_user(&(val), ptr, size)) {			\
	if (__copy_from_user(&(val), ptr, size)) {			\
		err = -EFAULT;						\
	}								\
	} while (0)
@@ -169,7 +169,7 @@ do { \
	({								\
	long __gu_err = -EFAULT;					\
	const __typeof__(*(ptr)) __user *__gu_ptr = (ptr);		\
	unsigned long __gu_val;						\
	unsigned long __gu_val = 0;					\
	__get_user_common(__gu_val, sizeof(*(ptr)), __gu_ptr, __gu_err);\
	(x) = (__force __typeof__(x))__gu_val;				\
	__gu_err;							\