lkml.org 
[lkml]   [2000]   [Nov]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] show_task() and thread_saved_pc() fix for x86


On Fri, 10 Nov 2000, Alexander Viro wrote:
> diff -urN rc11-2/include/asm-i386/processor.h rc11-2-show_task/include/asm-i386/processor.h
> --- rc11-2/include/asm-i386/processor.h Fri Nov 10 09:14:04 2000
> +++ rc11-2-show_task/include/asm-i386/processor.h Fri Nov 10 16:08:15 2000
> @@ -412,7 +412,7 @@
> */
> extern inline unsigned long thread_saved_pc(struct thread_struct *t)
> {
> - return ((unsigned long *)t->esp)[3];
> + return ((unsigned long **)t->esp)[0][1];
> }

The above needs to get verified: it should be something like

unsigned long *ebp = *((unsigned long **)t->esp);

if ((void *) ebp < (void *) t)
return 0;
if ((void *) ebp >= (void *) t + 2*PAGE_SIZE)
return 0;
if (3 & (unsigned long)ebp)
return 0;
return *ebp;

because otherwise I guarantee that we'll eventually have a bug with a
invalid pointer reference in the debugging code and that would be bad.

Linus

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

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