[syslinux] [PATCH] core/diskboot.inc: fix handover info sanity checks

Michal Soltys soltys at ziu.info
Mon Feb 21 13:33:01 PST 2011


On 11-02-21 19:18, H. Peter Anvin wrote:
> On 02/21/2011 12:34 AM, Michal Soltys wrote:
>>
>>  Indeed, but SI doesn't have to be divisable by 16.
>>  E.g. typical handover address (if that's what DS:SI is here)
>>  such as 0:7beh .
>>
>
> Yes, but that's okay, since the limits we want to compare against are
> (or can be) 16-byte aligned.
>
> 	-hpa
>

I know I'm nitpicking, but... consider comparison of 16 byte long area 
at address 7BEh ([7BEh .. 7CDh]), against 7C0h . It will not fail the 
check using paragraphs, as 7Bh < 7Ch. But it should as it's overlapping.

Besides PartInfo is only 8-byte aligned currently (STACK_TOP-44-92), and 
we have (should ?) check for all 76 bytes copied, not only 16 (it looks 
like the check is from pre-GPT-handover times).

Using normal addresses make the checks pretty straightforward and 
correct, imho (if I didn't miss anything as in v2 patch).




More information about the Syslinux mailing list