summaryrefslogtreecommitdiff
path: root/include/version_string.h
diff options
context:
space:
mode:
authorAristo Chen <[email protected]>2026-07-05 03:44:11 +0000
committerTom Rini <[email protected]>2026-07-16 12:06:15 -0600
commit9fa00f563bea7ac4a4fda3220e05b21ebd4a242f (patch)
treee9b2b389508cad580357ef322811f3521a5cab3e /include/version_string.h
parenta84c7670a698c1d42a6da7e713afdeaaa51eae46 (diff)
test: vbe: cover vbe_read_fit() external-data bounds checks
vbe_read_fit() rejects FITs whose external-data window extends past the trusted firmware area on disk by returning -E2BIG. Add two sandbox unit tests that construct synthetic FITs with attacker-controlled data-position and data-size values, write them to mmc1, and assert vbe_read_fit() catches each one before issuing the follow-up blk_read(). vbe_read_fit_oob_position uses a data-position past area_size, which trips the load_addr - addr > area_size clause. vbe_read_fit_oversize_data keeps data-position inside the area but picks a data-size that overruns area_size - (load_addr - addr), tripping the third clause. The two remaining bound clauses stay unreachable from a sandbox test. The load_addr < addr guard trivially holds when addr comes from CONFIG_VAL(TEXT_BASE), which is 0 on sandbox, and the FDT-region bound sits behind a !CONFIG_SANDBOX guard in vbe_read_fit(), so fdt_size stays 0 and that block is skipped in this test environment. The new file follows the existing bootstd VBE test layout and writes the FIT at block 16, past the version and nvdata blocks already used by bootstd_setup_for_tests(). Suggested-by: Simon Glass <[email protected]> Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Aristo Chen <[email protected]>
Diffstat (limited to 'include/version_string.h')
0 files changed, 0 insertions, 0 deletions