From: miod Date: Fri, 12 Aug 2022 17:19:52 +0000 (+0000) Subject: Make sure we don't pass uninitialized siginfo values to trapsignal(); from X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=f46ffae94be21408e0f595a56a8480f9a9314303;p=openbsd Make sure we don't pass uninitialized siginfo values to trapsignal(); from clang via jsg@, ok jsg@ --- diff --git a/sys/arch/alpha/alpha/trap.c b/sys/arch/alpha/alpha/trap.c index 0915657ccf5..c80e0141d91 100644 --- a/sys/arch/alpha/alpha/trap.c +++ b/sys/arch/alpha/alpha/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.101 2022/08/10 10:41:35 miod Exp $ */ +/* $OpenBSD: trap.c,v 1.102 2022/08/12 17:19:52 miod Exp $ */ /* $NetBSD: trap.c,v 1.52 2000/05/24 16:48:33 thorpej Exp $ */ /*- @@ -224,6 +224,7 @@ trap(a0, a1, a2, entry, framep) p = curproc; ucode = 0; v = 0; + typ = SI_NOINFO; framep->tf_regs[FRAME_SP] = alpha_pal_rdusp(); user = (framep->tf_regs[FRAME_PS] & ALPHA_PSL_USERMODE) != 0; if (user) { diff --git a/sys/arch/hppa/hppa/trap.c b/sys/arch/hppa/hppa/trap.c index 36827bc23a8..d5080df7e3e 100644 --- a/sys/arch/hppa/hppa/trap.c +++ b/sys/arch/hppa/hppa/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.157 2022/07/20 05:56:34 deraadt Exp $ */ +/* $OpenBSD: trap.c,v 1.158 2022/08/12 17:19:52 miod Exp $ */ /* * Copyright (c) 1998-2004 Michael Shalayeff @@ -272,6 +272,7 @@ trap(int type, struct trapframe *frame) KERNEL_UNLOCK(); #endif /* pass to user debugger */ + sv.sival_int = va; trapsignal(p, SIGTRAP, type & ~T_USER, code, sv); } break; @@ -282,6 +283,7 @@ trap(int type, struct trapframe *frame) ss_clear_breakpoints(p); KERNEL_UNLOCK(); /* pass to user debugger */ + sv.sival_int = va; trapsignal(p, SIGTRAP, type & ~T_USER, TRAP_TRACE, sv); break; #endif