|
51 | 51 | */ |
52 | 52 | #define VM_FAULT_BADMAP ((__force vm_fault_t)0x40000000) |
53 | 53 | #define VM_FAULT_BADACCESS ((__force vm_fault_t)0x20000000) |
54 | | -#define VM_FAULT_SIGNAL ((__force vm_fault_t)0x10000000) |
55 | 54 |
|
56 | 55 | enum fault_type { |
57 | 56 | KERNEL_FAULT, |
@@ -291,10 +290,6 @@ static void do_fault_error(struct pt_regs *regs, vm_fault_t fault) |
291 | 290 | } |
292 | 291 | do_no_context(regs); |
293 | 292 | break; |
294 | | - case VM_FAULT_SIGNAL: |
295 | | - if (!user_mode(regs)) |
296 | | - do_no_context(regs); |
297 | | - break; |
298 | 293 | default: /* fault & VM_FAULT_ERROR */ |
299 | 294 | if (fault & VM_FAULT_OOM) { |
300 | 295 | if (!user_mode(regs)) |
@@ -393,8 +388,9 @@ static void do_exception(struct pt_regs *regs, int access) |
393 | 388 | count_vm_vma_lock_event(VMA_LOCK_RETRY); |
394 | 389 | /* Quick path to respond to signals */ |
395 | 390 | if (fault_signal_pending(fault, regs)) { |
396 | | - fault = VM_FAULT_SIGNAL; |
397 | | - goto out; |
| 391 | + if (!user_mode(regs)) |
| 392 | + handle_fault_error_nolock(regs); |
| 393 | + return; |
398 | 394 | } |
399 | 395 | lock_mmap: |
400 | 396 | mmap_read_lock(mm); |
@@ -429,10 +425,11 @@ static void do_exception(struct pt_regs *regs, int access) |
429 | 425 | goto out_up; |
430 | 426 | fault = handle_mm_fault(vma, address, flags, regs); |
431 | 427 | if (fault_signal_pending(fault, regs)) { |
432 | | - fault = VM_FAULT_SIGNAL; |
433 | 428 | if (flags & FAULT_FLAG_RETRY_NOWAIT) |
434 | | - goto out_up; |
435 | | - goto out; |
| 429 | + mmap_read_unlock(mm); |
| 430 | + if (!user_mode(regs)) |
| 431 | + handle_fault_error_nolock(regs); |
| 432 | + return; |
436 | 433 | } |
437 | 434 | /* The fault is fully completed (including releasing mmap lock) */ |
438 | 435 | if (fault & VM_FAULT_COMPLETED) { |
|
0 commit comments