aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2009-06-12 04:26:32 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2009-06-12 04:27:33 -0400
commitdab4079d5b5ac421208499d5e554a07f9beb16e4 (patch)
treee606a64c14ebaa1c78b695abeaf4ad664a6789ea /arch/s390
parent205d7ab9c9af6847dda30650a0b8f98555a20654 (diff)
[S390] uaccess: use might_fault() instead of might_sleep()
Adds more checking in case lockdep is turned on. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390')
-rw-r--r--arch/s390/include/asm/uaccess.h16
-rw-r--r--arch/s390/kvm/kvm-s390.c2
2 files changed, 9 insertions, 9 deletions
diff --git a/arch/s390/include/asm/uaccess.h b/arch/s390/include/asm/uaccess.h
index 0235970278f0..8377e91533d2 100644
--- a/arch/s390/include/asm/uaccess.h
+++ b/arch/s390/include/asm/uaccess.h
@@ -131,7 +131,7 @@ static inline int __get_user_fn(size_t size, const void __user *ptr, void *x)
131 131
132#define put_user(x, ptr) \ 132#define put_user(x, ptr) \
133({ \ 133({ \
134 might_sleep(); \ 134 might_fault(); \
135 __put_user(x, ptr); \ 135 __put_user(x, ptr); \
136}) 136})
137 137
@@ -180,7 +180,7 @@ extern int __put_user_bad(void) __attribute__((noreturn));
180 180
181#define get_user(x, ptr) \ 181#define get_user(x, ptr) \
182({ \ 182({ \
183 might_sleep(); \ 183 might_fault(); \
184 __get_user(x, ptr); \ 184 __get_user(x, ptr); \
185}) 185})
186 186
@@ -231,7 +231,7 @@ __copy_to_user(void __user *to, const void *from, unsigned long n)
231static inline unsigned long __must_check 231static inline unsigned long __must_check
232copy_to_user(void __user *to, const void *from, unsigned long n) 232copy_to_user(void __user *to, const void *from, unsigned long n)
233{ 233{
234 might_sleep(); 234 might_fault();
235 if (access_ok(VERIFY_WRITE, to, n)) 235 if (access_ok(VERIFY_WRITE, to, n))
236 n = __copy_to_user(to, from, n); 236 n = __copy_to_user(to, from, n);
237 return n; 237 return n;
@@ -282,7 +282,7 @@ __copy_from_user(void *to, const void __user *from, unsigned long n)
282static inline unsigned long __must_check 282static inline unsigned long __must_check
283copy_from_user(void *to, const void __user *from, unsigned long n) 283copy_from_user(void *to, const void __user *from, unsigned long n)
284{ 284{
285 might_sleep(); 285 might_fault();
286 if (access_ok(VERIFY_READ, from, n)) 286 if (access_ok(VERIFY_READ, from, n))
287 n = __copy_from_user(to, from, n); 287 n = __copy_from_user(to, from, n);
288 else 288 else
@@ -299,7 +299,7 @@ __copy_in_user(void __user *to, const void __user *from, unsigned long n)
299static inline unsigned long __must_check 299static inline unsigned long __must_check
300copy_in_user(void __user *to, const void __user *from, unsigned long n) 300copy_in_user(void __user *to, const void __user *from, unsigned long n)
301{ 301{
302 might_sleep(); 302 might_fault();
303 if (__access_ok(from,n) && __access_ok(to,n)) 303 if (__access_ok(from,n) && __access_ok(to,n))
304 n = __copy_in_user(to, from, n); 304 n = __copy_in_user(to, from, n);
305 return n; 305 return n;
@@ -312,7 +312,7 @@ static inline long __must_check
312strncpy_from_user(char *dst, const char __user *src, long count) 312strncpy_from_user(char *dst, const char __user *src, long count)
313{ 313{
314 long res = -EFAULT; 314 long res = -EFAULT;
315 might_sleep(); 315 might_fault();
316 if (access_ok(VERIFY_READ, src, 1)) 316 if (access_ok(VERIFY_READ, src, 1))
317 res = uaccess.strncpy_from_user(count, src, dst); 317 res = uaccess.strncpy_from_user(count, src, dst);
318 return res; 318 return res;
@@ -321,7 +321,7 @@ strncpy_from_user(char *dst, const char __user *src, long count)
321static inline unsigned long 321static inline unsigned long
322strnlen_user(const char __user * src, unsigned long n) 322strnlen_user(const char __user * src, unsigned long n)
323{ 323{
324 might_sleep(); 324 might_fault();
325 return uaccess.strnlen_user(n, src); 325 return uaccess.strnlen_user(n, src);
326} 326}
327 327
@@ -354,7 +354,7 @@ __clear_user(void __user *to, unsigned long n)
354static inline unsigned long __must_check 354static inline unsigned long __must_check
355clear_user(void __user *to, unsigned long n) 355clear_user(void __user *to, unsigned long n)
356{ 356{
357 might_sleep(); 357 might_fault();
358 if (access_ok(VERIFY_WRITE, to, n)) 358 if (access_ok(VERIFY_WRITE, to, n))
359 n = uaccess.clear_user(n, to); 359 n = uaccess.clear_user(n, to);
360 return n; 360 return n;
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index 10bccd1f8aee..c18b21d6991c 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -512,7 +512,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
512 BUG(); 512 BUG();
513 } 513 }
514 514
515 might_sleep(); 515 might_fault();
516 516
517 do { 517 do {
518 __vcpu_run(vcpu); 518 __vcpu_run(vcpu);