Subject: Re: alignment exceptionhandler sleeps in invalid context

From: Michael Ellerman <[email-masked]>
Date: Sat, 29 Apr 2006 12:34:13 +1000

On Fri, 2006-04-28 at 21:02 +1000, Paul Mackerras wrote:
> Olaf Hering writes:
> 
> > I'm not sure where the bug is. Does it mean the network stack does
> > something nasty, or is the exception handler itself broken? (probably the latter)
> > This is 2.6.16.9 on a p270.
> 
> This patch should fix it, I hope.  If you can verify that it fixes it
> I'll send it to Linus.
> 
> Paul.
> 
> diff --git a/include/asm-powerpc/uaccess.h b/include/asm-powerpc/uaccess.h
> index 3872e92..b02d858 100644
> --- a/include/asm-powerpc/uaccess.h
> +++ b/include/asm-powerpc/uaccess.h
> @@ -179,7 +179,8 @@ do {								\
>  #define __put_user_nocheck(x, ptr, size)			\
>  ({								\
>  	long __pu_err;						\
> -	might_sleep();						\
> +	if ((unsigned long)ptr < PAGE_OFFSET)			\
> +		might_sleep();					\

+	if (!is_kernel_addr((unsigned long)ptr))		\
+		might_sleep();					\

In asm/page.h :)

cheers

-- 
Michael Ellerman
IBM OzLabs

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person