Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml

Pull UML fixes from Richard Weinberger:
"Four fixes, all discovered by Trinity"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml:
um: segv: Save regs only in case of a kernel mode fault
um: Fix hung task in fix_range_common()
um: Ensure that a stub page cannot get unmapped
Revert "um: Fix wait_stub_done() error handling"

+11 -9
+8 -1
arch/um/kernel/tlb.c
··· 12 12 #include <mem_user.h> 13 13 #include <os.h> 14 14 #include <skas.h> 15 + #include <kern_util.h> 15 16 16 17 struct host_vm_change { 17 18 struct host_vm_op { ··· 124 123 { 125 124 struct host_vm_op *last; 126 125 int ret = 0; 126 + 127 + if ((addr >= STUB_START) && (addr < STUB_END)) 128 + return -EINVAL; 127 129 128 130 if (hvc->index != 0) { 129 131 last = &hvc->ops[hvc->index - 1]; ··· 287 283 /* This is not an else because ret is modified above */ 288 284 if (ret) { 289 285 printk(KERN_ERR "fix_range_common: failed, killing current " 290 - "process\n"); 286 + "process: %d\n", task_tgid_vnr(current)); 287 + /* We are under mmap_sem, release it such that current can terminate */ 288 + up_write(&current->mm->mmap_sem); 291 289 force_sig(SIGKILL, current); 290 + do_signal(); 292 291 } 293 292 } 294 293
+1 -1
arch/um/kernel/trap.c
··· 206 206 int is_write = FAULT_WRITE(fi); 207 207 unsigned long address = FAULT_ADDRESS(fi); 208 208 209 - if (regs) 209 + if (!is_user && regs) 210 210 current->thread.segv_regs = container_of(regs, struct pt_regs, regs); 211 211 212 212 if (!is_user && (address >= start_vm) && (address < end_vm)) {
+2 -7
arch/um/os-Linux/skas/process.c
··· 54 54 55 55 void wait_stub_done(int pid) 56 56 { 57 - int n, status, err, bad_stop = 0; 57 + int n, status, err; 58 58 59 59 while (1) { 60 60 CATCH_EINTR(n = waitpid(pid, &status, WUNTRACED | __WALL)); ··· 74 74 75 75 if (((1 << WSTOPSIG(status)) & STUB_DONE_MASK) != 0) 76 76 return; 77 - else 78 - bad_stop = 1; 79 77 80 78 bad_wait: 81 79 err = ptrace_dump_regs(pid); ··· 83 85 printk(UM_KERN_ERR "wait_stub_done : failed to wait for SIGTRAP, " 84 86 "pid = %d, n = %d, errno = %d, status = 0x%x\n", pid, n, errno, 85 87 status); 86 - if (bad_stop) 87 - kill(pid, SIGKILL); 88 - else 89 - fatal_sigsegv(); 88 + fatal_sigsegv(); 90 89 } 91 90 92 91 extern unsigned long current_stub_stack(void);