Subject: Re: Performance of various memcpy()'s
To: TAMURA Kent <kent@netbsd.org>
From: Bang Jun-Young <junyoung@mogua.com>
List: tech-userlevel
Date: 10/29/2002 14:27:17
On Tue, Oct 29, 2002 at 12:47:49PM +0900, TAMURA Kent wrote:
> Please imagine that src (or dst) is 0x12345678 and length (%ecx)
> is 0xffffffff.  Copying over the end of the address space is
> always meaningless in NetBSD, and may crash the program 

Length shouldn't be larger than the maximum user address, or you're
very likely to get a seg fault. That's a much more common case than 
pointer wraparound. IMHO, pointer wraparound check is worthless in
most cases.

> or may help exploits.

There's no known way to exploit system by memcpy. If there is, why
not _DIAGNOSTIC enabled by default?

Unless there's a better reason to have _DIAGNOSTIC there, I'm going to 
get rid of it.

Jun-Young

-- 
Bang Jun-Young <junyoung@mogua.com>