summaryrefslogtreecommitdiff
path: root/test/py/tests
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2026-09-04 12:22:49 -0600
committerTom Rini <[email protected]>2026-09-04 16:55:10 -0600
commit5534f2c742916efabff3e1888912dafc570f20f2 (patch)
tree1ad0e57528769aef86a2cb7e3a4297495125d255 /test/py/tests
parent7bf077ec5733a230bbce34d8ce324f92d8c46cc1 (diff)
parent3158b844335a4a84a5504a813f2daa6acff5985d (diff)
Merge patch series "fit: Harden handling of external-data properties"
Anton Ivanov <[email protected]> says: The data-offset, data-position and data-size FIT properties are 32-bit unsigned values, but were read through signed int. Also, they are excluded from the configuration signature, so they are attacker controlled. Patch 1 switches the accessors and their callers to u32, removing the ad-hoc handling of "negative" values in U-Boot proper. This transition was discussed and agreed on in [1]. The SPL loader has its own copy of this logic with the same problems and fewer checks. Patch 2 factors out a test helper, patch 3 makes the SPL offset/size arithmetic overflow-safe, and patch 4 adds the addressable-range and FIT_SIGNATURE_MAX_SIZE bounds check that U-Boot proper already performs in fit_image_get_data(). Patches 3 and 4 build on each other and on patch 1, so they are not intended to be cherry-picked individually. [1] https://lore.kernel.org/u-boot/CAPWaX55XWFLcMGRuaUuXXn__MX_UG4J8QTd6rvXZmJ4WSOCy9w@mail.gmail.com/ Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'test/py/tests')
-rw-r--r--test/py/tests/test_vboot.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/py/tests/test_vboot.py b/test/py/tests/test_vboot.py
index 4b6707caf70..fd91b3f10a2 100644
--- a/test/py/tests/test_vboot.py
+++ b/test/py/tests/test_vboot.py
@@ -700,12 +700,12 @@ def test_vboot_ext_data_bounds(ubman):
fd.write(500 * b'\0')
testcases = [
- ('negative data-position',
- {'data-position': 0xffffffff}, 'Invalid external data position'),
- ('negative data-offset',
+ ('invalid data-position',
+ {'data-position': 0xffffffff}, 'FIT external data is out of bounds'),
+ ('invalid data-offset',
{'data-offset': 0xffffffff}, 'Invalid external data offset'),
- ('negative data-size',
- {'data-size': 0xffffffff}, 'Invalid external data size'),
+ ('invalid data-size',
+ {'data-size': 0xffffffff}, 'FIT external data is out of bounds'),
('off-bounds data-position',
{'data-position': 0x7fffffff}, 'FIT external data is out of bounds'),
('off-bounds data-offset',