Print this page
15254 %ymm registers not restored after signal handler
15367 x86 getfpregs() summons corrupting %xmm ghosts
15333 want x86 /proc xregs support (libc_db, libproc, mdb, etc.)
15336 want libc functions for extended ucontext_t
15334 want ps_lwphandle-specific reg routines
15328 FPU_CW_INIT mistreats reserved bit
15335 i86pc fpu_subr.c isn't really platform-specific
15332 setcontext(2) isn't actually noreturn
15331 need <sys/stdalign.h>
Change-Id: I7060aa86042dfb989f77fc3323c065ea2eafa9ad
Conflicts:
usr/src/uts/common/fs/proc/prcontrol.c
usr/src/uts/intel/os/archdep.c
usr/src/uts/intel/sys/ucontext.h
usr/src/uts/intel/syscall/getcontext.c
@@ -22,27 +22,39 @@
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
+/*
+ * Copyright 2023 Oxide Computer Company
+ */
+
#include "lint.h"
#include <sys/types.h>
#include <sys/ucontext.h>
#include <setjmp.h>
#include <ucontext.h>
+#include <strings.h>
+#include <upanic.h>
#include "sigjmp_struct.h"
#include "libc.h"
#pragma weak _siglongjmp = siglongjmp
void
siglongjmp(sigjmp_buf env, int val)
{
+ const char *msg = "siglongjmp(): setcontext() returned";
ucontext_t *ucp = SIGJMP2UCONTEXT(env);
if (val)
ucp->uc_mcontext.gregs[REG_R0] = val;
else
ucp->uc_mcontext.gregs[REG_R0] = 1;
+ /*
+ * While unlikely, it is possible that setcontext() may fail for some
+ * reason. If that happens, we will kill the process.
+ */
(void) setcontext(ucp);
+ upanic(msg, strlen(msg) + 1);
}