linux-mips
[Top] [All Lists]

Re: unaligned handler problem

To: Pete Popov <ppopov@mvista.com>
Subject: Re: unaligned handler problem
From: Ralf Baechle <ralf@linux-mips.org>
Date: Fri, 3 Jan 2003 14:46:15 +0100
Cc: linux-mips <linux-mips@linux-mips.org>
In-reply-to: <1041589762.18883.4.camel@adsl.pacbell.net>; from ppopov@mvista.com on Fri, Jan 03, 2003 at 02:29:22AM -0800
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1041589762.18883.4.camel@adsl.pacbell.net>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.2.5.1i
On Fri, Jan 03, 2003 at 02:29:22AM -0800, Pete Popov wrote:

> The changes betwen rev 1.23 and 1.24 in unaligned.c, to replace
> check_axs() with verify_area(), causes any unaligned access from within
> a kernel module to crash. access_ok() returns -EFAULT as the
> __access_mask is 0xffffffff so __access_ok evaluates to > 0.  It's too
> late for me to look into it any further but perhaps the problem will be
> obvious to someone else. I'm not sure what get_fs() should return in
> this case (again, the access is from within a kernel module) but it
> returns 0xffffffff.

The address error handler should do something like:

        mm_segment_t seg;

        seg = get_fs();
        if (!user_mode(regs))
                set_fs(KERNEL_DS);

        ... usual unaligned stuff goes here ...

        set_fs(seg);

  Ralf

<Prev in Thread] Current Thread [Next in Thread>