stack bounds checking
Subsystems (2)
cover stack bounds checking
The stack is now shared with struct thread_info on most arches, not task_t. This patch series attempts to sweep up the remaining arches in need of updates. This mostly affects get_wchan() and stack usage debug.
-- wli
PATCH 1/5 h8300 stack bounds checking
arch/h8300/kernel/process.c +1 -1
@@ -277,7 +277,7 @@ stack_page = (unsigned long )p; fp = ((struct pt_regs *)p->thread.ksp)->er6; do { - if (fp < stack_page+sizeof(struct task_struct) || + if (fp < stack_page+sizeof(struct thread_info) || fp >= 8184+stack_page) return 0; pc = ((unsigned long *)fp)[1];
PATCH 2/5 m68k stack bounds checking
arch/m68k/kernel/process.c +1 -1
@@ -392,7 +392,7 @@ stack_page = (unsigned long )(p->thread_info); fp = ((struct switch_stack *)p->thread.ksp)->a6; do { - if (fp < stack_page+sizeof(struct task_struct) || + if (fp < stack_page+sizeof(struct thread_info) || fp >= 8184+stack_page) return 0; pc = ((unsigned long *)fp)[1];
PATCH 3/5 m68knommu stack bounds checking
arch/m68knommu/kernel/process.c +1 -1
@@ -415,7 +415,7 @@ stack_page = (unsigned long )p; fp = ((struct switch_stack *)p->thread.ksp)->a6; do { - if (fp < stack_page+sizeof(struct task_struct) || + if (fp < stack_page+sizeof(struct thread_info) || fp >= 8184+stack_page) return 0; pc = ((unsigned long *)fp)[1];
PATCH 4/5 ppc32 stack bounds checking
arch/ppc/kernel/process.c +1 -1
@@ -83,7 +83,7 @@unsigned long task_top (struct task_struct *tsk) { -return ((unsigned long )tsk) +sizeof (struct task_struct ); +return ((unsigned long )tsk) +sizeof (struct thread_info ); }/* check to make sure the kernel stack is healthy */
PATCH 5/5 sparc32 stack bounds checking
arch/sparc/kernel/process.c +2 -2
@@ -318,7 +318,7 @@ fp = (unsigned long ) _ksp; do { /* Bogus frame pointer? */ - if (fp < (task_base + sizeof(struct task_struct)) || + if (fp < (task_base + sizeof(struct thread_info)) || fp >= (task_base + (PAGE_SIZE << 1))) break; rw = (struct reg_window *) fp;
@@ -710,7 +710,7 @@ fp = task->thread_info->ksp + bias; do { /* Bogus frame pointer? */ - if (fp < (task_base + sizeof(struct task_struct)) || + if (fp < (task_base + sizeof(struct thread_info)) || fp >= (task_base + (2 * PAGE_SIZE))) break; rw = (struct reg_window *) fp;