Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Jun Sun <jsun@mvista.com>
To: Ralf Baechle <ralf@oss.sgi.com>
Cc: linux-mips <linux-mips@oss.sgi.com>
Subject: Re: what is the right behavior of copy_to_user(0x0, ..., ...)?
Date: Fri, 03 May 2002 16:41:56 -0700	[thread overview]
Message-ID: <3CD32044.9040109@mvista.com> (raw)
In-Reply-To: 20020503162337.A27366@dea.linux-mips.net

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

  reply	other threads:[~2002-05-03 23:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-03 21:46 what is the right behavior of copy_to_user(0x0, ..., ...)? Jun Sun
2002-05-03 23:23 ` Ralf Baechle
2002-05-03 23:41   ` Jun Sun [this message]
2002-05-04  1:40     ` Ralf Baechle
2002-05-06 18:18       ` Jun Sun
2002-05-08  3:16         ` Ralf Baechle
2002-05-07  8:47       ` Carsten Langgaard
2002-05-06 17:53         ` Ralf Baechle
2002-05-06 19:44         ` Ralf Baechle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3CD32044.9040109@mvista.com \
    --to=jsun@mvista.com \
    --cc=linux-mips@oss.sgi.com \
    --cc=ralf@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox