Module Name: src Committed By: mlelstv Date: Sun Feb 19 10:48:06 UTC 2023
Modified Files: src/sys/arch/mips/mips: db_interface.c Log Message: Only copyin/copyout from and to user addresses. To generate a diff of this commit: cvs rdiff -u -r1.97 -r1.98 src/sys/arch/mips/mips/db_interface.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/mips/mips/db_interface.c diff -u src/sys/arch/mips/mips/db_interface.c:1.97 src/sys/arch/mips/mips/db_interface.c:1.98 --- src/sys/arch/mips/mips/db_interface.c:1.97 Wed Oct 26 23:38:08 2022 +++ src/sys/arch/mips/mips/db_interface.c Sun Feb 19 10:48:06 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: db_interface.c,v 1.97 2022/10/26 23:38:08 riastradh Exp $ */ +/* $NetBSD: db_interface.c,v 1.98 2023/02/19 10:48:06 mlelstv Exp $ */ /* * Mach Operating System @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.97 2022/10/26 23:38:08 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.98 2023/02/19 10:48:06 mlelstv Exp $"); #ifdef _KERNEL_OPT #include "opt_multiprocessor.h" @@ -190,7 +190,7 @@ db_read_bytes(vaddr_t addr, size_t size, * Note that MIPS_KSEG0_START is the proper address for * both 32-bit and 64-bit kernels. */ - if (addr < (vaddr_t)MIPS_KSEG0_START) { + if (addr < VM_MAXUSER_ADDRESS) { err = copyin(src, data, size); if (err) { #ifdef DDB @@ -228,7 +228,7 @@ db_write_bytes(vaddr_t addr, size_t size int err; /* If asked to fetch from userspace, do it safely */ - if (addr < (vaddr_t)MIPS_KSEG0_START) { + if (addr < VM_MAXUSER_ADDRESS) { err = copyout(data, p, size); if (err) { #ifdef DDB