amd64: consistently use uprintf() to report weird situations in sigreturn
Reviewed by: jhb Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D31954
This commit is contained in:
parent
bd9e0f5df6
commit
2e79a21632
@ -197,9 +197,8 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
|
|||||||
(xfpusave != NULL && copyout(xfpusave,
|
(xfpusave != NULL && copyout(xfpusave,
|
||||||
(void *)sf.sf_uc.uc_mcontext.mc_xfpustate, xfpusave_len)
|
(void *)sf.sf_uc.uc_mcontext.mc_xfpustate, xfpusave_len)
|
||||||
!= 0)) {
|
!= 0)) {
|
||||||
#ifdef DEBUG
|
uprintf("pid %d comm %s has trashed its stack, killing\n",
|
||||||
printf("process %ld has trashed its stack\n", (long)p->p_pid);
|
p->p_pid, p->p_comm);
|
||||||
#endif
|
|
||||||
PROC_LOCK(p);
|
PROC_LOCK(p);
|
||||||
sigexit(td, SIGILL);
|
sigexit(td, SIGILL);
|
||||||
}
|
}
|
||||||
|
@ -556,7 +556,8 @@ linux_rt_sigreturn(struct thread *td, struct linux_rt_sigreturn_args *args)
|
|||||||
* one less debugger trap, so allowing it is fairly harmless.
|
* one less debugger trap, so allowing it is fairly harmless.
|
||||||
*/
|
*/
|
||||||
if (!EFL_SECURE(rflags & ~PSL_RF, regs->tf_rflags & ~PSL_RF)) {
|
if (!EFL_SECURE(rflags & ~PSL_RF, regs->tf_rflags & ~PSL_RF)) {
|
||||||
printf("linux_rt_sigreturn: rflags = 0x%lx\n", rflags);
|
uprintf("pid %d comm %s linux mangled rflags %#lx\n",
|
||||||
|
p->p_pid, p->p_comm, rflags);
|
||||||
return (EINVAL);
|
return (EINVAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -566,7 +567,8 @@ linux_rt_sigreturn(struct thread *td, struct linux_rt_sigreturn_args *args)
|
|||||||
* other selectors, invalid %eip's and invalid %esp's.
|
* other selectors, invalid %eip's and invalid %esp's.
|
||||||
*/
|
*/
|
||||||
if (!CS_SECURE(context->sc_cs)) {
|
if (!CS_SECURE(context->sc_cs)) {
|
||||||
printf("linux_rt_sigreturn: cs = 0x%x\n", context->sc_cs);
|
uprintf("pid %d comm %s linux mangled cs %#x\n",
|
||||||
|
p->p_pid, p->p_comm, context->sc_cs);
|
||||||
ksiginfo_init_trap(&ksi);
|
ksiginfo_init_trap(&ksi);
|
||||||
ksi.ksi_signo = SIGBUS;
|
ksi.ksi_signo = SIGBUS;
|
||||||
ksi.ksi_code = BUS_OBJERR;
|
ksi.ksi_code = BUS_OBJERR;
|
||||||
|
Loading…
Reference in New Issue
Block a user