[RFC][PATCH 05/24] kernel/task: Add shadow stack to thread structure
From: Dave Hansen
Date: Wed Oct 21 2026 - 15:52:35 EST
Add a shadow stack member to the stack structure. It is zero-sized
for now. Adding it permits new code to reference it, though.
---
b/include/linux/sched.h | 4 ++++
1 file changed, 4 insertions(+)
diff -puN include/linux/sched.h~add-shadow_stack-to-thread_stacks include/linux/sched.h
--- a/include/linux/sched.h~add-shadow_stack-to-thread_stacks 2026-10-21 12:36:34.689874862 -0700
+++ b/include/linux/sched.h 2026-10-21 12:36:34.691874865 -0700
@@ -1986,8 +1986,12 @@ extern void ia64_set_curr_task(int cpu,
void yield(void);
+#ifndef TASK_SHADOW_STACK_SIZE
+#define TASK_SHADOW_STACK_SIZE 0
+#endif
struct thread_stacks {
unsigned long stack[THREAD_SIZE/sizeof(long)];
+ u8 shadow_stack[TASK_SHADOW_STACK_SIZE];
};
union thread_union {
_