@@ -104,11 +104,16 @@ void arch_setup_user_stack (register struct task_struct * t, word_t entry, seg_t
104104 * as we don't have any way of sorting out a return value yet.
105105 */
106106
107- void arch_setup_sighandler_stack (register struct task_struct * t ,
107+ int arch_setup_sighandler_stack (register struct task_struct * t ,
108108 __kern_sighandler_t addr ,unsigned signr )
109109{
110+ segoff_t sp = t -> t_regs .sp ;
111+
110112 debug ("Stack %x:%x was %x %x %x %x\n" , _FP_SEG (addr ), _FP_OFF (addr ),
111113 get_ustack (t ,0 ), get_ustack (t ,2 ), get_ustack (t ,4 ), get_ustack (t ,6 ));
114+
115+ if (sp > t -> t_begstack || sp < t -> t_endbrk + 6 )
116+ return -1 ;
112117 put_ustack (t , -6 , (int )get_ustack (t ,0 ));
113118 put_ustack (t , -4 , _FP_OFF (addr ));
114119 put_ustack (t , -2 , _FP_SEG (addr ));
@@ -118,6 +123,7 @@ void arch_setup_sighandler_stack(register struct task_struct *t,
118123 debug ("Stack is %x %x %x %x %x %x %x\n" , get_ustack (t ,0 ), get_ustack (t ,2 ),
119124 get_ustack (t ,4 ), get_ustack (t ,6 ), get_ustack (t ,8 ), get_ustack (t ,10 ),
120125 get_ustack (t ,12 ));
126+ return 0 ;
121127}
122128
123129/*
0 commit comments