summaryrefslogtreecommitdiff
path: root/emerge_test.sh
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2019-10-28 16:26:18 -0700
committerCommit Bot <commit-bot@chromium.org>2019-11-02 07:22:11 +0000
commit8e8f4b990e8ae15a493043878115df099173414d (patch)
tree26625193e8abcf383d447554a63c71471e6502c3 /emerge_test.sh
parentff76f72ac363d090cb2a076cc771cc450b166340 (diff)
downloadvboot-8e8f4b990e8ae15a493043878115df099173414d.tar.gz
cgptlib: Minor edge case fixes
This patch fixes a sanitizer issue in cgpt where a GPT entries array may have been passed even though it was not loaded from disk (parsing an uninitialized buffer). The GPT library seems to have been written with the assumption that both headers and entries would always be loaded and it could recover even if only the primary header and the secondary entries were valid. In practice, this doesn't really work because the caller doesn't know how to read entries for an invalid header. Therefore, change the code so that entries are only assumed to be loaded for valid headers. Also fix some minor problems with loading GPTs by aligning sizes up (not down) to the next sector boundary and making sure we always allocate the maximum amount of space for entry arrays, even if the current header may not need that much (in case a repair wants to overwrite it). This practically reverts CL:276766 which becomes obsolete (and was really just a dirty hack to hide an underlying problem). BRANCH=none BUG=chromium:1017797 TEST=make runtests Change-Id: I86c601dc074261d53f013b98ae214efdc44f3563 Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1885098 Reviewed-by: Mattias Nissler <mnissler@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'emerge_test.sh')
0 files changed, 0 insertions, 0 deletions