gencgc: Fix potential out-of-bounds access in page_ends_contiguous_block_p().
authorAlastair Bridgewater <alastair.bridgewater@gmail.com>
Tue, 14 May 2013 22:45:30 +0000 (18:45 -0400)
committerAlastair Bridgewater <nyef@kana.lisphacker.com>
Mon, 20 May 2013 19:51:21 +0000 (15:51 -0400)
commit4438080fb2f654d99c265252963fcea6266b4d40
treed3ad359efba6eaf3f5411b9dc844460a8dc301d9
parent28b58439eb6366a1bab3018fe68af7cac86c718e
gencgc: Fix potential out-of-bounds access in page_ends_contiguous_block_p().

  * If we're testing to see if the LAST page in dynamic space is
the end of a contiguous block, and it is a full page (bytes_used
is GENCGC_CARD_BYTES), we turn around and start investigating the
next page table entry... but there isn't one, it's beyond the end
of the allocation.

  * Fix, by bounds-testing the page index against the index of the
high-water mark for dynamic space.  This is guaranteed to be no
more than the total maximum for the page table, and is slightly
more micro-efficient than using the actual maximum, as any page
after the high-water mark will be page_free_p().
src/runtime/gencgc.c