---
lib/bug.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/lib/bug.c b/lib/bug.c
index b1f07459c2ee..d1007c1b3dda 100644
--- a/lib/bug.c
+++ b/lib/bug.c
@@ -155,6 +155,9 @@ static enum bug_trap_type __report_bug(unsigned long
bugaddr, struct pt_regs *re
struct bug_entry *bug;
const char *file;
unsigned line, warning, once, done;
+#if defined(SAFEFETCH_DEBUG)
+ current->df_stats.traced = 1;
+#endif
if (!is_valid_bugaddr(bugaddr))
return BUG_TRAP_TYPE_NONE;
@@ -194,6 +197,9 @@ static enum bug_trap_type __report_bug(unsigned long
bugaddr, struct pt_regs *re
/* this is a WARN_ON rather than BUG/BUG_ON */
__warn(file, line, (void *)bugaddr, BUG_GET_TAINT(bug), regs,
NULL);
+#if defined(SAFEFETCH_DEBUG)
+ current->df_stats.traced = 0;
+#endif
return BUG_TRAP_TYPE_WARN;
}
@@ -203,6 +209,10 @@ static enum bug_trap_type __report_bug(unsigned long
bugaddr, struct pt_regs *re
pr_crit("Kernel BUG at %pB [verbose debug info unavailable]\n",
(void *)bugaddr);
+#if defined(SAFEFETCH_DEBUG)
+ current->df_stats.traced = 0;
+#endif
+
return BUG_TRAP_TYPE_BUG;
}
--
2.25.1- [RFC v1 00/17] Add Safefetch double-fetch protection Gatlin Newhouse
- [RFC v1 02/17] x86: syscall: support caching in do_sy... Gatlin Newhouse
- [RFC v1 05/17] uaccess: add non-caching copy_from_use... Gatlin Newhouse
- [RFC v1 04/17] sched: add protection to task_struct Gatlin Newhouse
- [RFC v1 08/17] init: add caching startup and initiali... Gatlin Newhouse
- [RFC v1 11/17] kernel: add SafeFetch cache handling t... Gatlin Newhouse
- [RFC v1 10/17] iov_iter: add SafeFetch pinning call t... Gatlin Newhouse
- [RFC v1 09/17] exit: add destruction of SafeFetch cac... Gatlin Newhouse
- [RFC v1 12/17] bug: add SafeFetch statistics tracking... Gatlin Newhouse
- [RFC v1 07/17] gup: add non-caching get_user call to ... Gatlin Newhouse
- [RFC v1 15/17] kconfig: debug: add SafeFetch to debug... Gatlin Newhouse
- [RFC v1 17/17] vfs: ioctl: add logging to ioctl_file_... Gatlin Newhouse
- [RFC v1 13/17] softirq: add SafeFetch statistics to i... Gatlin Newhouse
- [RFC v1 14/17] makefile: add SafeFetch support to mak... Gatlin Newhouse
- [RFC v1 06/17] futex: add get_user_no_dfcache() funct... Gatlin Newhouse
- [RFC v1 03/17] x86: asm: support caching in do_get_us... Gatlin Newhouse
- [RFC v1 16/17] x86: enable SafeFetch on x86_64 builds Gatlin Newhouse
