Module Name: src Committed By: hans Date: Fri Feb 28 20:11:21 UTC 2025
Modified Files: src/sys/arch/vax/vax: vm_machdep.c Log Message: vax: explicitly zero AP and FP in the CALLS frame in cpu_lwp_fork() This prevents a recursive panic when ddb(4) tries to trace the stack back across cpu_lwp_bootstrap(). The CALLS frame in question is put in place by cpu_lwp_fork() to make it look as if cpu_lwp_bootstrap() was called from sret, which is detected by db_dump_stack() but only if the FP of the frame is also 0. To generate a diff of this commit: cvs rdiff -u -r1.118 -r1.119 src/sys/arch/vax/vax/vm_machdep.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/vm_machdep.c diff -u src/sys/arch/vax/vax/vm_machdep.c:1.118 src/sys/arch/vax/vax/vm_machdep.c:1.119 --- src/sys/arch/vax/vax/vm_machdep.c:1.118 Mon May 22 16:53:05 2017 +++ src/sys/arch/vax/vax/vm_machdep.c Fri Feb 28 20:11:21 2025 @@ -1,4 +1,4 @@ -/* $NetBSD: vm_machdep.c,v 1.118 2017/05/22 16:53:05 ragge Exp $ */ +/* $NetBSD: vm_machdep.c,v 1.119 2025/02/28 20:11:21 hans Exp $ */ /* * Copyright (c) 1994 Ludd, University of Lule}, Sweden. @@ -26,7 +26,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.118 2017/05/22 16:53:05 ragge Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.119 2025/02/28 20:11:21 hans Exp $"); #include "opt_execfmt.h" #include "opt_compat_ultrix.h" @@ -124,6 +124,8 @@ cpu_lwp_fork(struct lwp *l1, struct lwp cf = (struct callsframe *)tf - 1; cf->ca_cond = 0; cf->ca_maskpsw = 0x20000000; /* CALLS stack frame, no registers */ + cf->ca_ap = 0; + cf->ca_fp = 0; cf->ca_pc = (uintptr_t)&sret; /* return PC; userspace trampoline */ cf->ca_argno = 1; cf->ca_arg1 = 0; /* unused */