* [PATCH] 2.5.59: show_task() oops
@ 2003-01-18 16:56 Russell King
0 siblings, 0 replies; only message in thread
From: Russell King @ 2003-01-18 16:56 UTC (permalink / raw)
To: LKML
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));
#endif
{
- unsigned long * n = (unsigned long *) (p+1);
+ unsigned long * n = (unsigned long *) (p->thread_info+1);
while (!*n)
n++;
free = (unsigned long) n - (unsigned long)(p+1);
--
Russell King (rmk@arm.linux.org.uk) The developer of ARM Linux
http://www.arm.linux.org.uk/personal/aboutme.html
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2003-01-18 16:48 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-18 16:56 [PATCH] 2.5.59: show_task() oops Russell King
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®