[PATCH] RFC: ext4: Add a few overflow checks in the writing code

Tom Rini trini at konsulko.com
Thu Apr 10 01:40:06 CEST 2025


On Wed, Apr 09, 2025 at 03:02:37PM -0600, Simon Glass wrote:

> From: Simon Glass <simon.glass at canonical.com>
> 
> Some memory allocations make use of data from the disk, so add some
> overflow checks.
> 
> Adjust LOG2_BLOCK_SIZE() so it is easier to read.
> 
> Note: This is a trial to help figure out the best way to deal with these
> sorts of things. Feedback welcome.
> 
> Signed-off-by: Simon Glass <simon.glass at canonical.com>
> ---
> 
>  fs/ext4/ext4_write.c | 24 ++++++++++++++++++++----
>  include/ext_common.h |  3 +--
>  2 files changed, 21 insertions(+), 6 deletions(-)

I'd like to see us grab the current include/linux/overflow.h from the
Linux kernel and make use of that rather than further call the built-ins
directly. But yes, we should do something here in general.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20250409/2e435a91/attachment.sig>


More information about the U-Boot mailing list