All of lore.kernel.org
 help / color / mirror / Atom feed
* what is the right behavior of copy_to_user(0x0, ..., ...)?
@ 2002-05-03 21:46 Jun Sun
  2002-05-03 23:23 ` Ralf Baechle
  0 siblings, 1 reply; 9+ messages in thread
From: Jun Sun @ 2002-05-03 21:46 UTC (permalink / raw)
  To: linux-mips

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
Oops in fault.c:do_page_fault, line 204:
$0 : 00000000 10001f00 00000002 00000002 00000000 86df5e98 00000001 00000040
$8 : 00000000 00000000 00000001 ffffffff 00000002 802b4864 00000001 00000001
$16: 100003d8 00000000 00000002 86df5e98 00401080 10002df8 00000000 00000097
$24: 0000000a 802e7ab6                   86df4000 86df5e60 7fff7c60 80205aa4
Hi : 00000000
Lo : 00000000
epc  : 80273860    Not tainted
Status: 10001f03
Cause : 9080800c
  ....

Tracing error reveals that user process passed a NULL buffer pointer to 
sys_getpeername() syscall, probably intentionally.  Then it goes all the way 
down to copy_to_user(0x0, ..., ...) and caused a oops as above.

As a result of oops the user process is killed.  However I am not sure if this 
is the right way to respond to an ill argument.  copy_to_user() probably 
should catch this case and return some meaningful error back to the caller.

I am not sure what is the best way to achieve this.  Any thoughts?

Jun

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2002-05-08  3:15 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.