[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250712192202.707192-14-gatlin.newhouse@gmail.com>
Date: Sat, 12 Jul 2025 19:21:58 +0000
From: Gatlin Newhouse <gatlin.newhouse@...il.com>
To: linux-hardening@...r.kernel.org
Cc: Gatlin Newhouse <gatlin.newhouse@...il.com>
Subject: [RFC v1 13/17] softirq: add SafeFetch statistics to irq_enter_rc() and irq_exit()
---
 kernel/softirq.c | 8 ++++++++
 1 file changed, 8 insertions(+)
diff --git a/kernel/softirq.c b/kernel/softirq.c
index 513b1945987c..cfed8419b6c5 100644
--- a/kernel/softirq.c
+++ b/kernel/softirq.c
@@ -632,6 +632,10 @@ void irq_enter_rcu(void)
  */
 void irq_enter(void)
 {
+#ifdef SAFEFETCH_DEBUG
+	/* #warning IRQ_DEFENSE */
+	current->df_stats.in_irq = 1;
+#endif
 	ct_irq_enter();
 	irq_enter_rcu();
 }
@@ -708,7 +712,11 @@ void irq_exit(void)
 	__irq_exit_rcu();
 	ct_irq_exit();
 	 /* must be last! */
+#ifdef SAFEFETCH_DEBUG
+	current->df_stats.in_irq = 0;
+#endif
 	lockdep_hardirq_exit();
+
 }
 
 /*
-- 
2.25.1
Powered by blists - more mailing lists
 
