aboutsummaryrefslogtreecommitdiff
path: root/arch/s390/include/asm
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-03-03 12:58:43 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2013-03-03 12:58:43 -0800
commit530ede14cf63ef4a207b0003e14af2f750484180 (patch)
tree2849be2c8fd6d2d6a8a71447aebe5d7400317c8d /arch/s390/include/asm
parent6977c6fc77b864dc1851e100c8528c2f3ed5bd9b (diff)
parent72a6b43e4bbb818ac1875a3a572cb2aa8c9af820 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
Pull second set of s390 patches from Martin Schwidefsky: "The main part of this merge are Heikos uaccess patches. Together with commit 09884964335e ("mm: do not grow the stack vma just because of an overrun on preceding vma") the user string access is hopefully fixed for good. In addition some bug fixes and two cleanup patches." * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: s390/module: fix compile warning qdio: remove unused parameters s390/uaccess: fix kernel ds access for page table walk s390/uaccess: fix strncpy_from_user string length check input: disable i8042 PC Keyboard controller for s390 s390/dis: Fix invalid array size s390/uaccess: remove pointless access_ok() checks s390/uaccess: fix strncpy_from_user/strnlen_user zero maxlen case s390/uaccess: shorten strncpy_from_user/strnlen_user s390/dasd: fix unresponsive device after all channel paths were lost s390/mm: ignore change bit for vmemmap s390/page table dumper: add support for change-recording override bit
Diffstat (limited to 'arch/s390/include/asm')
-rw-r--r--arch/s390/include/asm/futex.h6
-rw-r--r--arch/s390/include/asm/pgtable.h2
-rw-r--r--arch/s390/include/asm/uaccess.h23
3 files changed, 7 insertions, 24 deletions
diff --git a/arch/s390/include/asm/futex.h b/arch/s390/include/asm/futex.h
index 96bc83ea5c9..51bcaa0fdee 100644
--- a/arch/s390/include/asm/futex.h
+++ b/arch/s390/include/asm/futex.h
@@ -16,9 +16,6 @@ static inline int futex_atomic_op_inuser (int encoded_op, u32 __user *uaddr)
if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28))
oparg = 1 << oparg;
- if (! access_ok (VERIFY_WRITE, uaddr, sizeof(u32)))
- return -EFAULT;
-
pagefault_disable();
ret = uaccess.futex_atomic_op(op, uaddr, oparg, &oldval);
pagefault_enable();
@@ -40,9 +37,6 @@ static inline int futex_atomic_op_inuser (int encoded_op, u32 __user *uaddr)
static inline int futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
u32 oldval, u32 newval)
{
- if (! access_ok (VERIFY_WRITE, uaddr, sizeof(u32)))
- return -EFAULT;
-
return uaccess.futex_atomic_cmpxchg(uval, uaddr, oldval, newval);
}
diff --git a/arch/s390/include/asm/pgtable.h b/arch/s390/include/asm/pgtable.h
index 97de1200c84..4a2930844d4 100644
--- a/arch/s390/include/asm/pgtable.h
+++ b/arch/s390/include/asm/pgtable.h
@@ -340,6 +340,8 @@ extern unsigned long MODULES_END;
#define _REGION3_ENTRY_EMPTY (_REGION_ENTRY_TYPE_R3 | _REGION_ENTRY_INV)
#define _REGION3_ENTRY_LARGE 0x400 /* RTTE-format control, large page */
+#define _REGION3_ENTRY_RO 0x200 /* page protection bit */
+#define _REGION3_ENTRY_CO 0x100 /* change-recording override */
/* Bits in the segment table entry */
#define _SEGMENT_ENTRY_ORIGIN ~0x7ffUL/* segment table origin */
diff --git a/arch/s390/include/asm/uaccess.h b/arch/s390/include/asm/uaccess.h
index 34268df959a..9c33ed4e666 100644
--- a/arch/s390/include/asm/uaccess.h
+++ b/arch/s390/include/asm/uaccess.h
@@ -252,9 +252,7 @@ static inline unsigned long __must_check
copy_to_user(void __user *to, const void *from, unsigned long n)
{
might_fault();
- if (access_ok(VERIFY_WRITE, to, n))
- n = __copy_to_user(to, from, n);
- return n;
+ return __copy_to_user(to, from, n);
}
/**
@@ -315,11 +313,7 @@ copy_from_user(void *to, const void __user *from, unsigned long n)
copy_from_user_overflow();
return n;
}
- if (access_ok(VERIFY_READ, from, n))
- n = __copy_from_user(to, from, n);
- else
- memset(to, 0, n);
- return n;
+ return __copy_from_user(to, from, n);
}
static inline unsigned long __must_check
@@ -332,9 +326,7 @@ static inline unsigned long __must_check
copy_in_user(void __user *to, const void __user *from, unsigned long n)
{
might_fault();
- if (__access_ok(from,n) && __access_ok(to,n))
- n = __copy_in_user(to, from, n);
- return n;
+ return __copy_in_user(to, from, n);
}
/*
@@ -343,11 +335,8 @@ copy_in_user(void __user *to, const void __user *from, unsigned long n)
static inline long __must_check
strncpy_from_user(char *dst, const char __user *src, long count)
{
- long res = -EFAULT;
might_fault();
- if (access_ok(VERIFY_READ, src, 1))
- res = uaccess.strncpy_from_user(count, src, dst);
- return res;
+ return uaccess.strncpy_from_user(count, src, dst);
}
static inline unsigned long
@@ -387,9 +376,7 @@ static inline unsigned long __must_check
clear_user(void __user *to, unsigned long n)
{
might_fault();
- if (access_ok(VERIFY_WRITE, to, n))
- n = uaccess.clear_user(n, to);
- return n;
+ return uaccess.clear_user(n, to);
}
extern int copy_to_user_real(void __user *dest, void *src, size_t count);