mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	signal: Remove task parameter from force_sig
All of the remaining callers pass current into force_sig so remove the task parameter to make this obvious and to make misuse more difficult in the future. This also makes it clear force_sig passes current into force_sig_info. Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
This commit is contained in:
		
							parent
							
								
									cb44c9a0ab
								
							
						
					
					
						commit
						3cf5d076fb
					
				
					 76 changed files with 160 additions and 166 deletions
				
			
		| 
						 | 
					@ -225,7 +225,7 @@ do_sigreturn(struct sigcontext __user *sc)
 | 
				
			||||||
	return;
 | 
						return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
give_sigsegv:
 | 
					give_sigsegv:
 | 
				
			||||||
	force_sig(SIGSEGV, current);
 | 
						force_sig(SIGSEGV);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
asmlinkage void
 | 
					asmlinkage void
 | 
				
			||||||
| 
						 | 
					@ -253,7 +253,7 @@ do_rt_sigreturn(struct rt_sigframe __user *frame)
 | 
				
			||||||
	return;
 | 
						return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
give_sigsegv:
 | 
					give_sigsegv:
 | 
				
			||||||
	force_sig(SIGSEGV, current);
 | 
						force_sig(SIGSEGV);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -100,7 +100,7 @@ SYSCALL_DEFINE3(arc_usr_cmpxchg, int *, uaddr, int, expected, int, new)
 | 
				
			||||||
		 goto again;
 | 
							 goto again;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
fail:
 | 
					fail:
 | 
				
			||||||
	force_sig(SIGSEGV, current);
 | 
						force_sig(SIGSEGV);
 | 
				
			||||||
	return ret;
 | 
						return ret;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -197,7 +197,7 @@ SYSCALL_DEFINE0(rt_sigreturn)
 | 
				
			||||||
	return regs->r0;
 | 
						return regs->r0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
badframe:
 | 
					badframe:
 | 
				
			||||||
	force_sig(SIGSEGV, current);
 | 
						force_sig(SIGSEGV);
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -250,7 +250,7 @@ asmlinkage int sys_sigreturn(struct pt_regs *regs)
 | 
				
			||||||
	return regs->ARM_r0;
 | 
						return regs->ARM_r0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
badframe:
 | 
					badframe:
 | 
				
			||||||
	force_sig(SIGSEGV, current);
 | 
						force_sig(SIGSEGV);
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -283,7 +283,7 @@ asmlinkage int sys_rt_sigreturn(struct pt_regs *regs)
 | 
				
			||||||
	return regs->ARM_r0;
 | 
						return regs->ARM_r0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
badframe:
 | 
					badframe:
 | 
				
			||||||
	force_sig(SIGSEGV, current);
 | 
						force_sig(SIGSEGV);
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -257,7 +257,7 @@ void arm64_force_sig_fault(int signo, int code, void __user *addr,
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	arm64_show_signal(signo, str);
 | 
						arm64_show_signal(signo, str);
 | 
				
			||||||
	if (signo == SIGKILL)
 | 
						if (signo == SIGKILL)
 | 
				
			||||||
		force_sig(SIGKILL, current);
 | 
							force_sig(SIGKILL);
 | 
				
			||||||
	else
 | 
						else
 | 
				
			||||||
		force_sig_fault(signo, code, addr, current);
 | 
							force_sig_fault(signo, code, addr, current);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -93,7 +93,7 @@ asmlinkage int do_rt_sigreturn(struct pt_regs *regs)
 | 
				
			||||||
	return regs->a4;
 | 
						return regs->a4;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
badframe:
 | 
					badframe:
 | 
				
			||||||
	force_sig(SIGSEGV, current);
 | 
						force_sig(SIGSEGV);
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -61,7 +61,6 @@ SYSCALL_DEFINE0(rt_sigreturn)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct pt_regs *regs = current_pt_regs();
 | 
						struct pt_regs *regs = current_pt_regs();
 | 
				
			||||||
	struct rt_sigframe __user *frame;
 | 
						struct rt_sigframe __user *frame;
 | 
				
			||||||
	struct task_struct *task;
 | 
					 | 
				
			||||||
	sigset_t set;
 | 
						sigset_t set;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* Always make any pending restarted system calls return -EINTR */
 | 
						/* Always make any pending restarted system calls return -EINTR */
 | 
				
			||||||
| 
						 | 
					@ -86,8 +85,7 @@ SYSCALL_DEFINE0(rt_sigreturn)
 | 
				
			||||||
	return regs->a0;
 | 
						return regs->a0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
badframe:
 | 
					badframe:
 | 
				
			||||||
	task = current;
 | 
						force_sig(SIGSEGV);
 | 
				
			||||||
	force_sig(SIGSEGV, task);
 | 
					 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -250,7 +250,7 @@ asmlinkage void trace_trap(unsigned long bp)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	if ((unsigned long)current->thread.breakinfo.addr == bp) {
 | 
						if ((unsigned long)current->thread.breakinfo.addr == bp) {
 | 
				
			||||||
		user_disable_single_step(current);
 | 
							user_disable_single_step(current);
 | 
				
			||||||
		force_sig(SIGTRAP, current);
 | 
							force_sig(SIGTRAP);
 | 
				
			||||||
	} else
 | 
						} else
 | 
				
			||||||
		force_sig(SIGILL, current);
 | 
							force_sig(SIGILL);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -40,5 +40,5 @@ void user_enable_single_step(struct task_struct *child)
 | 
				
			||||||
asmlinkage void trace_trap(unsigned long bp)
 | 
					asmlinkage void trace_trap(unsigned long bp)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	(void)bp;
 | 
						(void)bp;
 | 
				
			||||||
	force_sig(SIGTRAP, current);
 | 
						force_sig(SIGTRAP);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -126,7 +126,7 @@ asmlinkage int sys_rt_sigreturn(void)
 | 
				
			||||||
	return er0;
 | 
						return er0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
badframe:
 | 
					badframe:
 | 
				
			||||||
	force_sig(SIGSEGV, current);
 | 
						force_sig(SIGSEGV);
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -265,6 +265,6 @@ asmlinkage int sys_rt_sigreturn(void)
 | 
				
			||||||
	return regs->r00;
 | 
						return regs->r00;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
badframe:
 | 
					badframe:
 | 
				
			||||||
	force_sig(SIGSEGV, current);
 | 
						force_sig(SIGSEGV);
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -252,7 +252,7 @@ int die_if_kernel(char *str, struct pt_regs *regs, long err)
 | 
				
			||||||
static void misaligned_instruction(struct pt_regs *regs)
 | 
					static void misaligned_instruction(struct pt_regs *regs)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	die_if_kernel("Misaligned Instruction", regs, 0);
 | 
						die_if_kernel("Misaligned Instruction", regs, 0);
 | 
				
			||||||
	force_sig(SIGBUS, current);
 | 
						force_sig(SIGBUS);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
| 
						 | 
					@ -263,19 +263,19 @@ static void misaligned_instruction(struct pt_regs *regs)
 | 
				
			||||||
static void misaligned_data_load(struct pt_regs *regs)
 | 
					static void misaligned_data_load(struct pt_regs *regs)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	die_if_kernel("Misaligned Data Load", regs, 0);
 | 
						die_if_kernel("Misaligned Data Load", regs, 0);
 | 
				
			||||||
	force_sig(SIGBUS, current);
 | 
						force_sig(SIGBUS);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void misaligned_data_store(struct pt_regs *regs)
 | 
					static void misaligned_data_store(struct pt_regs *regs)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	die_if_kernel("Misaligned Data Store", regs, 0);
 | 
						die_if_kernel("Misaligned Data Store", regs, 0);
 | 
				
			||||||
	force_sig(SIGBUS, current);
 | 
						force_sig(SIGBUS);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void illegal_instruction(struct pt_regs *regs)
 | 
					static void illegal_instruction(struct pt_regs *regs)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	die_if_kernel("Illegal Instruction", regs, 0);
 | 
						die_if_kernel("Illegal Instruction", regs, 0);
 | 
				
			||||||
	force_sig(SIGILL, current);
 | 
						force_sig(SIGILL);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
| 
						 | 
					@ -285,7 +285,7 @@ static void illegal_instruction(struct pt_regs *regs)
 | 
				
			||||||
static void precise_bus_error(struct pt_regs *regs)
 | 
					static void precise_bus_error(struct pt_regs *regs)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	die_if_kernel("Precise Bus Error", regs, 0);
 | 
						die_if_kernel("Precise Bus Error", regs, 0);
 | 
				
			||||||
	force_sig(SIGBUS, current);
 | 
						force_sig(SIGBUS);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -152,7 +152,7 @@ ia64_rt_sigreturn (struct sigscratch *scr)
 | 
				
			||||||
	return retval;
 | 
						return retval;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  give_sigsegv:
 | 
					  give_sigsegv:
 | 
				
			||||||
	force_sig(SIGSEGV, current);
 | 
						force_sig(SIGSEGV);
 | 
				
			||||||
	return retval;
 | 
						return retval;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -589,14 +589,14 @@ ia64_fault (unsigned long vector, unsigned long isr, unsigned long ifa,
 | 
				
			||||||
		printk(KERN_ERR "Unexpected IA-32 exception (Trap 45)\n");
 | 
							printk(KERN_ERR "Unexpected IA-32 exception (Trap 45)\n");
 | 
				
			||||||
		printk(KERN_ERR "  iip - 0x%lx, ifa - 0x%lx, isr - 0x%lx\n",
 | 
							printk(KERN_ERR "  iip - 0x%lx, ifa - 0x%lx, isr - 0x%lx\n",
 | 
				
			||||||
		       iip, ifa, isr);
 | 
							       iip, ifa, isr);
 | 
				
			||||||
		force_sig(SIGSEGV, current);
 | 
							force_sig(SIGSEGV);
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	      case 46:
 | 
						      case 46:
 | 
				
			||||||
		printk(KERN_ERR "Unexpected IA-32 intercept trap (Trap 46)\n");
 | 
							printk(KERN_ERR "Unexpected IA-32 intercept trap (Trap 46)\n");
 | 
				
			||||||
		printk(KERN_ERR "  iip - 0x%lx, ifa - 0x%lx, isr - 0x%lx, iim - 0x%lx\n",
 | 
							printk(KERN_ERR "  iip - 0x%lx, ifa - 0x%lx, isr - 0x%lx, iim - 0x%lx\n",
 | 
				
			||||||
		       iip, ifa, isr, iim);
 | 
							       iip, ifa, isr, iim);
 | 
				
			||||||
		force_sig(SIGSEGV, current);
 | 
							force_sig(SIGSEGV);
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	      case 47:
 | 
						      case 47:
 | 
				
			||||||
| 
						 | 
					@ -608,5 +608,5 @@ ia64_fault (unsigned long vector, unsigned long isr, unsigned long ifa,
 | 
				
			||||||
		break;
 | 
							break;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if (!die_if_kernel(buf, ®s, error))
 | 
						if (!die_if_kernel(buf, ®s, error))
 | 
				
			||||||
		force_sig(SIGILL, current);
 | 
							force_sig(SIGILL);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -803,7 +803,7 @@ asmlinkage int do_sigreturn(struct pt_regs *regs, struct switch_stack *sw)
 | 
				
			||||||
	return regs->d0;
 | 
						return regs->d0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
badframe:
 | 
					badframe:
 | 
				
			||||||
	force_sig(SIGSEGV, current);
 | 
						force_sig(SIGSEGV);
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -825,7 +825,7 @@ asmlinkage int do_rt_sigreturn(struct pt_regs *regs, struct switch_stack *sw)
 | 
				
			||||||
	return regs->d0;
 | 
						return regs->d0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
badframe:
 | 
					badframe:
 | 
				
			||||||
	force_sig(SIGSEGV, current);
 | 
						force_sig(SIGSEGV);
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -431,7 +431,7 @@ static inline void bus_error030 (struct frame *fp)
 | 
				
			||||||
			pr_err("BAD KERNEL BUSERR\n");
 | 
								pr_err("BAD KERNEL BUSERR\n");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			die_if_kernel("Oops", &fp->ptregs,0);
 | 
								die_if_kernel("Oops", &fp->ptregs,0);
 | 
				
			||||||
			force_sig(SIGKILL, current);
 | 
								force_sig(SIGKILL);
 | 
				
			||||||
			return;
 | 
								return;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
| 
						 | 
					@ -463,7 +463,7 @@ static inline void bus_error030 (struct frame *fp)
 | 
				
			||||||
				 !(ssw & RW) ? "write" : "read", addr,
 | 
									 !(ssw & RW) ? "write" : "read", addr,
 | 
				
			||||||
				 fp->ptregs.pc);
 | 
									 fp->ptregs.pc);
 | 
				
			||||||
			die_if_kernel ("Oops", &fp->ptregs, buserr_type);
 | 
								die_if_kernel ("Oops", &fp->ptregs, buserr_type);
 | 
				
			||||||
			force_sig (SIGBUS, current);
 | 
								force_sig (SIGBUS);
 | 
				
			||||||
			return;
 | 
								return;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -493,7 +493,7 @@ static inline void bus_error030 (struct frame *fp)
 | 
				
			||||||
			do_page_fault (&fp->ptregs, addr, 0);
 | 
								do_page_fault (&fp->ptregs, addr, 0);
 | 
				
			||||||
       } else {
 | 
					       } else {
 | 
				
			||||||
		pr_debug("protection fault on insn access (segv).\n");
 | 
							pr_debug("protection fault on insn access (segv).\n");
 | 
				
			||||||
		force_sig (SIGSEGV, current);
 | 
							force_sig (SIGSEGV);
 | 
				
			||||||
       }
 | 
					       }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
