Module Name: src
Committed By: martin
Date: Fri Dec 18 15:33:34 UTC 2020
Modified Files:
src/sys/kern: subr_asan.c
Log Message:
While we are inside ddb, allow all memory access.
To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/kern/subr_asan.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/kern/subr_asan.c
diff -u src/sys/kern/subr_asan.c:1.26 src/sys/kern/subr_asan.c:1.27
--- src/sys/kern/subr_asan.c:1.26 Thu Sep 10 14:10:46 2020
+++ src/sys/kern/subr_asan.c Fri Dec 18 15:33:34 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_asan.c,v 1.26 2020/09/10 14:10:46 maxv Exp $ */
+/* $NetBSD: subr_asan.c,v 1.27 2020/12/18 15:33:34 martin Exp $ */
/*
* Copyright (c) 2018-2020 Maxime Villard, m00nbsd.net
@@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_asan.c,v 1.26 2020/09/10 14:10:46 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_asan.c,v 1.27 2020/12/18 15:33:34 martin Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -42,6 +42,11 @@ __KERNEL_RCSID(0, "$NetBSD: subr_asan.c,
#include <uvm/uvm_extern.h>
+#ifdef DDB
+#include <machine/db_machdep.h>
+#include <ddb/db_extern.h>
+#endif
+
#ifdef KASAN_PANIC
#define REPORT panic
#else
@@ -391,6 +396,10 @@ kasan_shadow_check(unsigned long addr, s
if (__predict_false(!kasan_enabled))
return;
+#ifdef DDB
+ if (__predict_false(db_recover != NULL))
+ return;
+#endif
if (__predict_false(size == 0))
return;
if (__predict_false(kasan_md_unsupported(addr)))