[lkml]   [2003]   [Jan]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH] 2.5.59: show_task() oops
show_task() attempts to calculate the amount of free space which hasn't
been written to on the kernel stack by reading from the base of the
kernel stack upwards.

However, it mistakenly uses the task_struct pointer as the base of the
stack, which it isn't, and this can cause an oops.

Here is a patch which uses the task thread pointer instead, which should
be located at the bottom of the kernel stack. It appears this was missed
when the thread structure was introduced.

--- orig/kernel/sched.c Fri Jan 17 10:39:25 2003
+++ linux/kernel/sched.c Sat Jan 18 14:01:39 2003
@@ -2057,7 +2057,7 @@
printk(" %016lx ", thread_saved_pc(p));
- unsigned long * n = (unsigned long *) (p+1);
+ unsigned long * n = (unsigned long *) (p->thread_info+1);
while (!*n)
free = (unsigned long) n - (unsigned long)(p+1);
Russell King ( The developer of ARM Linux

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:32    [W:0.045 / U:0.680 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site