From: Andy P. <at...@us...> - 2001-09-02 20:48:42
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel In directory usw-pr-cvs1:/tmp/cvs-serv31965 Modified Files: interrupt.c process.c setup.c signal.c syscall.c Log Message: fix slab.c bug, due to wrong setting of kernel stack pointer in copy_thread add debugging/machine halts to signal and syscall Index: interrupt.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel/interrupt.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- interrupt.c 2001/08/20 21:30:52 1.15 +++ interrupt.c 2001/09/02 20:48:39 1.16 @@ -190,12 +190,17 @@ { printk("\nReserved operand fault at PC=%08lx\n", regs->pc); + printk("\nStack dump\n"); hex_dump((void *)(regs->sp), 256); show_regs(regs); show_cpu_regs(); + if (user_mode(regs)) { + force_sig(SIGILL,current); + return; + } machine_halt(); } @@ -218,6 +223,10 @@ show_regs(regs); show_cpu_regs(); + if (user_mode(regs)) { + force_sig(SIGILL,current); + return; + } machine_halt(); } @@ -345,8 +354,8 @@ /* If the excep_handler field of the irqvector is NULL, then this is an interrupt vector. Dispatch it via the irqaction struct */ - if (vec->excep_handler != NULL) { +// printk("exception: vec=%p handler %p excep_info=%p(%d)\n",vec,vec->excep_handler,excep_info,*(int *)excep_info); do_exception(regs, vec, excep_info); if (vec == scb.scb.chmk) { goto ret_from_sys_call; @@ -377,6 +386,7 @@ } ret_with_reschedule: +// printk("syscall: pid %d need_resched %d sigpending %d state %d\n",current->pid,current->need_resched,current->sigpending,current->state); if (current->need_resched) { schedule(); goto ret_from_sys_call; @@ -385,8 +395,10 @@ /* check for pending signals */ if (current->sigpending != 0) { /* FIXME: do we need to check the IPL here (i386 does a sti here) */ - do_signal(); + /* FIXME: oldset? */ + do_signal(0,regs); } +// printk("syscall: out of c code\n"); done: } Index: process.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel/process.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- process.c 2001/08/17 20:36:30 1.11 +++ process.c 2001/09/02 20:48:39 1.12 @@ -109,13 +109,25 @@ struct new_thread_stack *child_stack; struct pt_regs *child_regs; void *stack_top; + pte_t *spte; -/* printk("copy_thread: creating new thread: pid %d, task 0x%08lx, usp 0x%08lx\n", - p->pid, (unsigned long)p, usp); */ - - stack_top = ((union task_union *)p) + 1; - +// /* Place a guard page on page 3 */ +// spte=GET_SPTE_VIRT(p); +// spte+=2; +// set_pte(spte,pte_modify(*spte,PAGE_KRO)); + + /* stack top is at the end of the task_union + - take the pointer, add in the size of task_union, + and then drop by a longword to keep it within the + current union + */ + stack_top = ((union task_union *)p)+1; + stack_top -= 4; + child_stack = (struct new_thread_stack *)(stack_top) - 1; + +// printk("copy_thread: pid %d, task 0x%08lx, kstack_top 0x%8lx, usp 0x%08lx, ksp 0x%08lx\n", +// p->pid, (unsigned long)p, stack_top, usp, child_stack); child_regs = &child_stack->regs; Index: setup.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel/setup.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- setup.c 2001/08/21 20:06:42 1.12 +++ setup.c 2001/09/02 20:48:39 1.13 @@ -158,6 +158,8 @@ #ifdef __SMP__ setup_smp(); #endif + + pte_ERROR( *(pte_t *)0x80291d80); } Index: signal.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel/signal.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- signal.c 2001/08/27 23:39:28 1.5 +++ signal.c 2001/09/02 20:48:39 1.6 @@ -111,6 +111,8 @@ sigset_t saveset, newset; /* XXX: Don't preclude handling different sized sigset_t's. */ + machine_halt(); + if (sigsetsize != sizeof(sigset_t)) return -EINVAL; @@ -281,6 +283,8 @@ * then frame should be dword aligned here. If it's * not, then the user is trying to mess with us. */ + machine_halt(); + if (((long)frame) & 3) goto badframe; @@ -527,6 +531,7 @@ unsigned long return_ip; int err = 0; + machine_halt(); frame = get_sigframe(ka, regs, sizeof(*frame)); if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) Index: syscall.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel/syscall.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- syscall.c 2001/08/19 10:32:58 1.6 +++ syscall.c 2001/09/02 20:48:39 1.7 @@ -78,8 +78,8 @@ nr_args = *user_ap; } -/* printk("Dispatching syscall %d with %d args\n", chmk_arg, nr_args);*/ - +// printk("Dispatching syscall %d with %d args, regs=%8lx\n", chmk_arg, nr_args,regs); + /* We pass all the user-supplied args plus the pointer to the regs to the syscall function. If the syscall is implemented in the core kernel, then it will ignore the additional |