aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2021-09-16 13:48:27 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2021-09-21 17:20:15 +0000
commit2e79a216329f62a78dbbc72256e782353e220968 (patch)
tree453b3d5c0e818322f98b6c33b178d6227e9b6d7d
parentbd9e0f5df681da8b5ef05a587b4b5b07572d3fc2 (diff)
downloadsrc-2e79a216329f62a78dbbc72256e782353e220968.tar.gz
src-2e79a216329f62a78dbbc72256e782353e220968.zip
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
-rw-r--r--sys/amd64/amd64/exec_machdep.c5
-rw-r--r--sys/amd64/linux/linux_sysvec.c6
2 files changed, 6 insertions, 5 deletions
diff --git a/sys/amd64/amd64/exec_machdep.c b/sys/amd64/amd64/exec_machdep.c
index 168c24cbb65b..d605f080871a 100644
--- a/sys/amd64/amd64/exec_machdep.c
+++ b/sys/amd64/amd64/exec_machdep.c
@@ -197,9 +197,8 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
(xfpusave != NULL && copyout(xfpusave,
(void *)sf.sf_uc.uc_mcontext.mc_xfpustate, xfpusave_len)
!= 0)) {
-#ifdef DEBUG
- printf("process %ld has trashed its stack\n", (long)p->p_pid);
-#endif
+ uprintf("pid %d comm %s has trashed its stack, killing\n",
+ p->p_pid, p->p_comm);
PROC_LOCK(p);
sigexit(td, SIGILL);
}
diff --git a/sys/amd64/linux/linux_sysvec.c b/sys/amd64/linux/linux_sysvec.c
index d6f2ec2ab832..b7aedff23536 100644
--- a/sys/amd64/linux/linux_sysvec.c
+++ b/sys/amd64/linux/linux_sysvec.c
@@ -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.
*/
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);
}
@@ -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.
*/
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);
ksi.ksi_signo = SIGBUS;
ksi.ksi_code = BUS_OBJERR;