Subject: Re: port-i386/34186: mapping of msgbuf during startup may map invalid physical adresses
To: None <port-i386-maintainer@netbsd.org, gnats-admin@netbsd.org,>
From: Pavel Cahyna <pavel@NetBSD.org>
List: netbsd-bugs
Date: 11/21/2006 09:10:03
The following reply was made to PR port-i386/34186; it has been noted by GNATS.

From: Pavel Cahyna <pavel@NetBSD.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: port-i386/34186: mapping of msgbuf during startup may map invalid physical adresses
Date: Tue, 21 Nov 2006 09:06:54 +0000

 On Fri, Aug 11, 2006 at 02:20:01PM +0000, Wolfgang Stukenbrock wrote:
 > 	The function cpu_startup() will determine the size of the message buffer from the
 > 	segment list and will map the allocated pages to the allocated virtual adressspace
 > 	with the size determined from the segment list.
 
 You say that cpu_startup will determine the size of the message buffer,
 but in your patch it continues to call initmsgbuf() with the hardwired
 size (MSGBUFSIZE):
 
 (...)
 > ! 			    msgbuf_p_seg[y].paddr + x * PAGE_SIZE, VM_PROT_READ|VM_PROT_WRITE);
 > ! 	}
 >   	pmap_update(pmap_kernel());
 >   
 >   	initmsgbuf((caddr_t)msgbuf_vaddr, round_page(MSGBUFSIZE));
 > ***************
 
 how do you prevent using incorrect size and accessing unmapped memory if
 two segments aren't enough?
 
 Pavel