Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/x86/x86 x86/db_memrw.c: Mark db_read_bytes, db_writ...



details:   https://anonhg.NetBSD.org/src/rev/e379b03a5125
branches:  trunk
changeset: 369676:e379b03a5125
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sat Aug 27 20:40:03 2022 +0000

description:
x86/db_memrw.c: Mark db_read_bytes, db_write_bytes __noubsan.

These intentionally do loads and stores that may be misaligned, which
are fine on this x86-specific code.  Should avoid double-panic in
disassembler on panic with UBSan enabled.

diffstat:

 sys/arch/x86/x86/db_memrw.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r 3d9dc31433b9 -r e379b03a5125 sys/arch/x86/x86/db_memrw.c
--- a/sys/arch/x86/x86/db_memrw.c       Sat Aug 27 20:39:54 2022 +0000
+++ b/sys/arch/x86/x86/db_memrw.c       Sat Aug 27 20:40:03 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: db_memrw.c,v 1.15 2022/08/27 20:39:54 riastradh Exp $  */
+/*     $NetBSD: db_memrw.c,v 1.16 2022/08/27 20:40:03 riastradh Exp $  */
 
 /*-
  * Copyright (c) 1996, 2000 The NetBSD Foundation, Inc.
@@ -53,7 +53,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_memrw.c,v 1.15 2022/08/27 20:39:54 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_memrw.c,v 1.16 2022/08/27 20:40:03 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/proc.h>
@@ -85,7 +85,7 @@
 /*
  * Read bytes from kernel address space for debugger.
  */
-void
+void __noubsan
 db_read_bytes(vaddr_t addr, size_t size, char *data)
 {
        char *src;
@@ -205,7 +205,7 @@
 /*
  * Write bytes to kernel address space for debugger.
  */
-void
+void __noubsan
 db_write_bytes(vaddr_t addr, size_t size, const char *data)
 {
        extern struct bootspace bootspace;



Home | Main Index | Thread Index | Old Index