Module Name: src Committed By: christos Date: Mon Jan 10 19:51:30 UTC 2022
Modified Files: src/lib/libkvm: kvm.c kvm_aarch64.c kvm_alpha.c kvm_arm.c kvm_hppa.c kvm_i386.c kvm_m68k.c kvm_mips.c kvm_or1k.c kvm_powerpc.c kvm_powerpc64.c kvm_private.h kvm_proc.c kvm_riscv.c kvm_sh3.c kvm_sparc.c kvm_sparc64.c kvm_vax.c kvm_x86_64.c Log Message: Get rid of usrstack/USRSTACK. Document that the old version of getargv is broken because of ASLR. To generate a diff of this commit: cvs rdiff -u -r1.109 -r1.110 src/lib/libkvm/kvm.c cvs rdiff -u -r1.10 -r1.11 src/lib/libkvm/kvm_aarch64.c cvs rdiff -u -r1.27 -r1.28 src/lib/libkvm/kvm_alpha.c cvs rdiff -u -r1.6 -r1.7 src/lib/libkvm/kvm_arm.c \ src/lib/libkvm/kvm_powerpc64.c cvs rdiff -u -r1.7 -r1.8 src/lib/libkvm/kvm_hppa.c cvs rdiff -u -r1.31 -r1.32 src/lib/libkvm/kvm_i386.c cvs rdiff -u -r1.19 -r1.20 src/lib/libkvm/kvm_m68k.c cvs rdiff -u -r1.22 -r1.23 src/lib/libkvm/kvm_mips.c cvs rdiff -u -r1.1 -r1.2 src/lib/libkvm/kvm_or1k.c src/lib/libkvm/kvm_riscv.c cvs rdiff -u -r1.13 -r1.14 src/lib/libkvm/kvm_powerpc.c cvs rdiff -u -r1.21 -r1.22 src/lib/libkvm/kvm_private.h cvs rdiff -u -r1.95 -r1.96 src/lib/libkvm/kvm_proc.c cvs rdiff -u -r1.9 -r1.10 src/lib/libkvm/kvm_sh3.c cvs rdiff -u -r1.35 -r1.36 src/lib/libkvm/kvm_sparc.c cvs rdiff -u -r1.17 -r1.18 src/lib/libkvm/kvm_sparc64.c cvs rdiff -u -r1.20 -r1.21 src/lib/libkvm/kvm_vax.c cvs rdiff -u -r1.12 -r1.13 src/lib/libkvm/kvm_x86_64.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/lib/libkvm/kvm.c diff -u src/lib/libkvm/kvm.c:1.109 src/lib/libkvm/kvm.c:1.110 --- src/lib/libkvm/kvm.c:1.109 Sat May 2 10:31:13 2020 +++ src/lib/libkvm/kvm.c Mon Jan 10 14:51:30 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: kvm.c,v 1.109 2020/05/02 14:31:13 christos Exp $ */ +/* $NetBSD: kvm.c,v 1.110 2022/01/10 19:51:30 christos Exp $ */ /*- * Copyright (c) 1989, 1992, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)kvm.c 8.2 (Berkeley) 2/13/94"; #else -__RCSID("$NetBSD: kvm.c,v 1.109 2020/05/02 14:31:13 christos Exp $"); +__RCSID("$NetBSD: kvm.c,v 1.110 2022/01/10 19:51:30 christos Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -289,7 +289,7 @@ _kvm_open(kvm_t *kd, const char *uf, con /* * Call the MD open hook. This sets: - * usrstack, min_uva, max_uva + * min_uva, max_uva */ if (_kvm_mdopen(kd)) { _kvm_err(kd, kd->program, "md init failed"); Index: src/lib/libkvm/kvm_aarch64.c diff -u src/lib/libkvm/kvm_aarch64.c:1.10 src/lib/libkvm/kvm_aarch64.c:1.11 --- src/lib/libkvm/kvm_aarch64.c:1.10 Tue Nov 10 14:14:11 2020 +++ src/lib/libkvm/kvm_aarch64.c Mon Jan 10 14:51:30 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: kvm_aarch64.c,v 1.10 2020/11/10 19:14:11 skrll Exp $ */ +/* $NetBSD: kvm_aarch64.c,v 1.11 2022/01/10 19:51:30 christos Exp $ */ /*- * Copyright (c) 2014, 2018 The NetBSD Foundation, Inc. @@ -49,7 +49,7 @@ #include "kvm_private.h" -__RCSID("$NetBSD: kvm_aarch64.c,v 1.10 2020/11/10 19:14:11 skrll Exp $"); +__RCSID("$NetBSD: kvm_aarch64.c,v 1.11 2022/01/10 19:51:30 christos Exp $"); /*ARGSUSED*/ void @@ -197,7 +197,6 @@ int _kvm_mdopen(kvm_t *kd) { - kd->usrstack = USRSTACK; kd->min_uva = VM_MIN_ADDRESS; kd->max_uva = VM_MAXUSER_ADDRESS; Index: src/lib/libkvm/kvm_alpha.c diff -u src/lib/libkvm/kvm_alpha.c:1.27 src/lib/libkvm/kvm_alpha.c:1.28 --- src/lib/libkvm/kvm_alpha.c:1.27 Wed Feb 19 15:21:22 2014 +++ src/lib/libkvm/kvm_alpha.c Mon Jan 10 14:51:30 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: kvm_alpha.c,v 1.27 2014/02/19 20:21:22 dsl Exp $ */ +/* $NetBSD: kvm_alpha.c,v 1.28 2022/01/10 19:51:30 christos Exp $ */ /* * Copyright (c) 1994, 1995 Carnegie-Mellon University. @@ -50,7 +50,7 @@ #include "kvm_private.h" -__RCSID("$NetBSD: kvm_alpha.c,v 1.27 2014/02/19 20:21:22 dsl Exp $"); +__RCSID("$NetBSD: kvm_alpha.c,v 1.28 2022/01/10 19:51:30 christos Exp $"); /*ARGSUSED*/ void @@ -186,7 +186,6 @@ int _kvm_mdopen(kvm_t *kd) { - kd->usrstack = USRSTACK; kd->min_uva = VM_MIN_ADDRESS; kd->max_uva = VM_MAXUSER_ADDRESS; Index: src/lib/libkvm/kvm_arm.c diff -u src/lib/libkvm/kvm_arm.c:1.6 src/lib/libkvm/kvm_arm.c:1.7 --- src/lib/libkvm/kvm_arm.c:1.6 Mon Sep 20 19:23:16 2010 +++ src/lib/libkvm/kvm_arm.c Mon Jan 10 14:51:30 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: kvm_arm.c,v 1.6 2010/09/20 23:23:16 jym Exp $ */ +/* $NetBSD: kvm_arm.c,v 1.7 2022/01/10 19:51:30 christos Exp $ */ /*- * Copyright (C) 1996 Wolfgang Solfrank. @@ -39,7 +39,7 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: kvm_arm.c,v 1.6 2010/09/20 23:23:16 jym Exp $"); +__RCSID("$NetBSD: kvm_arm.c,v 1.7 2022/01/10 19:51:30 christos Exp $"); #endif /* LIBC_SCCS and not lint */ #include <sys/param.h> @@ -194,13 +194,11 @@ _kvm_mdopen(kvm_t * kd) extern struct ps_strings *__ps_strings; #if 0 /* XXX - These vary across arm machines... */ - kd->usrstack = USRSTACK; kd->min_uva = VM_MIN_ADDRESS; kd->max_uva = VM_MAXUSER_ADDRESS; #endif /* This is somewhat hack-ish, but it works. */ max_uva = (uintptr_t) (__ps_strings + 1); - kd->usrstack = max_uva; kd->max_uva = max_uva; kd->min_uva = 0; Index: src/lib/libkvm/kvm_powerpc64.c diff -u src/lib/libkvm/kvm_powerpc64.c:1.6 src/lib/libkvm/kvm_powerpc64.c:1.7 --- src/lib/libkvm/kvm_powerpc64.c:1.6 Fri Aug 22 22:25:23 2014 +++ src/lib/libkvm/kvm_powerpc64.c Mon Jan 10 14:51:30 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: kvm_powerpc64.c,v 1.6 2014/08/23 02:25:23 matt Exp $ */ +/* $NetBSD: kvm_powerpc64.c,v 1.7 2022/01/10 19:51:30 christos Exp $ */ /* * Copyright (c) 2005 Wasabi Systems, Inc. @@ -90,7 +90,7 @@ #include <powerpc/oea/bat.h> #include <powerpc/oea/pte.h> -__RCSID("$NetBSD: kvm_powerpc64.c,v 1.6 2014/08/23 02:25:23 matt Exp $"); +__RCSID("$NetBSD: kvm_powerpc64.c,v 1.7 2022/01/10 19:51:30 christos Exp $"); void _kvm_freevtop(kvm_t *kd) @@ -170,13 +170,11 @@ _kvm_mdopen(kvm_t *kd) extern struct ps_strings *__ps_strings; #if 0 /* XXX - These vary across powerpc machines... */ - kd->usrstack = USRSTACK; kd->min_uva = VM_MIN_ADDRESS; kd->max_uva = VM_MAXUSER_ADDRESS; #endif /* This is somewhat hack-ish, but it works. */ max_uva = (uintptr_t) (__ps_strings + 1); - kd->usrstack = max_uva; kd->max_uva = max_uva; kd->min_uva = 0; Index: src/lib/libkvm/kvm_hppa.c diff -u src/lib/libkvm/kvm_hppa.c:1.7 src/lib/libkvm/kvm_hppa.c:1.8 --- src/lib/libkvm/kvm_hppa.c:1.7 Wed Feb 19 15:21:22 2014 +++ src/lib/libkvm/kvm_hppa.c Mon Jan 10 14:51:30 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: kvm_hppa.c,v 1.7 2014/02/19 20:21:22 dsl Exp $ */ +/* $NetBSD: kvm_hppa.c,v 1.8 2022/01/10 19:51:30 christos Exp $ */ /*- * Copyright (c) 1989, 1992, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)kvm_hp300.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: kvm_hppa.c,v 1.7 2014/02/19 20:21:22 dsl Exp $"); +__RCSID("$NetBSD: kvm_hppa.c,v 1.8 2022/01/10 19:51:30 christos Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -197,7 +197,6 @@ int _kvm_mdopen(kvm_t *kd) { - kd->usrstack = USRSTACK; kd->min_uva = VM_MIN_ADDRESS; kd->max_uva = VM_MAXUSER_ADDRESS; Index: src/lib/libkvm/kvm_i386.c diff -u src/lib/libkvm/kvm_i386.c:1.31 src/lib/libkvm/kvm_i386.c:1.32 --- src/lib/libkvm/kvm_i386.c:1.31 Sat Apr 25 01:17:16 2020 +++ src/lib/libkvm/kvm_i386.c Mon Jan 10 14:51:30 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: kvm_i386.c,v 1.31 2020/04/25 05:17:16 maxv Exp $ */ +/* $NetBSD: kvm_i386.c,v 1.32 2022/01/10 19:51:30 christos Exp $ */ /*- * Copyright (c) 1989, 1992, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)kvm_hp300.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: kvm_i386.c,v 1.31 2020/04/25 05:17:16 maxv Exp $"); +__RCSID("$NetBSD: kvm_i386.c,v 1.32 2022/01/10 19:51:30 christos Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -228,7 +228,6 @@ int _kvm_mdopen(kvm_t *kd) { - kd->usrstack = USRSTACK; kd->min_uva = VM_MIN_ADDRESS; kd->max_uva = VM_MAXUSER_ADDRESS; Index: src/lib/libkvm/kvm_m68k.c diff -u src/lib/libkvm/kvm_m68k.c:1.19 src/lib/libkvm/kvm_m68k.c:1.20 --- src/lib/libkvm/kvm_m68k.c:1.19 Mon Jan 27 16:00:01 2014 +++ src/lib/libkvm/kvm_m68k.c Mon Jan 10 14:51:30 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: kvm_m68k.c,v 1.19 2014/01/27 21:00:01 matt Exp $ */ +/* $NetBSD: kvm_m68k.c,v 1.20 2022/01/10 19:51:30 christos Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -59,7 +59,7 @@ #include "kvm_private.h" #include "kvm_m68k.h" -__RCSID("$NetBSD: kvm_m68k.c,v 1.19 2014/01/27 21:00:01 matt Exp $"); +__RCSID("$NetBSD: kvm_m68k.c,v 1.20 2022/01/10 19:51:30 christos Exp $"); struct name_ops { const char *name; @@ -157,13 +157,11 @@ _kvm_mdopen(kvm_t *kd) extern struct ps_strings *__ps_strings; #if 0 /* XXX - These vary across m68k machines... */ - kd->usrstack = USRSTACK; kd->min_uva = VM_MIN_ADDRESS; kd->max_uva = VM_MAXUSER_ADDRESS; #endif /* This is somewhat hack-ish, but it works. */ max_uva = (u_long) (__ps_strings + 1); - kd->usrstack = max_uva; kd->max_uva = max_uva; kd->min_uva = 0; Index: src/lib/libkvm/kvm_mips.c diff -u src/lib/libkvm/kvm_mips.c:1.22 src/lib/libkvm/kvm_mips.c:1.23 --- src/lib/libkvm/kvm_mips.c:1.22 Wed Feb 19 15:21:22 2014 +++ src/lib/libkvm/kvm_mips.c Mon Jan 10 14:51:30 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: kvm_mips.c,v 1.22 2014/02/19 20:21:22 dsl Exp $ */ +/* $NetBSD: kvm_mips.c,v 1.23 2022/01/10 19:51:30 christos Exp $ */ /* * Copyright (c) 1994, 1995 Carnegie-Mellon University. @@ -34,7 +34,7 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: kvm_mips.c,v 1.22 2014/02/19 20:21:22 dsl Exp $"); +__RCSID("$NetBSD: kvm_mips.c,v 1.23 2022/01/10 19:51:30 christos Exp $"); #endif /* LIBC_SCCS and not lint */ /* @@ -236,7 +236,6 @@ int _kvm_mdopen(kvm_t *kd) { - kd->usrstack = USRSTACK; kd->min_uva = VM_MIN_ADDRESS; kd->max_uva = VM_MAXUSER_ADDRESS; Index: src/lib/libkvm/kvm_or1k.c diff -u src/lib/libkvm/kvm_or1k.c:1.1 src/lib/libkvm/kvm_or1k.c:1.2 --- src/lib/libkvm/kvm_or1k.c:1.1 Wed Sep 3 15:34:26 2014 +++ src/lib/libkvm/kvm_or1k.c Mon Jan 10 14:51:30 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: kvm_or1k.c,v 1.1 2014/09/03 19:34:26 matt Exp $ */ +/* $NetBSD: kvm_or1k.c,v 1.2 2022/01/10 19:51:30 christos Exp $ */ /*- * Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -51,7 +51,7 @@ #include <machine/kcore.h> #include <machine/vmparam.h> -__RCSID("$NetBSD: kvm_or1k.c,v 1.1 2014/09/03 19:34:26 matt Exp $"); +__RCSID("$NetBSD: kvm_or1k.c,v 1.2 2022/01/10 19:51:30 christos Exp $"); void _kvm_freevtop(kvm_t *kd) @@ -118,7 +118,6 @@ _kvm_pa2off(kvm_t *kd, paddr_t pa) int _kvm_mdopen(kvm_t *kd) { - kd->usrstack = USRSTACK; kd->min_uva = VM_MIN_ADDRESS; kd->max_uva = VM_MAXUSER_ADDRESS; Index: src/lib/libkvm/kvm_riscv.c diff -u src/lib/libkvm/kvm_riscv.c:1.1 src/lib/libkvm/kvm_riscv.c:1.2 --- src/lib/libkvm/kvm_riscv.c:1.1 Fri Sep 19 13:36:25 2014 +++ src/lib/libkvm/kvm_riscv.c Mon Jan 10 14:51:30 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: kvm_riscv.c,v 1.1 2014/09/19 17:36:25 matt Exp $ */ +/* $NetBSD: kvm_riscv.c,v 1.2 2022/01/10 19:51:30 christos Exp $ */ /*- * Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -51,7 +51,7 @@ #include <machine/kcore.h> #include <machine/vmparam.h> -__RCSID("$NetBSD: kvm_riscv.c,v 1.1 2014/09/19 17:36:25 matt Exp $"); +__RCSID("$NetBSD: kvm_riscv.c,v 1.2 2022/01/10 19:51:30 christos Exp $"); void _kvm_freevtop(kvm_t *kd) @@ -118,7 +118,6 @@ _kvm_pa2off(kvm_t *kd, paddr_t pa) int _kvm_mdopen(kvm_t *kd) { - kd->usrstack = USRSTACK; kd->min_uva = VM_MIN_ADDRESS; kd->max_uva = VM_MAXUSER_ADDRESS; Index: src/lib/libkvm/kvm_powerpc.c diff -u src/lib/libkvm/kvm_powerpc.c:1.13 src/lib/libkvm/kvm_powerpc.c:1.14 --- src/lib/libkvm/kvm_powerpc.c:1.13 Mon Jan 27 16:00:01 2014 +++ src/lib/libkvm/kvm_powerpc.c Mon Jan 10 14:51:30 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: kvm_powerpc.c,v 1.13 2014/01/27 21:00:01 matt Exp $ */ +/* $NetBSD: kvm_powerpc.c,v 1.14 2022/01/10 19:51:30 christos Exp $ */ /* * Copyright (c) 2005 Wasabi Systems, Inc. @@ -91,7 +91,7 @@ #include <powerpc/oea/bat.h> #include <powerpc/oea/pte.h> -__RCSID("$NetBSD: kvm_powerpc.c,v 1.13 2014/01/27 21:00:01 matt Exp $"); +__RCSID("$NetBSD: kvm_powerpc.c,v 1.14 2022/01/10 19:51:30 christos Exp $"); static int _kvm_match_601bat(kvm_t *, vaddr_t, paddr_t *, int *); static int _kvm_match_bat(kvm_t *, vaddr_t, paddr_t *, int *); @@ -367,13 +367,11 @@ _kvm_mdopen(kvm_t *kd) extern struct ps_strings *__ps_strings; #if 0 /* XXX - These vary across powerpc machines... */ - kd->usrstack = USRSTACK; kd->min_uva = VM_MIN_ADDRESS; kd->max_uva = VM_MAXUSER_ADDRESS; #endif /* This is somewhat hack-ish, but it works. */ max_uva = (uintptr_t) (__ps_strings + 1); - kd->usrstack = max_uva; kd->max_uva = max_uva; kd->min_uva = 0; Index: src/lib/libkvm/kvm_private.h diff -u src/lib/libkvm/kvm_private.h:1.21 src/lib/libkvm/kvm_private.h:1.22 --- src/lib/libkvm/kvm_private.h:1.21 Mon Apr 27 20:12:01 2020 +++ src/lib/libkvm/kvm_private.h Mon Jan 10 14:51:30 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: kvm_private.h,v 1.21 2020/04/28 00:12:01 christos Exp $ */ +/* $NetBSD: kvm_private.h,v 1.22 2022/01/10 19:51:30 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -55,7 +55,6 @@ struct __kvm { size_t procbase_len; size_t procbase2_len; size_t lwpbase_len; - u_long usrstack; /* address of end of user stack */ u_long min_uva, max_uva; /* min/max user virtual address */ int nbpg; /* page size */ char *swapspc; /* (dynamic) storage for swapped pages */ Index: src/lib/libkvm/kvm_proc.c diff -u src/lib/libkvm/kvm_proc.c:1.95 src/lib/libkvm/kvm_proc.c:1.96 --- src/lib/libkvm/kvm_proc.c:1.95 Mon Jul 19 06:30:36 2021 +++ src/lib/libkvm/kvm_proc.c Mon Jan 10 14:51:30 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: kvm_proc.c,v 1.95 2021/07/19 10:30:36 christos Exp $ */ +/* $NetBSD: kvm_proc.c,v 1.96 2022/01/10 19:51:30 christos Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -67,7 +67,7 @@ #if 0 static char sccsid[] = "@(#)kvm_proc.c 8.3 (Berkeley) 9/23/93"; #else -__RCSID("$NetBSD: kvm_proc.c,v 1.95 2021/07/19 10:30:36 christos Exp $"); +__RCSID("$NetBSD: kvm_proc.c,v 1.96 2022/01/10 19:51:30 christos Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -1057,6 +1057,7 @@ proc_verify(kvm_t *kd, u_long kernp, con (kernproc.p_stat != SZOMB || p->p_stat == SZOMB)); } +extern struct ps_strings *__ps_strings; static char ** kvm_doargv(kvm_t *kd, const struct miniproc *p, int nchr, void (*info)(struct ps_strings *, u_long *, int *)) @@ -1071,7 +1072,8 @@ kvm_doargv(kvm_t *kd, const struct minip */ if (p->p_stat == SZOMB) return (NULL); - cnt = (int)kvm_ureadm(kd, p, kd->usrstack - sizeof(arginfo), + /* XXX: this is broken for ASLR: we need to read p->p_psstr instead */ + cnt = (int)kvm_ureadm(kd, p, (u_long)(intptr_t)__ps_strings, (void *)&arginfo, sizeof(arginfo)); if (cnt != sizeof(arginfo)) return (NULL); Index: src/lib/libkvm/kvm_sh3.c diff -u src/lib/libkvm/kvm_sh3.c:1.9 src/lib/libkvm/kvm_sh3.c:1.10 --- src/lib/libkvm/kvm_sh3.c:1.9 Wed Feb 19 15:21:22 2014 +++ src/lib/libkvm/kvm_sh3.c Mon Jan 10 14:51:30 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: kvm_sh3.c,v 1.9 2014/02/19 20:21:22 dsl Exp $ */ +/* $NetBSD: kvm_sh3.c,v 1.10 2022/01/10 19:51:30 christos Exp $ */ /*- * Copyright (c) 1989, 1992, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)kvm_hp300.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: kvm_sh3.c,v 1.9 2014/02/19 20:21:22 dsl Exp $"); +__RCSID("$NetBSD: kvm_sh3.c,v 1.10 2022/01/10 19:51:30 christos Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -118,7 +118,6 @@ int _kvm_mdopen(kvm_t *kd) { - kd->usrstack = USRSTACK; kd->min_uva = VM_MIN_ADDRESS; kd->max_uva = VM_MAXUSER_ADDRESS; Index: src/lib/libkvm/kvm_sparc.c diff -u src/lib/libkvm/kvm_sparc.c:1.35 src/lib/libkvm/kvm_sparc.c:1.36 --- src/lib/libkvm/kvm_sparc.c:1.35 Fri Oct 30 22:40:44 2015 +++ src/lib/libkvm/kvm_sparc.c Mon Jan 10 14:51:30 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: kvm_sparc.c,v 1.35 2015/10/31 02:40:44 nakayama Exp $ */ +/* $NetBSD: kvm_sparc.c,v 1.36 2022/01/10 19:51:30 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)kvm_sparc.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: kvm_sparc.c,v 1.35 2015/10/31 02:40:44 nakayama Exp $"); +__RCSID("$NetBSD: kvm_sparc.c,v 1.36 2022/01/10 19:51:30 christos Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -382,7 +382,6 @@ _kvm_mdopen(kvm_t *kd) extern struct ps_strings *__ps_strings; max_uva = (u_long) (__ps_strings + 1); - kd->usrstack = max_uva; kd->max_uva = max_uva; kd->min_uva = 0; Index: src/lib/libkvm/kvm_sparc64.c diff -u src/lib/libkvm/kvm_sparc64.c:1.17 src/lib/libkvm/kvm_sparc64.c:1.18 --- src/lib/libkvm/kvm_sparc64.c:1.17 Fri Feb 21 13:00:09 2014 +++ src/lib/libkvm/kvm_sparc64.c Mon Jan 10 14:51:30 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: kvm_sparc64.c,v 1.17 2014/02/21 18:00:09 palle Exp $ */ +/* $NetBSD: kvm_sparc64.c,v 1.18 2022/01/10 19:51:30 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)kvm_sparc.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: kvm_sparc64.c,v 1.17 2014/02/21 18:00:09 palle Exp $"); +__RCSID("$NetBSD: kvm_sparc64.c,v 1.18 2022/01/10 19:51:30 christos Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -273,7 +273,6 @@ _kvm_mdopen(kvm_t *kd) extern struct ps_strings *__ps_strings; max_uva = (u_long) (__ps_strings + 1); - kd->usrstack = max_uva; kd->max_uva = max_uva; kd->min_uva = 0; Index: src/lib/libkvm/kvm_vax.c diff -u src/lib/libkvm/kvm_vax.c:1.20 src/lib/libkvm/kvm_vax.c:1.21 --- src/lib/libkvm/kvm_vax.c:1.20 Wed Feb 19 15:21:22 2014 +++ src/lib/libkvm/kvm_vax.c Mon Jan 10 14:51:30 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: kvm_vax.c,v 1.20 2014/02/19 20:21:22 dsl Exp $ */ +/* $NetBSD: kvm_vax.c,v 1.21 2022/01/10 19:51:30 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -59,7 +59,7 @@ #include "kvm_private.h" -__RCSID("$NetBSD: kvm_vax.c,v 1.20 2014/02/19 20:21:22 dsl Exp $"); +__RCSID("$NetBSD: kvm_vax.c,v 1.21 2022/01/10 19:51:30 christos Exp $"); struct vmstate { u_long end; @@ -150,7 +150,6 @@ int _kvm_mdopen(kvm_t *kd) { - kd->usrstack = USRSTACK; kd->min_uva = VM_MIN_ADDRESS; kd->max_uva = VM_MAXUSER_ADDRESS; Index: src/lib/libkvm/kvm_x86_64.c diff -u src/lib/libkvm/kvm_x86_64.c:1.12 src/lib/libkvm/kvm_x86_64.c:1.13 --- src/lib/libkvm/kvm_x86_64.c:1.12 Sat Apr 25 01:17:16 2020 +++ src/lib/libkvm/kvm_x86_64.c Mon Jan 10 14:51:30 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: kvm_x86_64.c,v 1.12 2020/04/25 05:17:16 maxv Exp $ */ +/* $NetBSD: kvm_x86_64.c,v 1.13 2022/01/10 19:51:30 christos Exp $ */ /*- * Copyright (c) 1989, 1992, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)kvm_hp300.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: kvm_x86_64.c,v 1.12 2020/04/25 05:17:16 maxv Exp $"); +__RCSID("$NetBSD: kvm_x86_64.c,v 1.13 2022/01/10 19:51:30 christos Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -269,7 +269,6 @@ int _kvm_mdopen(kvm_t *kd) { - kd->usrstack = USRSTACK; kd->min_uva = VM_MIN_ADDRESS; kd->max_uva = VM_MAXUSER_ADDRESS;