Module Name:    src
Committed By:   riastradh
Date:           Sat Mar 29 00:16:30 UTC 2025

Modified Files:
        src/sys/arch/vax/vax: trap.c

Log Message:
vax/trap.c: Back out revisions 1.139 and 1.141 for now.

These changes served to zero registers on exec in order to avoid
leaking secret register content to the replacement process image.

Unfortunately, I did not adequately test these changes, and the vax
testbed has been unhappy since they went in.  It's possible they're
not the culprit -- it's possible that 1.141 (setting PSL_U|PSL_PREVU)
was enough to fix the bug introduced by 1.139 -- but let's just try
backing both out so we can let the releng testbed figure out for me
whether to go chasing other parts of the trapframe to set up
(tf_trap=T_SYSCALL? tf_code=???) or this is a wild goose chase and
it's actually something else broken.

PR kern/59084: exec/spawn leaks register content


To generate a diff of this commit:
cvs rdiff -u -r1.141 -r1.142 src/sys/arch/vax/vax/trap.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/vax/vax/trap.c
diff -u src/sys/arch/vax/vax/trap.c:1.141 src/sys/arch/vax/vax/trap.c:1.142
--- src/sys/arch/vax/vax/trap.c:1.141	Sat Mar 22 13:28:35 2025
+++ src/sys/arch/vax/vax/trap.c	Sat Mar 29 00:16:30 2025
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.141 2025/03/22 13:28:35 riastradh Exp $     */
+/*	$NetBSD: trap.c,v 1.142 2025/03/29 00:16:30 riastradh Exp $     */
 
 /*
  * Copyright (c) 1994 Ludd, University of Lule}, Sweden.
@@ -28,7 +28,7 @@
  /* All bugs are subject to removal without further notice */
 		
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.141 2025/03/22 13:28:35 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.142 2025/03/29 00:16:30 riastradh Exp $");
 
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
@@ -371,15 +371,12 @@ setregs(struct lwp *l, struct exec_packa
 {
 	struct trapframe * const tf = l->l_md.md_utf;
 
-	memset(tf, 0, sizeof(*tf));
-
 	tf->tf_pc = pack->ep_entry + 2;
 	tf->tf_sp = stack;
 	tf->tf_r6 = stack;				/* for ELF */
 	tf->tf_r7 = 0;				/* for ELF */
 	tf->tf_r8 = 0;				/* for ELF */
 	tf->tf_r9 = l->l_proc->p_psstrp;		/* for ELF */
-	tf->tf_psl = PSL_U|PSL_PREVU;
 }
 
 

Reply via email to