| 
						 | 
					@ -571,7 +571,7 @@ static inline void bus_error030 (struct frame *fp)
 | 
				
			||||||
			       !(ssw & RW) ? "write" : "read", addr,
 | 
								       !(ssw & RW) ? "write" : "read", addr,
 | 
				
			||||||
			       fp->ptregs.pc);
 | 
								       fp->ptregs.pc);
 | 
				
			||||||
			die_if_kernel("Oops",&fp->ptregs,mmusr);
 | 
								die_if_kernel("Oops",&fp->ptregs,mmusr);
 | 
				
			||||||
			force_sig(SIGSEGV, current);
 | 
								force_sig(SIGSEGV);
 | 
				
			||||||
			return;
 | 
								return;
 | 
				
			||||||
		} else {
 | 
							} else {
 | 
				
			||||||
#if 0
 | 
					#if 0
 | 
				
			||||||
| 
						 | 
					@ -598,7 +598,7 @@ static inline void bus_error030 (struct frame *fp)
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
			pr_debug("Unknown SIGSEGV - 1\n");
 | 
								pr_debug("Unknown SIGSEGV - 1\n");
 | 
				
			||||||
			die_if_kernel("Oops",&fp->ptregs,mmusr);
 | 
								die_if_kernel("Oops",&fp->ptregs,mmusr);
 | 
				
			||||||
			force_sig(SIGSEGV, current);
 | 
								force_sig(SIGSEGV);
 | 
				
			||||||
			return;
 | 
								return;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -621,7 +621,7 @@ static inline void bus_error030 (struct frame *fp)
 | 
				
			||||||
	buserr:
 | 
						buserr:
 | 
				
			||||||
		pr_err("BAD KERNEL BUSERR\n");
 | 
							pr_err("BAD KERNEL BUSERR\n");
 | 
				
			||||||
		die_if_kernel("Oops",&fp->ptregs,0);
 | 
							die_if_kernel("Oops",&fp->ptregs,0);
 | 
				
			||||||
		force_sig(SIGKILL, current);
 | 
							force_sig(SIGKILL);
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -660,7 +660,7 @@ static inline void bus_error030 (struct frame *fp)
 | 
				
			||||||
			addr, fp->ptregs.pc);
 | 
								addr, fp->ptregs.pc);
 | 
				
			||||||
		pr_debug("Unknown SIGSEGV - 2\n");
 | 
							pr_debug("Unknown SIGSEGV - 2\n");
 | 
				
			||||||
		die_if_kernel("Oops",&fp->ptregs,mmusr);
 | 
							die_if_kernel("Oops",&fp->ptregs,mmusr);
 | 
				
			||||||
		force_sig(SIGSEGV, current);
 | 
							force_sig(SIGSEGV);
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -804,7 +804,7 @@ asmlinkage void buserr_c(struct frame *fp)
 | 
				
			||||||
	default:
 | 
						default:
 | 
				
			||||||
	  die_if_kernel("bad frame format",&fp->ptregs,0);
 | 
						  die_if_kernel("bad frame format",&fp->ptregs,0);
 | 
				
			||||||
	  pr_debug("Unknown SIGSEGV - 4\n");
 | 
						  pr_debug("Unknown SIGSEGV - 4\n");
 | 
				
			||||||
	  force_sig(SIGSEGV, current);
 | 
						  force_sig(SIGSEGV);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -108,7 +108,7 @@ asmlinkage long sys_rt_sigreturn(struct pt_regs *regs)
 | 
				
			||||||
	return rval;
 | 
						return rval;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
