diff options
| author | mlelstv <mlelstv@NetBSD.org> | 2023-02-19 10:48:06 +0000 |
|---|---|---|
| committer | mlelstv <mlelstv@NetBSD.org> | 2023-02-19 10:48:06 +0000 |
| commit | fcd46dfa696cc34f9b7bd86bfe9a96ecee5ff87d (patch) | |
| tree | 60b8cd5f67d66132cae5b6b855532487439ea93d | |
| parent | 0a13191e8e296f7edbfcd780a5c8ad937bd1cb6e (diff) | |
Only copyin/copyout from and to user addresses.
| -rw-r--r-- | sys/arch/mips/mips/db_interface.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/arch/mips/mips/db_interface.c b/sys/arch/mips/mips/db_interface.c index 6d66ee63638..36873667a76 100644 --- a/sys/arch/mips/mips/db_interface.c +++ b/sys/arch/mips/mips/db_interface.c @@ -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, char *data) * 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, const char *data) 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 |
