Subject: re: patch for kern/subr_extent.c
To: None <tech-kern@netbsd.org>
From: Paul Kranenburg <pk@cs.few.eur.nl>
List: tech-kern
Date: 06/23/2000 14:18:17
> i've noticed that extent_alloc() can fail and return a value outside
> of the extent when there the map start address + the boundary condition
> overflow. this happens on the sparc64 with the sbus dvma map (which
> is mapped near the very top of kva) when mapping the le driver (which
> has a boundary condition of 16M). the follow patch fixes this problem
> by noticing the overflow when checking boundary condition..
Also, it's possible to be denied an allocation if you get into the
last "boundary block" of an extent map. Note that on lines 698 and 792
the current boundary line is (bogusly) checked against the end
of the current region even if it has already been established that
the size fits and the boundary is not crossed.
I think the checks on those two lines must be moved to the
`if (newend > dontcross)' sections just above, where a new
boundary line is computed. But even then, it's only necessary to
check for overflow since it's permissible for a region to end
in between boundary lines.
-pk