fit: cipher: bounds checks on the ciphered image path
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest5 patches 1 replyIn review
- v13 patches 4 repliesSuperseded
Changes in v2 from the cover letter
- Kept patches 1-3 as separate changes per Simon's request (distinct
Fixes: targets, easier to back-port independently).
- Patch 2: documented the new -EINVAL return in the kernel-doc block, per Simon's review comment.
- Added patch 5: a fit_cipher sandbox test suite covering all three defects (non-block-aligned 'data', a truncated 'data-size-unciphered', and an oversized unciphered size), per Simon's request for regression tests since these are security fixes.
- Added patch 4 as a prerequisite for patch 5: <u-boot/aes.h> defines the disabled-config cipher stubs with external linkage, so a second translation unit including it (the new test file) failed to link until those stubs were made static inline. Found while writing the test, not previously reported.
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | lib: aes: reject a ciphertext length that is not a whole number of blockslib/ | +11 | 0 replies | |
| 2/5 | image-fit: check the length of the data-size-unciphered propertyboot/ | +6 | 0 replies | |
| 3/5 | lib: aes: reject an unciphered size larger than the ciphertextlib/ | +9 | 0 replies | |
| 4/5 | include: u-boot: aes: make disabled cipher stubs static inlineinclude/ | +9 | 0 replies | |
| 5/5 | test: boot: add regression tests for the FIT cipher bounds checkstest/ test/ test/ | +116 | 0 replies |
Reviews trailers per patch
3 of 5 patches have a Reviewed-by or Acked-by.
| Patch | Simon Glass |
|---|---|
| 1/5 | R-b |
| 2/5 | R-b |
| 3/5 | R-b |
| 4/5 | |
| 5/5 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v2 0/5] fit: cipher: bounds checks on the ciphered image path
Changes in v2:
- Kept patches 1-3 as separate changes per Simon's request (distinct
Fixes: targets, easier to back-port independently).
- Patch 2: documented the new -EINVAL return in the kernel-doc block, per Simon's review comment.
- Added patch 5: a fit_cipher sandbox test suite covering all three defects (non-block-aligned 'data', a truncated 'data-size-unciphered', and an oversized unciphered size), per Simon's request for regression tests since these are security fixes.
- Added patch 4 as a prerequisite for patch 5: <u-boot/aes.h> defines the disabled-config cipher stubs with external linkage, so a second translation unit including it (the new test file) failed to link until those stubs were made static inline. Found while writing the test, not previously reported.
Patches 1 and 3 are unchanged from v1 and carry Simon's Reviewed-by.
checkpatch-clean, builds for sandbox (CONFIG_FIT_CIPHER=y) with no new warnings at W=1, and the new fit_cipher suite plus the existing lib_test_aes and fit_verity suites pass under ut.
Pranav Rajendran (5):
lib: aes: reject a ciphertext length that is not a whole number of
blocks
image-fit: check the length of the data-size-unciphered property
lib: aes: reject an unciphered size larger than the ciphertext
include: u-boot: aes: make disabled cipher stubs static inline
test: boot: add regression tests for the FIT cipher bounds checks
boot/image-fit.c | 7 ++- include/u-boot/aes.h | 17 ++++--- lib/aes/aes-decrypt.c | 21 +++++++- test/boot/Makefile | 1 + test/boot/fit_cipher.c | 113 +++++++++++++++++++++++++++++++++++++++++ test/cmd_ut.c | 2 + 6 files changed, 151 insertions(+), 10 deletions(-) create mode 100644 test/boot/fit_cipher.c
Signature · 1 line
2.50.1 (Apple Git-155)