badframe:
 | 
					badframe:
 | 
				
			||||||
	force_sig(SIGSEGV, current);
 | 
						force_sig(SIGSEGV);
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -32,7 +32,7 @@ int __isa_exception_epc(struct pt_regs *regs)
 | 
				
			||||||
	/* Calculate exception PC in branch delay slot. */
 | 
						/* Calculate exception PC in branch delay slot. */
 | 
				
			||||||
	if (__get_user(inst, (u16 __user *) msk_isa16_mode(epc))) {
 | 
						if (__get_user(inst, (u16 __user *) msk_isa16_mode(epc))) {
 | 
				
			||||||
		/* This should never happen because delay slot was checked. */
 | 
							/* This should never happen because delay slot was checked. */
 | 
				
			||||||
		force_sig(SIGSEGV, current);
 | 
							force_sig(SIGSEGV);
 | 
				
			||||||
		return epc;
 | 
							return epc;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if (cpu_has_mips16) {
 | 
						if (cpu_has_mips16) {
 | 
				
			||||||
| 
						 | 
					@ -305,7 +305,7 @@ int __microMIPS_compute_return_epc(struct pt_regs *regs)
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
sigsegv:
 | 
					sigsegv:
 | 
				
			||||||
	force_sig(SIGSEGV, current);
 | 
						force_sig(SIGSEGV);
 | 
				
			||||||
	return -EFAULT;
 | 
						return -EFAULT;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -328,7 +328,7 @@ int __MIPS16e_compute_return_epc(struct pt_regs *regs)
 | 
				
			||||||
	/* Read the instruction. */
 | 
						/* Read the instruction. */
 | 
				
			||||||
	addr = (u16 __user *)msk_isa16_mode(epc);
 | 
						addr = (u16 __user *)msk_isa16_mode(epc);
 | 
				
			||||||
	if (__get_user(inst.full, addr)) {
 | 
						if (__get_user(inst.full, addr)) {
 | 
				
			||||||
		force_sig(SIGSEGV, current);
 | 
							force_sig(SIGSEGV);
 | 
				
			||||||
		return -EFAULT;
 | 
							return -EFAULT;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -343,7 +343,7 @@ int __MIPS16e_compute_return_epc(struct pt_regs *regs)
 | 
				
			||||||
	case MIPS16e_jal_op:
 | 
						case MIPS16e_jal_op:
 | 
				
			||||||
		addr += 1;
 | 
							addr += 1;
 | 
				
			||||||
		if (__get_user(inst2, addr)) {
 | 
							if (__get_user(inst2, addr)) {
 | 
				
			||||||
			force_sig(SIGSEGV, current);
 | 
								force_sig(SIGSEGV);
 | 
				
			||||||
			return -EFAULT;
 | 
								return -EFAULT;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		fullinst = ((unsigned)inst.full << 16) | inst2;
 | 
							fullinst = ((unsigned)inst.full << 16) | inst2;
 | 
				
			||||||
| 
						 | 
					@ -829,17 +829,17 @@ int __compute_return_epc_for_insn(struct pt_regs *regs,
 | 
				
			||||||
sigill_dsp:
 | 
					sigill_dsp:
 | 
				
			||||||
	pr_debug("%s: DSP branch but not DSP ASE - sending SIGILL.\n",
 | 
						pr_debug("%s: DSP branch but not DSP ASE - sending SIGILL.\n",
 | 
				
			||||||
		 current->comm);
 | 
							 current->comm);
 | 
				
			||||||
	force_sig(SIGILL, current);
 | 
						force_sig(SIGILL);
 | 
				
			||||||
	return -EFAULT;
 | 
						return -EFAULT;
 | 
				
			||||||
sigill_r2r6:
 | 
					sigill_r2r6:
 | 
				
			||||||
	pr_debug("%s: R2 branch but r2-to-r6 emulator is not present - sending SIGILL.\n",
 | 
						pr_debug("%s: R2 branch but r2-to-r6 emulator is not present - sending SIGILL.\n",
 | 
				
			||||||
		 current->comm);
 | 
							 current->comm);
 | 
				
			||||||
	force_sig(SIGILL, current);
 | 
						force_sig(SIGILL);
 | 
				
			||||||
	return -EFAULT;
 | 
						return -EFAULT;
 | 
				
			||||||
sigill_r6:
 | 
					sigill_r6:
 | 
				
			||||||
	pr_debug("%s: R6 branch but no MIPSr6 ISA support - sending SIGILL.\n",
 | 
						pr_debug("%s: R6 branch but no MIPSr6 ISA support - sending SIGILL.\n",
 | 
				
			||||||
		 current->comm);
 | 
							 current->comm);
 | 
				
			||||||
	force_sig(SIGILL, current);
 | 
						force_sig(SIGILL);
 | 
				
			||||||
	return -EFAULT;
 | 
						return -EFAULT;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
EXPORT_SYMBOL_GPL(__compute_return_epc_for_insn);
 | 
					EXPORT_SYMBOL_GPL(__compute_return_epc_for_insn);
 | 
				
			||||||
| 
						 | 
					@ -859,7 +859,7 @@ int __compute_return_epc(struct pt_regs *regs)
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	addr = (unsigned int __user *) epc;
 | 
						addr = (unsigned int __user *) epc;
 | 
				
			||||||
	if (__get_user(insn.word, addr)) {
 | 
						if (__get_user(insn.word, addr)) {
 | 
				
			||||||
		force_sig(SIGSEGV, current);
 | 
							force_sig(SIGSEGV);
 | 
				
			||||||
		return -EFAULT;
 | 
							return -EFAULT;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -867,7 +867,7 @@ int __compute_return_epc(struct pt_regs *regs)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
unaligned:
 | 
					unaligned:
 | 
				
			||||||
	printk("%s: unaligned epc - sending SIGBUS.\n", current->comm);
 | 
						printk("%s: unaligned epc - sending SIGBUS.\n", current->comm);
 | 
				
			||||||
	force_sig(SIGBUS, current);
 | 
						force_sig(SIGBUS);
 | 
				
			||||||
	return -EFAULT;
 | 
						return -EFAULT;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -232,7 +232,7 @@ static int evaluate_branch_instruction(struct kprobe *p, struct pt_regs *regs,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
unaligned:
 | 
					unaligned:
 | 
				
			||||||
	pr_notice("%s: unaligned epc - sending SIGBUS.\n", current->comm);
 | 
						pr_notice("%s: unaligned epc - sending SIGBUS.\n", current->comm);
 | 
				
			||||||
	force_sig(SIGBUS, current);
 | 
						force_sig(SIGBUS);
 | 
				
			||||||
	return -EFAULT;
 | 
						return -EFAULT;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -641,7 +641,7 @@ asmlinkage void sys_sigreturn(void)
 | 
				
			||||||
	if (sig < 0)
 | 
						if (sig < 0)
 | 
				
			||||||
		goto badframe;
 | 
							goto badframe;
 | 
				
			||||||
	else if (sig)
 | 
						else if (sig)
 | 
				
			||||||
		force_sig(sig, current);
 | 
							force_sig(sig);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/*
 | 
						/*
 | 
				
			||||||
	 * Don't let your children do this ...
 | 
						 * Don't let your children do this ...
 | 
				
			||||||
| 
						 | 
					@ -654,7 +654,7 @@ asmlinkage void sys_sigreturn(void)
 | 
				
			||||||
	/* Unreached */
 | 
						/* Unreached */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
badframe:
 | 
					badframe:
 | 
				
			||||||
	force_sig(SIGSEGV, current);
 | 
						force_sig(SIGSEGV);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
#endif /* CONFIG_TRAD_SIGNALS */
 | 
					#endif /* CONFIG_TRAD_SIGNALS */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -678,7 +678,7 @@ asmlinkage void sys_rt_sigreturn(void)
 | 
				
			||||||
	if (sig < 0)
 | 
						if (sig < 0)
 | 
				
			||||||
		goto badframe;
 | 
							goto badframe;
 | 
				
			||||||
	else if (sig)
 | 
						else if (sig)
 | 
				
			||||||
		force_sig(sig, current);
 | 
							force_sig(sig);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (restore_altstack(&frame->rs_uc.uc_stack))
 | 
						if (restore_altstack(&frame->rs_uc.uc_stack))
 | 
				
			||||||
		goto badframe;
 | 
							goto badframe;
 | 
				
			||||||
| 
						 | 
					@ -694,7 +694,7 @@ asmlinkage void sys_rt_sigreturn(void)
 | 
				
			||||||
	/* Unreached */
 | 
						/* Unreached */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
badframe:
 | 
					badframe:
 | 
				
			||||||
	force_sig(SIGSEGV, current);
 | 
						force_sig(SIGSEGV);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifdef CONFIG_TRAD_SIGNALS
 | 
					#ifdef CONFIG_TRAD_SIGNALS
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -84,7 +84,7 @@ asmlinkage void sysn32_rt_sigreturn(void)
 | 
				
			||||||
	if (sig < 0)
 | 
						if (sig < 0)
 | 
				
			||||||
		goto badframe;
 | 
							goto badframe;
 | 
				
			||||||
	else if (sig)
 | 
						else if (sig)
 | 
				
			||||||
		force_sig(sig, current);
 | 
							force_sig(sig);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (compat_restore_altstack(&frame->rs_uc.uc_stack))
 | 
						if (compat_restore_altstack(&frame->rs_uc.uc_stack))
 | 
				
			||||||
		goto badframe;
 | 
							goto badframe;
 | 
				
			||||||
| 
						 | 
					@ -100,7 +100,7 @@ asmlinkage void sysn32_rt_sigreturn(void)
 | 
				
			||||||
	/* Unreached */
 | 
						/* Unreached */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
badframe:
 | 
					badframe:
 | 
				
			||||||
	force_sig(SIGSEGV, current);
 | 
						force_sig(SIGSEGV);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static int setup_rt_frame_n32(void *sig_return, struct ksignal *ksig,
 | 
					static int setup_rt_frame_n32(void *sig_return, struct ksignal *ksig,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -171,7 +171,7 @@ asmlinkage void sys32_rt_sigreturn(void)
 | 
				
			||||||
	if (sig < 0)
 | 
						if (sig < 0)
 | 
				
			||||||
		goto badframe;
 | 
							goto badframe;
 | 
				
			||||||
	else if (sig)
 | 
						else if (sig)
 | 
				
			||||||
		force_sig(sig, current);
 | 
							force_sig(sig);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (compat_restore_altstack(&frame->rs_uc.uc_stack))
 | 
						if (compat_restore_altstack(&frame->rs_uc.uc_stack))
 | 
				
			||||||
		goto badframe;
 | 
							goto badframe;
 | 
				
			||||||
| 
						 | 
					@ -187,7 +187,7 @@ asmlinkage void sys32_rt_sigreturn(void)
 | 
				
			||||||
	/* Unreached */
 | 
						/* Unreached */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
badframe:
 | 
					badframe:
 | 
				
			||||||
	force_sig(SIGSEGV, current);
 | 
						force_sig(SIGSEGV);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static int setup_rt_frame_32(void *sig_return, struct ksignal *ksig,
 | 
					static int setup_rt_frame_32(void *sig_return, struct ksignal *ksig,
 | 
				
			||||||
| 
						 | 
					@ -273,7 +273,7 @@ asmlinkage void sys32_sigreturn(void)
 | 
				
			||||||
	if (sig < 0)
 | 
						if (sig < 0)
 | 
				
			||||||
		goto badframe;
 | 
							goto badframe;
 | 
				
			||||||
	else if (sig)
 | 
						else if (sig)
 | 
				
			||||||
		force_sig(sig, current);
 | 
							force_sig(sig);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/*
 | 
						/*
 | 
				
			||||||
	 * Don't let your children do this ...
 | 
						 * Don't let your children do this ...
 | 
				
			||||||
| 
						 | 
					@ -286,5 +286,5 @@ asmlinkage void sys32_sigreturn(void)
 | 
				
			||||||
	/* Unreached */
 | 
						/* Unreached */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
badframe:
 | 
					badframe:
 | 
				
			||||||
	force_sig(SIGSEGV, current);
 | 
						force_sig(SIGSEGV);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -482,7 +482,7 @@ asmlinkage void do_be(struct pt_regs *regs)
 | 
				
			||||||
		goto out;
 | 
							goto out;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	die_if_kernel("Oops", regs);
 | 
						die_if_kernel("Oops", regs);
 | 
				
			||||||
	force_sig(SIGBUS, current);
 | 
						force_sig(SIGBUS);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
out:
 | 
					out:
 | 
				
			||||||
	exception_exit(prev_state);
 | 
						exception_exit(prev_state);
 | 
				
			||||||
| 
						 | 
					@ -765,7 +765,7 @@ int process_fpemu_return(int sig, void __user *fault_addr, unsigned long fcr31)
 | 
				
			||||||
		return 1;
 | 
							return 1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	default:
 | 
						default:
 | 
				
			||||||
		force_sig(sig, current);
 | 
							force_sig(sig);
 | 
				
			||||||
		return 1;
 | 
							return 1;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -947,7 +947,7 @@ void do_trap_or_bp(struct pt_regs *regs, unsigned int code, int si_code,
 | 
				
			||||||
		break;
 | 
							break;
 | 
				
			||||||
	case BRK_BUG:
 | 
						case BRK_BUG:
 | 
				
			||||||
		die_if_kernel("Kernel bug detected", regs);
 | 
							die_if_kernel("Kernel bug detected", regs);
 | 
				
			||||||
		force_sig(SIGTRAP, current);
 | 
							force_sig(SIGTRAP);
 | 
				
			||||||
		break;
 | 
							break;
 | 
				
			||||||
	case BRK_MEMU:
 | 
						case BRK_MEMU:
 | 
				
			||||||
		/*
 | 
							/*
 | 
				
			||||||
| 
						 | 
					@ -962,7 +962,7 @@ void do_trap_or_bp(struct pt_regs *regs, unsigned int code, int si_code,
 | 
				
			||||||
			return;
 | 
								return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		die_if_kernel("Math emu break/trap", regs);
 | 
							die_if_kernel("Math emu break/trap", regs);
 | 
				
			||||||
		force_sig(SIGTRAP, current);
 | 
							force_sig(SIGTRAP);
 | 
				
			||||||
		break;
 | 
							break;
 | 
				
			||||||
	default:
 | 
						default:
 | 
				
			||||||
		scnprintf(b, sizeof(b), "%s instruction in kernel code", str);
 | 
							scnprintf(b, sizeof(b), "%s instruction in kernel code", str);
 | 
				
			||||||
| 
						 | 
					@ -970,7 +970,7 @@ void do_trap_or_bp(struct pt_regs *regs, unsigned int code, int si_code,
 | 
				
			||||||
		if (si_code) {
 | 
							if (si_code) {
 | 
				
			||||||
			force_sig_fault(SIGTRAP, si_code, NULL,	current);
 | 
								force_sig_fault(SIGTRAP, si_code, NULL,	current);
 | 
				
			||||||
		} else {
 | 
							} else {
 | 
				
			||||||
			force_sig(SIGTRAP, current);
 | 
								force_sig(SIGTRAP);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -1063,7 +1063,7 @@ asmlinkage void do_bp(struct pt_regs *regs)
 | 
				
			||||||
	return;
 | 
						return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
out_sigsegv:
 | 
					out_sigsegv:
 | 
				
			||||||
	force_sig(SIGSEGV, current);
 | 
						force_sig(SIGSEGV);
 | 
				
			||||||
	goto out;
 | 
						goto out;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1105,7 +1105,7 @@ asmlinkage void do_tr(struct pt_regs *regs)
 | 
				
			||||||
	return;
 | 
						return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
out_sigsegv:
 | 
					out_sigsegv:
 | 
				
			||||||
	force_sig(SIGSEGV, current);
 | 
						force_sig(SIGSEGV);
 | 
				
			||||||
	goto out;
 | 
						goto out;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1191,7 +1191,7 @@ asmlinkage void do_ri(struct pt_regs *regs)
 | 
				
			||||||
	if (unlikely(status > 0)) {
 | 
						if (unlikely(status > 0)) {
 | 
				
			||||||
		regs->cp0_epc = old_epc;		/* Undo skip-over.  */
 | 
							regs->cp0_epc = old_epc;		/* Undo skip-over.  */
 | 
				
			||||||
		regs->regs[31] = old31;
 | 
							regs->regs[31] = old31;
 | 
				
			||||||
		force_sig(status, current);
 | 
							force_sig(status);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
out:
 | 
					out:
 | 
				
			||||||
| 
						 | 
					@ -1220,7 +1220,7 @@ static int default_cu2_call(struct notifier_block *nfb, unsigned long action,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	die_if_kernel("COP2: Unhandled kernel unaligned access or invalid "
 | 
						die_if_kernel("COP2: Unhandled kernel unaligned access or invalid "
 | 
				
			||||||
			      "instruction", regs);
 | 
								      "instruction", regs);
 | 
				
			||||||
	force_sig(SIGILL, current);
 | 
						force_sig(SIGILL);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return NOTIFY_OK;
 | 
						return NOTIFY_OK;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -1383,7 +1383,7 @@ asmlinkage void do_cpu(struct pt_regs *regs)
 | 
				
			||||||
		if (unlikely(status > 0)) {
 | 
							if (unlikely(status > 0)) {
 | 
				
			||||||
			regs->cp0_epc = old_epc;	/* Undo skip-over.  */
 | 
								regs->cp0_epc = old_epc;	/* Undo skip-over.  */
 | 
				
			||||||
			regs->regs[31] = old31;
 | 
								regs->regs[31] = old31;
 | 
				
			||||||
			force_sig(status, current);
 | 
								force_sig(status);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		break;
 | 
							break;
 | 
				
			||||||
| 
						 | 
					@ -1403,7 +1403,7 @@ asmlinkage void do_cpu(struct pt_regs *regs)
 | 
				
			||||||
		 * emulator too.
 | 
							 * emulator too.
 | 
				
			||||||
		 */
 | 
							 */
 | 
				
			||||||
		if (raw_cpu_has_fpu || !cpu_has_mips_4_5_64_r2_r6) {
 | 
							if (raw_cpu_has_fpu || !cpu_has_mips_4_5_64_r2_r6) {
 | 
				
			||||||
			force_sig(SIGILL, current);
 | 
								force_sig(SIGILL);
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		/* Fall through.  */
 | 
							/* Fall through.  */
 | 
				
			||||||
| 
						 | 
					@ -1437,7 +1437,7 @@ asmlinkage void do_cpu(struct pt_regs *regs)
 | 
				
			||||||
#else /* CONFIG_MIPS_FP_SUPPORT */
 | 
					#else /* CONFIG_MIPS_FP_SUPPORT */
 | 
				
			||||||
	case 1:
 | 
						case 1:
 | 
				
			||||||
	case 3:
 | 
						case 3:
 | 
				
			||||||
		force_sig(SIGILL, current);
 | 
							force_sig(SIGILL);
 | 
				
			||||||
		break;
 | 
							break;
 | 
				
			||||||
#endif /* CONFIG_MIPS_FP_SUPPORT */
 | 
					#endif /* CONFIG_MIPS_FP_SUPPORT */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1464,7 +1464,7 @@ asmlinkage void do_msa_fpe(struct pt_regs *regs, unsigned int msacsr)
 | 
				
			||||||
	local_irq_enable();
 | 
						local_irq_enable();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	die_if_kernel("do_msa_fpe invoked from kernel context!", regs);
 | 
						die_if_kernel("do_msa_fpe invoked from kernel context!", regs);
 | 
				
			||||||
	force_sig(SIGFPE, current);
 | 
						force_sig(SIGFPE);
 | 
				
			||||||
out:
 | 
					out:
 | 
				
			||||||
	exception_exit(prev_state);
 | 
						exception_exit(prev_state);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -1477,7 +1477,7 @@ asmlinkage void do_msa(struct pt_regs *regs)
 | 
				
			||||||
	prev_state = exception_enter();
 | 
						prev_state = exception_enter();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (!cpu_has_msa || test_thread_flag(TIF_32BIT_FPREGS)) {
 | 
						if (!cpu_has_msa || test_thread_flag(TIF_32BIT_FPREGS)) {
 | 
				
			||||||
		force_sig(SIGILL, current);
 | 
							force_sig(SIGILL);
 | 
				
			||||||
		goto out;
 | 
							goto out;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1485,7 +1485,7 @@ asmlinkage void do_msa(struct pt_regs *regs)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	err = enable_restore_fp_context(1);
 | 
						err = enable_restore_fp_context(1);
 | 
				
			||||||
	if (err)
 | 
						if (err)
 | 
				
			||||||
		force_sig(SIGILL, current);
 | 
							force_sig(SIGILL);
 | 
				
			||||||
out:
 | 
					out:
 | 
				
			||||||
	exception_exit(prev_state);
 | 
						exception_exit(prev_state);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -1495,7 +1495,7 @@ asmlinkage void do_mdmx(struct pt_regs *regs)
 | 
				
			||||||
	enum ctx_state prev_state;
 | 
						enum ctx_state prev_state;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	prev_state = exception_enter();
 | 
						prev_state = exception_enter();
 | 
				
			||||||
	force_sig(SIGILL, current);
 | 
						force_sig(SIGILL);
 | 
				
			||||||
	exception_exit(prev_state);
 | 
						exception_exit(prev_state);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1592,7 +1592,7 @@ asmlinkage void do_mt(struct pt_regs *regs)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	die_if_kernel("MIPS MT Thread exception in kernel", regs);
 | 
						die_if_kernel("MIPS MT Thread exception in kernel", regs);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	force_sig(SIGILL, current);
 | 
						force_sig(SIGILL);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1601,7 +1601,7 @@ asmlinkage void do_dsp(struct pt_regs *regs)
 | 
				
			||||||
	if (cpu_has_dsp)
 | 
						if (cpu_has_dsp)
 | 
				
			||||||
		panic("Unexpected DSP exception");
 | 
							panic("Unexpected DSP exception");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	force_sig(SIGILL, current);
 | 
						force_sig(SIGILL);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
asmlinkage void do_reserved(struct pt_regs *regs)
 | 
					asmlinkage void do_reserved(struct pt_regs *regs)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1365,20 +1365,20 @@ static void emulate_load_store_insn(struct pt_regs *regs,
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	die_if_kernel("Unhandled kernel unaligned access", regs);
 | 
						die_if_kernel("Unhandled kernel unaligned access", regs);
 | 
				
			||||||
	force_sig(SIGSEGV, current);
 | 
						force_sig(SIGSEGV);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return;
 | 
						return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
sigbus:
 | 
					sigbus:
 | 
				
			||||||
	die_if_kernel("Unhandled kernel unaligned access", regs);
 | 
						die_if_kernel("Unhandled kernel unaligned access", regs);
 | 
				
			||||||
	force_sig(SIGBUS, current);
 | 
						force_sig(SIGBUS);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return;
 | 
						return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
sigill:
 | 
					sigill:
 | 
				
			||||||
	die_if_kernel
 | 
						die_if_kernel
 | 
				
			||||||
	    ("Unhandled kernel unaligned access or invalid instruction", regs);
 | 
						    ("Unhandled kernel unaligned access or invalid instruction", regs);
 | 
				
			||||||
	force_sig(SIGILL, current);
 | 
						force_sig(SIGILL);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Recode table from 16-bit register notation to 32-bit GPR. */
 | 
					/* Recode table from 16-bit register notation to 32-bit GPR. */
 | 
				
			||||||
| 
						 | 
					@ -1991,20 +1991,20 @@ static void emulate_load_store_microMIPS(struct pt_regs *regs,
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	die_if_kernel("Unhandled kernel unaligned access", regs);
 | 
						die_if_kernel("Unhandled kernel unaligned access", regs);
 | 
				
			||||||
	force_sig(SIGSEGV, current);
 | 
						force_sig(SIGSEGV);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return;
 | 
						return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
sigbus:
 | 
					sigbus:
 | 
				
			||||||
	die_if_kernel("Unhandled kernel unaligned access", regs);
 | 
						die_if_kernel("Unhandled kernel unaligned access", regs);
 | 
				
			||||||
	force_sig(SIGBUS, current);
 | 
						force_sig(SIGBUS);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return;
 | 
						return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
sigill:
 | 
					sigill:
 | 
				
			||||||
	die_if_kernel
 | 
						die_if_kernel
 | 
				
			||||||
	    ("Unhandled kernel unaligned access or invalid instruction", regs);
 | 
						    ("Unhandled kernel unaligned access or invalid instruction", regs);
 | 
				
			||||||
	force_sig(SIGILL, current);
 | 
						force_sig(SIGILL);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void emulate_load_store_MIPS16e(struct pt_regs *regs, void __user * addr)
 | 
					static void emulate_load_store_MIPS16e(struct pt_regs *regs, void __user * addr)
 | 
				
			||||||
| 
						 | 
					@ -2271,20 +2271,20 @@ static void emulate_load_store_MIPS16e(struct pt_regs *regs, void __user * addr)
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	die_if_kernel("Unhandled kernel unaligned access", regs);
 | 
						die_if_kernel("Unhandled kernel unaligned access", regs);
 | 
				
			||||||
	force_sig(SIGSEGV, current);
 | 
						force_sig(SIGSEGV);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return;
 | 
						return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
sigbus:
 | 
					sigbus:
 | 
				
			||||||
	die_if_kernel("Unhandled kernel unaligned access", regs);
 | 
						die_if_kernel("Unhandled kernel unaligned access", regs);
 | 
				
			||||||
	force_sig(SIGBUS, current);
 | 
						force_sig(SIGBUS);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return;
 | 
						return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
sigill:
 | 
					sigill:
 | 
				
			||||||
	die_if_kernel
 | 
						die_if_kernel
 | 
				
			||||||
	    ("Unhandled kernel unaligned access or invalid instruction", regs);
 | 
						    ("Unhandled kernel unaligned access or invalid instruction", regs);
 | 
				
			||||||
	force_sig(SIGILL, current);
 | 
						force_sig(SIGILL);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
asmlinkage void do_ade(struct pt_regs *regs)
 | 
					asmlinkage void do_ade(struct pt_regs *regs)
 | 
				
			||||||
| 
						 | 
					@ -2364,7 +2364,7 @@ asmlinkage void do_ade(struct pt_regs *regs)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
sigbus:
 | 
					sigbus:
 | 
				
			||||||
	die_if_kernel("Kernel unaligned instruction access", regs);
 | 
						die_if_kernel("Kernel unaligned instruction access", regs);
 | 
				
			||||||
	force_sig(SIGBUS, current);
 | 
						force_sig(SIGBUS);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/*
 | 
						/*
 | 
				
			||||||
	 * XXX On return from the signal handler we should advance the epc
 | 
						 * XXX On return from the signal handler we should advance the epc
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -98,7 +98,7 @@ void ip22_be_interrupt(int irq)
 | 
				
			||||||
	       field, regs->cp0_epc, field, regs->regs[31]);
 | 
						       field, regs->cp0_epc, field, regs->regs[31]);
 | 
				
			||||||
	/* Assume it would be too dangerous to continue ... */
 | 
						/* Assume it would be too dangerous to continue ... */
 | 
				
			||||||
	die_if_kernel("Oops", regs);
 | 
						die_if_kernel("Oops", regs);
 | 
				
			||||||
	force_sig(SIGBUS, current);
 | 
						force_sig(SIGBUS);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static int ip22_be_handler(struct pt_regs *regs, int is_fixup)
 | 
					static int ip22_be_handler(struct pt_regs *regs, int is_fixup)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -462,7 +462,7 @@ void ip22_be_interrupt(int irq)
 | 
				
			||||||
	if (ip28_be_interrupt(regs) != MIPS_BE_DISCARD) {
 | 
						if (ip28_be_interrupt(regs) != MIPS_BE_DISCARD) {
 | 
				
			||||||
		/* Assume it would be too dangerous to continue ... */
 | 
							/* Assume it would be too dangerous to continue ... */
 | 
				
			||||||
		die_if_kernel("Oops", regs);
 | 
							die_if_kernel("Oops", regs);
 | 
				
			||||||
		force_sig(SIGBUS, current);
 | 
							force_sig(SIGBUS);
 | 
				
			||||||
	} else if (debug_be_interrupt)
 | 
						} else if (debug_be_interrupt)
 | 
				
			||||||
		show_regs(regs);
 | 
							show_regs(regs);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -74,7 +74,7 @@ int ip27_be_handler(struct pt_regs *regs, int is_fixup)
 | 
				
			||||||
	show_regs(regs);
 | 
						show_regs(regs);
 | 
				
			||||||
	dump_tlb_all();
 | 
						dump_tlb_all();
 | 
				
			||||||
	while(1);
 | 
						while(1);
 | 
				
			||||||
	force_sig(SIGBUS, current);
 | 
						force_sig(SIGBUS);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void __init ip27_be_init(void)
 | 
					void __init ip27_be_init(void)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -29,7 +29,7 @@ static int ip32_be_handler(struct pt_regs *regs, int is_fixup)
 | 
				
			||||||
	show_regs(regs);
 | 
						show_regs(regs);
 | 
				
			||||||
	dump_tlb_all();
 | 
						dump_tlb_all();
 | 
				
			||||||
	while(1);
 | 
						while(1);
 | 
				
			||||||
	force_sig(SIGBUS, current);
 | 
						force_sig(SIGBUS);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void __init ip32_be_init(void)
 | 
					void __init ip32_be_init(void)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -163,7 +163,7 @@ asmlinkage long sys_rt_sigreturn(struct pt_regs *regs)
 | 
				
			||||||
	return regs->uregs[0];
 | 
						return regs->uregs[0];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
badframe:
 | 
					badframe:
 | 
				
			||||||
	force_sig(SIGSEGV, current);
 | 
						force_sig(SIGSEGV);
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -288,7 +288,7 @@ void unhandled_interruption(struct pt_regs *regs)
 | 
				
			||||||
	show_regs(regs);
 | 
						show_regs(regs);
 | 
				
			||||||
	if (!user_mode(regs))
 | 
						if (!user_mode(regs))
 | 
				
			||||||
		do_exit(SIGKILL);
 | 
							do_exit(SIGKILL);
 | 
				
			||||||
	force_sig(SIGKILL, current);
 | 
						force_sig(SIGKILL);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void unhandled_exceptions(unsigned long entry, unsigned long addr,
 | 
					void unhandled_exceptions(unsigned long entry, unsigned long addr,
 | 
				
			||||||
| 
						 | 
					@ -299,7 +299,7 @@ void unhandled_exceptions(unsigned long entry, unsigned long addr,
 | 
				
			||||||
	show_regs(regs);
 | 
						show_regs(regs);
 | 
				
			||||||
	if (!user_mode(regs))
 | 
						if (!user_mode(regs))
 | 
				
			||||||
		do_exit(SIGKILL);
 | 
							do_exit(SIGKILL);
 | 
				
			||||||
	force_sig(SIGKILL, current);
 | 
						force_sig(SIGKILL);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
extern int do_page_fault(unsigned long entry, unsigned long addr,
 | 
					extern int do_page_fault(unsigned long entry, unsigned long addr,
 | 
				
			||||||
| 
						 | 
					@ -326,7 +326,7 @@ void do_revinsn(struct pt_regs *regs)
 | 
				
			||||||
	show_regs(regs);
 | 
						show_regs(regs);
 | 
				
			||||||
	if (!user_mode(regs))
 | 
						if (!user_mode(regs))
 | 
				
			||||||
		do_exit(SIGILL);
 | 
							do_exit(SIGILL);
 | 
				
			||||||
	force_sig(SIGILL, current);
 | 
						force_sig(SIGILL);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifdef CONFIG_ALIGNMENT_TRAP
 | 
					#ifdef CONFIG_ALIGNMENT_TRAP
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -120,7 +120,7 @@ asmlinkage int do_rt_sigreturn(struct switch_stack *sw)
 | 
				
			||||||
	return rval;
 | 
						return rval;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
badframe:
 | 
					badframe:
 | 
				
			||||||
	force_sig(SIGSEGV, current);
 | 
						force_sig(SIGSEGV);
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -99,7 +99,7 @@ asmlinkage long _sys_rt_sigreturn(struct pt_regs *regs)
 | 
				
			||||||
	return regs->gpr[11];
 | 
						return regs->gpr[11];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
badframe:
 | 
					badframe:
 | 
				
			||||||
	force_sig(SIGSEGV, current);
 | 
						force_sig(SIGSEGV);
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -376,7 +376,7 @@ static inline void simulate_lwa(struct pt_regs *regs, unsigned long address,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (get_user(value, lwa_addr)) {
 | 
						if (get_user(value, lwa_addr)) {
 | 
				
			||||||
		if (user_mode(regs)) {
 | 
							if (user_mode(regs)) {
 | 
				
			||||||
			force_sig(SIGSEGV, current);
 | 
								force_sig(SIGSEGV);
 | 
				
			||||||
			return;
 | 
								return;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -423,7 +423,7 @@ static inline void simulate_swa(struct pt_regs *regs, unsigned long address,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (put_user(regs->gpr[rb], vaddr)) {
 | 
						if (put_user(regs->gpr[rb], vaddr)) {
 | 
				
			||||||
		if (user_mode(regs)) {
 | 
							if (user_mode(regs)) {
 | 
				
			||||||
			force_sig(SIGSEGV, current);
 | 
								force_sig(SIGSEGV);
 | 
				
			||||||
			return;
 | 
								return;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -164,7 +164,7 @@ sys_rt_sigreturn(struct pt_regs *regs, int in_syscall)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
give_sigsegv:
 | 
					give_sigsegv:
 | 
				
			||||||
	DBG(1,"sys_rt_sigreturn: Sending SIGSEGV\n");
 | 
						DBG(1,"sys_rt_sigreturn: Sending SIGSEGV\n");
 | 
				
			||||||
	force_sig(SIGSEGV, current);
 | 
						force_sig(SIGSEGV);
 | 
				
			||||||
	return;
 | 
						return;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1249,7 +1249,7 @@ SYSCALL_DEFINE0(rt_sigreturn)
 | 
				
			||||||
				   current->comm, current->pid,
 | 
									   current->comm, current->pid,
 | 
				
			||||||
				   rt_sf, regs->nip, regs->link);
 | 
									   rt_sf, regs->nip, regs->link);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	force_sig(SIGSEGV, current);
 | 
						force_sig(SIGSEGV);
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1338,7 +1338,7 @@ SYSCALL_DEFINE3(debug_setcontext, struct ucontext __user *, ctx,
 | 
				
			||||||
					   current->comm, current->pid,
 | 
										   current->comm, current->pid,
 | 
				
			||||||
					   ctx, regs->nip, regs->link);
 | 
										   ctx, regs->nip, regs->link);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		force_sig(SIGSEGV, current);
 | 
							force_sig(SIGSEGV);
 | 
				
			||||||
		goto out;
 | 
							goto out;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1516,6 +1516,6 @@ SYSCALL_DEFINE0(sigreturn)
 | 
				
			||||||
				   current->comm, current->pid,
 | 
									   current->comm, current->pid,
 | 
				
			||||||
				   addr, regs->nip, regs->link);
 | 
									   addr, regs->nip, regs->link);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	force_sig(SIGSEGV, current);
 | 
						force_sig(SIGSEGV);
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -812,7 +812,7 @@ SYSCALL_DEFINE0(rt_sigreturn)
 | 
				
			||||||
				   current->comm, current->pid, "rt_sigreturn",
 | 
									   current->comm, current->pid, "rt_sigreturn",
 | 
				
			||||||
				   (long)uc, regs->nip, regs->link);
 | 
									   (long)uc, regs->nip, regs->link);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	force_sig(SIGSEGV, current);
 | 
						force_sig(SIGSEGV);
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -443,7 +443,7 @@ long spufs_run_spu(struct spu_context *ctx, u32 *npc, u32 *event)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	else if (unlikely((status & SPU_STATUS_STOPPED_BY_STOP)
 | 
						else if (unlikely((status & SPU_STATUS_STOPPED_BY_STOP)
 | 
				
			||||||
	    && (status >> SPU_STOP_STATUS_SHIFT) == 0x3fff)) {
 | 
						    && (status >> SPU_STOP_STATUS_SHIFT) == 0x3fff)) {
 | 
				
			||||||
		force_sig(SIGTRAP, current);
 | 
							force_sig(SIGTRAP);
 | 
				
			||||||
		ret = -ERESTARTSYS;
 | 
							ret = -ERESTARTSYS;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -139,7 +139,7 @@ SYSCALL_DEFINE0(rt_sigreturn)
 | 
				
			||||||
			task->comm, task_pid_nr(task), __func__,
 | 
								task->comm, task_pid_nr(task), __func__,
 | 
				
			||||||
			frame, (void *)regs->sepc, (void *)regs->sp);
 | 
								frame, (void *)regs->sepc, (void *)regs->sp);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	force_sig(SIGSEGV, task);
 | 
						force_sig(SIGSEGV);
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -194,7 +194,7 @@ COMPAT_SYSCALL_DEFINE0(sigreturn)
 | 
				
			||||||
	load_sigregs();
 | 
						load_sigregs();
 | 
				
			||||||
	return regs->gprs[2];
 | 
						return regs->gprs[2];
 | 
				
			||||||
badframe:
 | 
					badframe:
 | 
				
			||||||
	force_sig(SIGSEGV, current);
 | 
						force_sig(SIGSEGV);
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -217,7 +217,7 @@ COMPAT_SYSCALL_DEFINE0(rt_sigreturn)
 | 
				
			||||||
	load_sigregs();
 | 
						load_sigregs();
 | 
				
			||||||
	return regs->gprs[2];
 | 
						return regs->gprs[2];
 | 
				
			||||||
badframe:
 | 
					badframe:
 | 
				
			||||||
	force_sig(SIGSEGV, current);
 | 
						force_sig(SIGSEGV);
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}	
 | 
					}	
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -232,7 +232,7 @@ SYSCALL_DEFINE0(sigreturn)
 | 
				
			||||||
	load_sigregs();
 | 
						load_sigregs();
 | 
				
			||||||
	return regs->gprs[2];
 | 
						return regs->gprs[2];
 | 
				
			||||||
badframe:
 | 
					badframe:
 | 
				
			||||||
	force_sig(SIGSEGV, current);
 | 
						force_sig(SIGSEGV);
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -256,7 +256,7 @@ SYSCALL_DEFINE0(rt_sigreturn)
 | 
				
			||||||
	load_sigregs();
 | 
						load_sigregs();
 | 
				
			||||||
	return regs->gprs[2];
 | 
						return regs->gprs[2];
 | 
				
			||||||
badframe:
 | 
					badframe:
 | 
				
			||||||
	force_sig(SIGSEGV, current);
 | 
						force_sig(SIGSEGV);
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -568,5 +568,5 @@ BUILD_TRAP_HANDLER(fpu_error)
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	force_sig(SIGFPE, tsk);
 | 
						force_sig(SIGFPE);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -421,5 +421,5 @@ BUILD_TRAP_HANDLER(fpu_error)
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	force_sig(SIGFPE, tsk);
 | 
						force_sig(SIGFPE);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -100,9 +100,7 @@ void restore_fpu(struct task_struct *tsk)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
asmlinkage void do_fpu_error(unsigned long ex, struct pt_regs *regs)
 | 
					asmlinkage void do_fpu_error(unsigned long ex, struct pt_regs *regs)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct task_struct *tsk = current;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	regs->pc += 4;
 | 
						regs->pc += 4;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	force_sig(SIGFPE, tsk);
 | 
						force_sig(SIGFPE);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -550,7 +550,7 @@ asmlinkage void do_single_step(unsigned long long vec, struct pt_regs *regs)
 | 
				
			||||||
	   continually stepping. */
 | 
						   continually stepping. */
 | 
				
			||||||
	local_irq_enable();
 | 
						local_irq_enable();
 | 
				
			||||||
	regs->sr &= ~SR_SSTEP;
 | 
						regs->sr &= ~SR_SSTEP;
 | 
				
			||||||
	force_sig(SIGTRAP, current);
 | 
						force_sig(SIGTRAP);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Called with interrupts disabled */
 | 
					/* Called with interrupts disabled */
 | 
				
			||||||
| 
						 | 
					@ -561,7 +561,7 @@ BUILD_TRAP_HANDLER(breakpoint)
 | 
				
			||||||
	/* We need to forward step the PC, to counteract the backstep done
 | 
						/* We need to forward step the PC, to counteract the backstep done
 | 
				
			||||||
	   in signal.c. */
 | 
						   in signal.c. */
 | 
				
			||||||
	local_irq_enable();
 | 
						local_irq_enable();
 | 
				
			||||||
	force_sig(SIGTRAP, current);
 | 
						force_sig(SIGTRAP);
 | 
				
			||||||
	regs->pc += 4;
 | 
						regs->pc += 4;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -176,7 +176,7 @@ asmlinkage int sys_sigreturn(void)
 | 
				
			||||||
	return r0;
 | 
						return r0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
badframe:
 | 
					badframe:
 | 
				
			||||||
	force_sig(SIGSEGV, current);
 | 
						force_sig(SIGSEGV);
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -207,7 +207,7 @@ asmlinkage int sys_rt_sigreturn(void)
 | 
				
			||||||
	return r0;
 | 
						return r0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
badframe:
 | 
					badframe:
 | 
				
			||||||
	force_sig(SIGSEGV, current);
 | 
						force_sig(SIGSEGV);
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -277,7 +277,7 @@ asmlinkage int sys_sigreturn(unsigned long r2, unsigned long r3,
 | 
				
			||||||
	return (int) ret;
 | 
						return (int) ret;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
badframe:
 | 
					badframe:
 | 
				
			||||||
	force_sig(SIGSEGV, current);
 | 
						force_sig(SIGSEGV);
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -311,7 +311,7 @@ asmlinkage int sys_rt_sigreturn(unsigned long r2, unsigned long r3,
 | 
				
			||||||
	return (int) ret;
 | 
						return (int) ret;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
badframe:
 | 
					badframe:
 | 
				
			||||||
	force_sig(SIGSEGV, current);
 | 
						force_sig(SIGSEGV);
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -141,7 +141,7 @@ BUILD_TRAP_HANDLER(debug)
 | 
				
			||||||
		       SIGTRAP) == NOTIFY_STOP)
 | 
							       SIGTRAP) == NOTIFY_STOP)
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	force_sig(SIGTRAP, current);
 | 
						force_sig(SIGTRAP);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
| 
						 | 
					@ -167,7 +167,7 @@ BUILD_TRAP_HANDLER(bug)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	force_sig(SIGTRAP, current);
 | 
						force_sig(SIGTRAP);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
BUILD_TRAP_HANDLER(nmi)
 | 
					BUILD_TRAP_HANDLER(nmi)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -611,7 +611,6 @@ asmlinkage void do_reserved_inst(void)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct pt_regs *regs = current_pt_regs();
 | 
						struct pt_regs *regs = current_pt_regs();
 | 
				
			||||||
	unsigned long error_code;
 | 
						unsigned long error_code;
 | 
				
			||||||
	struct task_struct *tsk = current;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifdef CONFIG_SH_FPU_EMU
 | 
					#ifdef CONFIG_SH_FPU_EMU
 | 
				
			||||||
	unsigned short inst = 0;
 | 
						unsigned short inst = 0;
 | 
				
			||||||
| 
						 | 
					@ -633,7 +632,7 @@ asmlinkage void do_reserved_inst(void)
 | 
				
			||||||
		/* Enable DSP mode, and restart instruction. */
 | 
							/* Enable DSP mode, and restart instruction. */
 | 
				
			||||||
		regs->sr |= SR_DSP;
 | 
							regs->sr |= SR_DSP;
 | 
				
			||||||
		/* Save DSP mode */
 | 
							/* Save DSP mode */
 | 
				
			||||||
		tsk->thread.dsp_status.status |= SR_DSP;
 | 
							current->thread.dsp_status.status |= SR_DSP;
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
| 
						 | 
					@ -641,7 +640,7 @@ asmlinkage void do_reserved_inst(void)
 | 
				
			||||||
	error_code = lookup_exception_vector();
 | 
						error_code = lookup_exception_vector();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	local_irq_enable();
 | 
						local_irq_enable();
 | 
				
			||||||
	force_sig(SIGILL, tsk);
 | 
						force_sig(SIGILL);
 | 
				
			||||||
	die_if_no_fixup("reserved instruction", regs, error_code);
 | 
						die_if_no_fixup("reserved instruction", regs, error_code);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -697,7 +696,6 @@ asmlinkage void do_illegal_slot_inst(void)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct pt_regs *regs = current_pt_regs();
 | 
						struct pt_regs *regs = current_pt_regs();
 | 
				
			||||||
	unsigned long inst;
 | 
						unsigned long inst;
 | 
				
			||||||
	struct task_struct *tsk = current;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (kprobe_handle_illslot(regs->pc) == 0)
 | 
						if (kprobe_handle_illslot(regs->pc) == 0)
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
| 
						 | 
					@ -716,7 +714,7 @@ asmlinkage void do_illegal_slot_inst(void)
 | 
				
			||||||
	inst = lookup_exception_vector();
 | 
						inst = lookup_exception_vector();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	local_irq_enable();
 | 
						local_irq_enable();
 | 
				
			||||||
	force_sig(SIGILL, tsk);
 | 
						force_sig(SIGILL);
 | 
				
			||||||
	die_if_no_fixup("illegal slot instruction", regs, inst);
 | 
						die_if_no_fixup("illegal slot instruction", regs, inst);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -599,7 +599,7 @@ static void do_unhandled_exception(int signr, char *str, unsigned long error,
 | 
				
			||||||
				   struct pt_regs *regs)
 | 
									   struct pt_regs *regs)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	if (user_mode(regs))
 | 
						if (user_mode(regs))
 | 
				
			||||||
		force_sig(signr, current);
 | 
							force_sig(signr);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	die_if_no_fixup(str, regs, error);
 | 
						die_if_no_fixup(str, regs, error);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -570,7 +570,7 @@ void fault_in_user_windows(struct pt_regs *regs)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
barf:
 | 
					barf:
 | 
				
			||||||
	set_thread_wsaved(window + 1);
 | 
						set_thread_wsaved(window + 1);
 | 
				
			||||||
	force_sig(SIGSEGV, current);
 | 
						force_sig(SIGSEGV);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
asmlinkage long sparc_do_fork(unsigned long clone_flags,
 | 
					asmlinkage long sparc_do_fork(unsigned long clone_flags,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -170,7 +170,7 @@ void do_sigreturn32(struct pt_regs *regs)
 | 
				
			||||||
	return;
 | 
						return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
segv:
 | 
					segv:
 | 
				
			||||||
	force_sig(SIGSEGV, current);
 | 
						force_sig(SIGSEGV);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
asmlinkage void do_rt_sigreturn32(struct pt_regs *regs)
 | 
					asmlinkage void do_rt_sigreturn32(struct pt_regs *regs)
 | 
				
			||||||
| 
						 | 
					@ -256,7 +256,7 @@ asmlinkage void do_rt_sigreturn32(struct pt_regs *regs)
 | 
				
			||||||
	set_current_blocked(&set);
 | 
						set_current_blocked(&set);
 | 
				
			||||||
	return;
 | 
						return;
 | 
				
			||||||
segv:
 | 
					segv:
 | 
				
			||||||
	force_sig(SIGSEGV, current);
 | 
						force_sig(SIGSEGV);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void __user *get_sigframe(struct ksignal *ksig, struct pt_regs *regs, unsigned long framesize)
 | 
					static void __user *get_sigframe(struct ksignal *ksig, struct pt_regs *regs, unsigned long framesize)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -137,7 +137,7 @@ asmlinkage void do_sigreturn(struct pt_regs *regs)
 | 
				
			||||||
	return;
 | 
						return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
segv_and_exit:
 | 
					segv_and_exit:
 | 
				
			||||||
	force_sig(SIGSEGV, current);
 | 
						force_sig(SIGSEGV);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
asmlinkage void do_rt_sigreturn(struct pt_regs *regs)
 | 
					asmlinkage void do_rt_sigreturn(struct pt_regs *regs)
 | 
				
			||||||
| 
						 | 
					@ -196,7 +196,7 @@ asmlinkage void do_rt_sigreturn(struct pt_regs *regs)
 | 
				
			||||||
	set_current_blocked(&set);
 | 
						set_current_blocked(&set);
 | 
				
			||||||
	return;
 | 
						return;
 | 
				
			||||||
segv:
 | 
					segv:
 | 
				
			||||||
	force_sig(SIGSEGV, current);
 | 
						force_sig(SIGSEGV);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static inline void __user *get_sigframe(struct ksignal *ksig, struct pt_regs *regs, unsigned long framesize)
 | 
					static inline void __user *get_sigframe(struct ksignal *ksig, struct pt_regs *regs, unsigned long framesize)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -134,7 +134,7 @@ asmlinkage void sparc64_set_context(struct pt_regs *regs)
 | 
				
			||||||
	exception_exit(prev_state);
 | 
						exception_exit(prev_state);
 | 
				
			||||||
	return;
 | 
						return;
 | 
				
			||||||
do_sigsegv:
 | 
					do_sigsegv:
 | 
				
			||||||
	force_sig(SIGSEGV, current);
 | 
						force_sig(SIGSEGV);
 | 
				
			||||||
	goto out;
 | 
						goto out;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -228,7 +228,7 @@ asmlinkage void sparc64_get_context(struct pt_regs *regs)
 | 
				
			||||||
	exception_exit(prev_state);
 | 
						exception_exit(prev_state);
 | 
				
			||||||
	return;
 | 
						return;
 | 
				
			||||||
do_sigsegv:
 | 
					do_sigsegv:
 | 
				
			||||||
	force_sig(SIGSEGV, current);
 | 
						force_sig(SIGSEGV);
 | 
				
			||||||
	goto out;
 | 
						goto out;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -320,7 +320,7 @@ void do_rt_sigreturn(struct pt_regs *regs)
 | 
				
			||||||
	set_current_blocked(&set);
 | 
						set_current_blocked(&set);
 | 
				
			||||||
	return;
 | 
						return;
 | 
				
			||||||
segv:
 | 
					segv:
 | 
				
			||||||
	force_sig(SIGSEGV, current);
 | 
						force_sig(SIGSEGV);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static inline void __user *get_sigframe(struct ksignal *ksig, struct pt_regs *regs, unsigned long framesize)
 | 
					static inline void __user *get_sigframe(struct ksignal *ksig, struct pt_regs *regs, unsigned long framesize)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2181,7 +2181,7 @@ bool sun4v_nonresum_error_user_handled(struct pt_regs *regs,
 | 
				
			||||||
				addr += PAGE_SIZE;
 | 
									addr += PAGE_SIZE;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		force_sig(SIGKILL, current);
 | 
							force_sig(SIGKILL);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		return true;
 | 
							return true;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -425,7 +425,7 @@ static void force_user_fault(unsigned long address, int write)
 | 
				
			||||||
static void check_stack_aligned(unsigned long sp)
 | 
					static void check_stack_aligned(unsigned long sp)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	if (sp & 0x7UL)
 | 
						if (sp & 0x7UL)
 | 
				
			||||||
		force_sig(SIGILL, current);
 | 
							force_sig(SIGILL);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void window_overflow_fault(void)
 | 
					void window_overflow_fault(void)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -32,7 +32,7 @@ void flush_thread(void)
 | 
				
			||||||
	if (ret) {
 | 
						if (ret) {
 | 
				
			||||||
		printk(KERN_ERR "flush_thread - clearing address space failed, "
 | 
							printk(KERN_ERR "flush_thread - clearing address space failed, "
 | 
				
			||||||
		       "err = %d\n", ret);
 | 
							       "err = %d\n", ret);
 | 
				
			||||||
		force_sig(SIGKILL, current);
 | 
							force_sig(SIGKILL);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	get_safe_registers(current_pt_regs()->regs.gp,
 | 
						get_safe_registers(current_pt_regs()->regs.gp,
 | 
				
			||||||
			   current_pt_regs()->regs.fp);
 | 
								   current_pt_regs()->regs.fp);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -329,7 +329,7 @@ void fix_range_common(struct mm_struct *mm, unsigned long start_addr,
 | 
				
			||||||
		       "process: %d\n", task_tgid_vnr(current));
 | 
							       "process: %d\n", task_tgid_vnr(current));
 | 
				
			||||||
		/* We are under mmap_sem, release it such that current can terminate */
 | 
							/* We are under mmap_sem, release it such that current can terminate */
 | 
				
			||||||
		up_write(¤t->mm->mmap_sem);
 | 
							up_write(¤t->mm->mmap_sem);
 | 
				
			||||||
		force_sig(SIGKILL, current);
 | 
							force_sig(SIGKILL);
 | 
				
			||||||
		do_signal(¤t->thread.regs);
 | 
							do_signal(¤t->thread.regs);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -487,7 +487,7 @@ void flush_tlb_page(struct vm_area_struct *vma, unsigned long address)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
kill:
 | 
					kill:
 | 
				
			||||||
	printk(KERN_ERR "Failed to flush page for address 0x%lx\n", address);
 | 
						printk(KERN_ERR "Failed to flush page for address 0x%lx\n", address);
 | 
				
			||||||
	force_sig(SIGKILL, current);
 | 
						force_sig(SIGKILL);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
pgd_t *pgd_offset_proc(struct mm_struct *mm, unsigned long address)
 | 
					pgd_t *pgd_offset_proc(struct mm_struct *mm, unsigned long address)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -309,7 +309,7 @@ void relay_signal(int sig, struct siginfo *si, struct uml_pt_regs *regs)
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
		printk(KERN_ERR "Attempted to relay unknown signal %d (si_code = %d) with errno %d\n",
 | 
							printk(KERN_ERR "Attempted to relay unknown signal %d (si_code = %d) with errno %d\n",
 | 
				
			||||||
		       sig, code, err);
 | 
							       sig, code, err);
 | 
				
			||||||
		force_sig(sig, current);
 | 
							force_sig(sig);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -129,7 +129,7 @@ asmlinkage int __sys_rt_sigreturn(struct pt_regs *regs)
 | 
				
			||||||
	return regs->UCreg_00;
 | 
						return regs->UCreg_00;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
badframe:
 | 
					badframe:
 | 
				
			||||||
	force_sig(SIGSEGV, current);
 | 
						force_sig(SIGSEGV);
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -268,7 +268,7 @@ bool emulate_vsyscall(struct pt_regs *regs, unsigned long address)
 | 
				
			||||||
	return true;
 | 
						return true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
sigsegv:
 | 
					sigsegv:
 | 
				
			||||||
	force_sig(SIGSEGV, current);
 | 
						force_sig(SIGSEGV);
 | 
				
			||||||
	return true;
 | 
						return true;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1329,7 +1329,7 @@ void do_machine_check(struct pt_regs *regs, long error_code)
 | 
				
			||||||
		local_irq_enable();
 | 
							local_irq_enable();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (kill_it || do_memory_failure(&m))
 | 
							if (kill_it || do_memory_failure(&m))
 | 
				
			||||||
			force_sig(SIGBUS, current);
 | 
								force_sig(SIGBUS);
 | 
				
			||||||
		local_irq_disable();
 | 
							local_irq_disable();
 | 
				
			||||||
		ist_end_non_atomic();
 | 
							ist_end_non_atomic();
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -857,7 +857,7 @@ void signal_fault(struct pt_regs *regs, void __user *frame, char *where)
 | 
				
			||||||
		pr_cont("\n");
 | 
							pr_cont("\n");
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	force_sig(SIGSEGV, me);
 | 
						force_sig(SIGSEGV);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifdef CONFIG_X86_X32_ABI
 | 
					#ifdef CONFIG_X86_X32_ABI
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -254,7 +254,7 @@ do_trap(int trapnr, int signr, char *str, struct pt_regs *regs,
 | 
				
			||||||
	show_signal(tsk, signr, "trap ", str, regs, error_code);
 | 
						show_signal(tsk, signr, "trap ", str, regs, error_code);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (!sicode)
 | 
						if (!sicode)
 | 
				
			||||||
		force_sig(signr, tsk);
 | 
							force_sig(signr);
 | 
				
			||||||
	else
 | 
						else
 | 
				
			||||||
		force_sig_fault(signr, sicode, addr, tsk);
 | 
							force_sig_fault(signr, sicode, addr, tsk);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -566,7 +566,7 @@ do_general_protection(struct pt_regs *regs, long error_code)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	show_signal(tsk, SIGSEGV, "", desc, regs, error_code);
 | 
						show_signal(tsk, SIGSEGV, "", desc, regs, error_code);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	force_sig(SIGSEGV, tsk);
 | 
						force_sig(SIGSEGV);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
NOKPROBE_SYMBOL(do_general_protection);
 | 
					NOKPROBE_SYMBOL(do_general_protection);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1087,7 +1087,7 @@ arch_uretprobe_hijack_return_addr(unsigned long trampoline_vaddr, struct pt_regs
 | 
				
			||||||
		pr_err("return address clobbered: pid=%d, %%sp=%#lx, %%ip=%#lx\n",
 | 
							pr_err("return address clobbered: pid=%d, %%sp=%#lx, %%ip=%#lx\n",
 | 
				
			||||||
		       current->pid, regs->sp, regs->ip);
 | 
							       current->pid, regs->sp, regs->ip);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		force_sig(SIGSEGV, current);
 | 
							force_sig(SIGSEGV);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return -1;
 | 
						return -1;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -583,7 +583,7 @@ int handle_vm86_trap(struct kernel_vm86_regs *regs, long error_code, int trapno)
 | 
				
			||||||
		return 1; /* we let this handle by the calling routine */
 | 
							return 1; /* we let this handle by the calling routine */
 | 
				
			||||||
	current->thread.trap_nr = trapno;
 | 
						current->thread.trap_nr = trapno;
 | 
				
			||||||
	current->thread.error_code = error_code;
 | 
						current->thread.error_code = error_code;
 | 
				
			||||||
	force_sig(SIGTRAP, current);
 | 
						force_sig(SIGTRAP);
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -912,7 +912,7 @@ void mpx_notify_unmap(struct mm_struct *mm, unsigned long start,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	ret = mpx_unmap_tables(mm, start, end);
 | 
						ret = mpx_unmap_tables(mm, start, end);
 | 
				
			||||||
	if (ret)
 | 
						if (ret)
 | 
				
			||||||
		force_sig(SIGSEGV, current);
 | 
							force_sig(SIGSEGV);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* MPX cannot handle addresses above 47 bits yet. */
 | 
					/* MPX cannot handle addresses above 47 bits yet. */
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -471,7 +471,7 @@ long sys_sigreturn(void)
 | 
				
			||||||
	return PT_REGS_SYSCALL_RET(¤t->thread.regs);
 | 
						return PT_REGS_SYSCALL_RET(¤t->thread.regs);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 segfault:
 | 
					 segfault:
 | 
				
			||||||
	force_sig(SIGSEGV, current);
 | 
						force_sig(SIGSEGV);
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -577,6 +577,6 @@ long sys_rt_sigreturn(void)
 | 
				
			||||||
	return PT_REGS_SYSCALL_RET(¤t->thread.regs);
 | 
						return PT_REGS_SYSCALL_RET(¤t->thread.regs);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 segfault:
 | 
					 segfault:
 | 
				
			||||||
	force_sig(SIGSEGV, current);
 | 
						force_sig(SIGSEGV);
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -270,7 +270,7 @@ asmlinkage long xtensa_rt_sigreturn(long a0, long a1, long a2, long a3,
 | 
				
			||||||
	return ret;
 | 
						return ret;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
badframe:
 | 
					badframe:
 | 
				
			||||||
	force_sig(SIGSEGV, current);
 | 
						force_sig(SIGSEGV);
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -184,7 +184,7 @@ void do_unhandled(struct pt_regs *regs, unsigned long exccause)
 | 
				
			||||||
			    "\tEXCCAUSE is %ld\n",
 | 
								    "\tEXCCAUSE is %ld\n",
 | 
				
			||||||
			    current->comm, task_pid_nr(current), regs->pc,
 | 
								    current->comm, task_pid_nr(current), regs->pc,
 | 
				
			||||||
			    exccause);
 | 
								    exccause);
 | 
				
			||||||
	force_sig(SIGILL, current);
 | 
						force_sig(SIGILL);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
| 
						 | 
					@ -306,7 +306,7 @@ do_illegal_instruction(struct pt_regs *regs)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pr_info_ratelimited("Illegal Instruction in '%s' (pid = %d, pc = %#010lx)\n",
 | 
						pr_info_ratelimited("Illegal Instruction in '%s' (pid = %d, pc = %#010lx)\n",
 | 
				
			||||||
			    current->comm, task_pid_nr(current), regs->pc);
 | 
								    current->comm, task_pid_nr(current), regs->pc);
 | 
				
			||||||
	force_sig(SIGILL, current);
 | 
						force_sig(SIGILL);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -354,7 +354,7 @@ do_debug(struct pt_regs *regs)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* If in user mode, send SIGTRAP signal to current process */
 | 
						/* If in user mode, send SIGTRAP signal to current process */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	force_sig(SIGTRAP, current);
 | 
						force_sig(SIGTRAP);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -225,7 +225,7 @@ void lkdtm_CORRUPT_USER_DS(void)
 | 
				
			||||||
	set_fs(KERNEL_DS);
 | 
						set_fs(KERNEL_DS);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* Make sure we do not keep running with a KERNEL_DS! */
 | 
						/* Make sure we do not keep running with a KERNEL_DS! */
 | 
				
			||||||
	force_sig(SIGKILL, current);
 | 
						force_sig(SIGKILL);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Test that VMAP_STACK is actually allocating with a leading guard page */
 | 
					/* Test that VMAP_STACK is actually allocating with a leading guard page */
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -335,7 +335,7 @@ extern int kill_pgrp(struct pid *pid, int sig, int priv);
 | 
				
			||||||
extern int kill_pid(struct pid *pid, int sig, int priv);
 | 
					extern int kill_pid(struct pid *pid, int sig, int priv);
 | 
				
			||||||
extern __must_check bool do_notify_parent(struct task_struct *, int);
 | 
					extern __must_check bool do_notify_parent(struct task_struct *, int);
 | 
				
			||||||
extern void __wake_up_parent(struct task_struct *p, struct task_struct *parent);
 | 
					extern void __wake_up_parent(struct task_struct *p, struct task_struct *parent);
 | 
				
			||||||
extern void force_sig(int, struct task_struct *);
 | 
					extern void force_sig(int);
 | 
				
			||||||
extern int send_sig(int, struct task_struct *, int);
 | 
					extern int send_sig(int, struct task_struct *, int);
 | 
				
			||||||
extern int zap_other_threads(struct task_struct *p);
 | 
					extern int zap_other_threads(struct task_struct *p);
 | 
				
			||||||
extern struct sigqueue *sigqueue_alloc(void);
 | 
					extern struct sigqueue *sigqueue_alloc(void);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -266,7 +266,7 @@ static inline void addr_limit_user_check(void)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (CHECK_DATA_CORRUPTION(!segment_eq(get_fs(), USER_DS),
 | 
						if (CHECK_DATA_CORRUPTION(!segment_eq(get_fs(), USER_DS),
 | 
				
			||||||
				  "Invalid address limit on user-mode return"))
 | 
									  "Invalid address limit on user-mode return"))
 | 
				
			||||||
		force_sig(SIGKILL, current);
 | 
							force_sig(SIGKILL);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifdef TIF_FSCHECK
 | 
					#ifdef TIF_FSCHECK
 | 
				
			||||||
	clear_thread_flag(TIF_FSCHECK);
 | 
						clear_thread_flag(TIF_FSCHECK);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2112,7 +2112,7 @@ static void handle_trampoline(struct pt_regs *regs)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 sigill:
 | 
					 sigill:
 | 
				
			||||||
	uprobe_warn(current, "handle uretprobe, sending SIGILL.");
 | 
						uprobe_warn(current, "handle uretprobe, sending SIGILL.");
 | 
				
			||||||
	force_sig(SIGILL, current);
 | 
						force_sig(SIGILL);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2228,7 +2228,7 @@ static void handle_singlestep(struct uprobe_task *utask, struct pt_regs *regs)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (unlikely(err)) {
 | 
						if (unlikely(err)) {
 | 
				
			||||||
		uprobe_warn(current, "execute the probed insn, sending SIGILL.");
 | 
							uprobe_warn(current, "execute the probed insn, sending SIGILL.");
 | 
				
			||||||
		force_sig(SIGILL, current);
 | 
							force_sig(SIGILL);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -296,7 +296,7 @@ void rseq_syscall(struct pt_regs *regs)
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
	if (!access_ok(t->rseq, sizeof(*t->rseq)) ||
 | 
						if (!access_ok(t->rseq, sizeof(*t->rseq)) ||
 | 
				
			||||||
	    rseq_get_rseq_cs(t, &rseq_cs) || in_rseq_cs(ip, &rseq_cs))
 | 
						    rseq_get_rseq_cs(t, &rseq_cs) || in_rseq_cs(ip, &rseq_cs))
 | 
				
			||||||
		force_sig(SIGSEGV, t);
 | 
							force_sig(SIGSEGV);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1595,9 +1595,9 @@ send_sig(int sig, struct task_struct *p, int priv)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
EXPORT_SYMBOL(send_sig);
 | 
					EXPORT_SYMBOL(send_sig);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void force_sig(int sig, struct task_struct *p)
 | 
					void force_sig(int sig)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	force_sig_info(sig, SEND_SIG_PRIV, p);
 | 
						force_sig_info(sig, SEND_SIG_PRIV, current);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
EXPORT_SYMBOL(force_sig);
 | 
					EXPORT_SYMBOL(force_sig);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1617,7 +1617,7 @@ void force_sigsegv(int sig)
 | 
				
			||||||
		p->sighand->action[sig - 1].sa.sa_handler = SIG_DFL;
 | 
							p->sighand->action[sig - 1].sa.sa_handler = SIG_DFL;
 | 
				
			||||||
		spin_unlock_irqrestore(&p->sighand->siglock, flags);
 | 
							spin_unlock_irqrestore(&p->sighand->siglock, flags);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	force_sig(SIGSEGV, p);
 | 
						force_sig(SIGSEGV);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int force_sig_fault(int sig, int code, void __user *addr
 | 
					int force_sig_fault(int sig, int code, void __user *addr
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -111,7 +111,7 @@ static int check_uid_transition(kuid_t parent, kuid_t child)
 | 
				
			||||||
	 * that could arise from a missing whitelist entry preventing a
 | 
						 * that could arise from a missing whitelist entry preventing a
 | 
				
			||||||
	 * privileged process from dropping to a lesser-privileged one.
 | 
						 * privileged process from dropping to a lesser-privileged one.
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	force_sig(SIGKILL, current);
 | 
						force_sig(SIGKILL);
 | 
				
			||||||
	return -EACCES;
 | 
						return -EACCES;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -203,7 +203,7 @@ static int safesetid_task_fix_setuid(struct cred *new,
 | 
				
			||||||
		break;
 | 
							break;
 | 
				
			||||||
	default:
 | 
						default:
 | 
				
			||||||
		pr_warn("Unknown setid state %d\n", flags);
 | 
							pr_warn("Unknown setid state %d\n", flags);
 | 
				
			||||||
		force_sig(SIGKILL, current);
 | 
							force_sig(SIGKILL);
 | 
				
			||||||
		return -EINVAL;
 | 
							return -EINVAL;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue