summaryrefslogtreecommitdiffstats
path: root/src/include/usr
diff options
context:
space:
mode:
authorStefan Hajnoczi2009-04-11 12:13:09 +0200
committerMichael Brown2009-04-15 17:14:47 +0200
commitb149a99302d54728cf1d505b48ef9ebe99733391 (patch)
tree687c6974dbd6f85882ebe3339e32c2fda42db769 /src/include/usr
parent[pcbios] Don't use "lret $2" to return from an interrupt (diff)
downloadipxe-b149a99302d54728cf1d505b48ef9ebe99733391.tar.gz
ipxe-b149a99302d54728cf1d505b48ef9ebe99733391.tar.xz
ipxe-b149a99302d54728cf1d505b48ef9ebe99733391.zip
[build] Round up SUBx deltas
The zbin compressor fixup utility rounds down file sizes before calculating their difference. This produces incorrect values and may cause truncated gPXE images to be loaded at boot. The following example explains the problem: ilen = 48 bytes (uncompressed input file) olen = 17 bytes (compressed output file) divisor = 16 bytes (paragraph granularity) fixmeup = 3 paragraphs (value to fix up) olen / divisor - ilen / divisor = 1 - 3 = -2 paragraphs (old delta calculation) ( align ( olen, divisor ) - align ( ilen, divisor ) ) / divisor = 2 - 3 = -1 paragraphs (new delta calculation) If we perform the SUBx operation with old delta: fixmeup + -2 = 1 paragraph gets loaded by the prefix With the new delta: fixmeup + -1 = 2 paragraphs get loaded by the prefix The old delta calculation removes the last paragraph; the prefix will load a truncated copy of gPXE into memory. We need to load 2 paragraphs since olen is 17 bytes. Loading only 1 paragraph (16 bytes) would truncate the last byte. Signed-off-by: Michael Brown <mcb30@etherboot.org>
Diffstat (limited to 'src/include/usr')
0 files changed, 0 insertions, 0 deletions