From: Pranav Rajendran <pranavkasthuri@gmail.com>
To: u-boot@lists.u-boot-project.org
Cc: trini@konsulko.com, sjg@chromium.org,
philippe.reynes@softathome.com,
Pranav Rajendran <pranavkasthuri@gmail.com>
Subject: [PATCH v2 0/5] fit: cipher: bounds checks on the ciphered image path
Date: Tue, 25 Aug 2026 15:19:48 +0100 [thread overview]
Message-ID: <20260825141953.9534-1-pranavkasthuri@gmail.com> (raw)
In-Reply-To: <20260815220754.11724-1-pranavkasthuri@gmail.com>
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
--
2.50.1 (Apple Git-155)
next prev parent reply other threads:[~2026-08-25 16:03 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-15 22:07 [PATCH v1 0/3] fit: cipher: bounds checks on the ciphered image path Pranav Rajendran
2026-08-15 22:07 ` [PATCH v1 1/3] lib: aes: reject a ciphertext length that is not a whole number of blocks Pranav Rajendran
2026-08-25 12:52 ` Simon Glass
2026-08-15 22:07 ` [PATCH v1 2/3] image-fit: check the length of the data-size-unciphered property Pranav Rajendran
2026-08-25 12:52 ` Simon Glass
2026-08-15 22:07 ` [PATCH v1 3/3] lib: aes: reject an unciphered size larger than the ciphertext Pranav Rajendran
2026-08-25 12:52 ` Simon Glass
2026-08-25 12:53 ` [v1,0/3] fit: cipher: bounds checks on the ciphered image path Simon Glass
2026-08-25 14:19 ` Pranav Rajendran [this message]
2026-08-25 14:19 ` [PATCH v2 1/5] lib: aes: reject a ciphertext length that is not a whole number of blocks Pranav Rajendran
2026-08-25 14:19 ` [PATCH v2 2/5] image-fit: check the length of the data-size-unciphered property Pranav Rajendran
2026-08-25 14:19 ` [PATCH v2 3/5] lib: aes: reject an unciphered size larger than the ciphertext Pranav Rajendran
2026-08-25 14:19 ` [PATCH v2 4/5] include: u-boot: aes: make disabled cipher stubs static inline Pranav Rajendran
2026-08-25 14:19 ` [PATCH v2 5/5] test: boot: add regression tests for the FIT cipher bounds checks Pranav Rajendran
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260825141953.9534-1-pranavkasthuri@gmail.com \
--to=pranavkasthuri@gmail.com \
--cc=philippe.reynes@softathome.com \
--cc=sjg@chromium.org \
--cc=trini@konsulko.com \
--cc=u-boot@lists.u-boot-project.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox