Tony Dinh 53cc4332b3 ext4fs: Fix: Read outside partition error (take 2)
Use lbaint_t for blknr to avoid overflow in ext4fs_read_file().

Background:

blknr (block number) used in ext4fs_read_file() could be increased to a
very large value and causes a wrap around at 32 bit signed integer max,
thus becomes negative. This results in an out-of-normal range for sector
number (during the assignment delayed_start = blknr) where delayed_start
sector is typed uint64 lbaint_t. This causes the "Read outside partition"
error.

Looks like we also have this overflown problem in ext4_write.c that needs
to be addressed.

This patch was tested on the Synology DS116 (Armada 385) board, and a
4TB Seagate HDD.

Signed-off-by: Tony Dinh <mibodhi@gmail.com>
2025-06-12 13:22:26 -06:00
..
2025-05-13 11:30:09 -06:00
2024-07-15 12:12:17 -06:00
2024-10-11 11:44:48 -06:00
2024-07-15 12:12:17 -06:00
2025-04-02 20:00:59 -06:00
2025-04-02 20:00:59 -06:00