linux-mips
[Top] [All Lists]

Re: what is the right behavior of copy_to_user(0x0, ..., ...)?

To: Ralf Baechle <ralf@oss.sgi.com>
Subject: Re: what is the right behavior of copy_to_user(0x0, ..., ...)?
From: Jun Sun <jsun@mvista.com>
Date: Fri, 03 May 2002 16:41:56 -0700
Cc: linux-mips <linux-mips@oss.sgi.com>
References: <3CD3052B.1050400@mvista.com> <20020503162337.A27366@dea.linux-mips.net>
Sender: owner-linux-mips@oss.sgi.com
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.2.1) Gecko/20010901
Ralf Baechle wrote:

On Fri, May 03, 2002 at 02:46:19PM -0700, Jun Sun wrote:


When running LTP, I notice that recent kernel has a kernel access fault:

<1>Unable to handle kernel paging request at virtual address 00000000, epc
== 80273860, ra == 80205aa4


Well, decode the oops message.  The question is what is at 0x80273860?



0x80273860 is copy_bytes in arch/mips/lib/memcpy.S, which is reached through 
__copy_user.

The faulting instruction, not suprisingly, is writing a byte to the destination at 0x0.

Anybody can try to call copy_to_user(0x0, ...) inside kernel and see the scene. The question here is whether we should reach do_page_fault() and terminate calling process or try to catch the fault and return some meaningful error.

It appears earlier version of kernel does not have this problem. I have not fully figured out why.

Jun



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