[Top] [All Lists]

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

To: Ralf Baechle <>
Subject: Re: what is the right behavior of copy_to_user(0x0, ..., ...)?
From: Jun Sun <>
Date: Fri, 03 May 2002 16:41:56 -0700
Cc: linux-mips <>
References: <> <>
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: 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 

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.


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