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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux