diff options
| author | Richard Genoud <[email protected]> | 2026-03-13 11:42:26 +0100 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2026-03-26 11:04:28 -0600 |
| commit | 6494e823b46ced400764b6203d7480c9e3badc20 (patch) | |
| tree | b0bdbe490c25ab06c887c505e593221c20f1b916 /fs | |
| parent | 5e23f7f9f3b3c8fe78ed3aadeed9b187ba8930da (diff) | |
spl: add squashfs support
Implement spl_load_image_sqfs() in spl code.
This will be used in MMC to read a file from a squashfs partition.
Also, loosen squashfs read checks on file size by not failing when a
bigger size than the actual file size is requested. (Just read the file)
This is needed for FIT loading, because the length is ALIGNed.
Signed-off-by: Richard Genoud <[email protected]>
Reviewed-by: Miquel Raynal <[email protected]>
Reviewed-by: João Marcos Costa <[email protected]>
Diffstat (limited to 'fs')
| -rw-r--r-- | fs/squashfs/sqfs.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/fs/squashfs/sqfs.c b/fs/squashfs/sqfs.c index 9cb8b4afcdd..543db8c7e9e 100644 --- a/fs/squashfs/sqfs.c +++ b/fs/squashfs/sqfs.c @@ -1490,13 +1490,11 @@ static int sqfs_read_nest(const char *filename, void *buf, loff_t offset, goto out; } - /* If the user specifies a length, check its sanity */ - if (len) { - if (len > finfo.size) { - ret = -EINVAL; - goto out; - } - + /* + * For FIT loading, the len is ALIGN, so it may exceed the actual size. + * Let's just read the max. + */ + if (len && len < finfo.size) { finfo.size = len; } else { len = finfo.size; |
