erofs-utils: lib: error out if fragment_off is crafted
PATCH 1/1 erofs-utils: lib: error out if fragment_off is crafted
Found in some fuzzed images.
Fixes f511cfbbc0da ("erofs-utils: introduce fragment cache")
Signed-off-by Gao Xiang <[email protected]>
--- lib/fragments.c | 4 ++++ 1 file changed, 4 insertions(+)
lib/fragments.c +4 -0
@@ -524,6 +524,10 @@ int erofs_packedfile_read(struct erofs_sb_info *sbi,erofs_blk_t bnr =erofs_blknr (sbi, pos);bool uptodate; +if (__erofs_unlikely (bnr > epi->uptodate_size)) { +erofs_err ("packed inode EOF exceeded @ %llu" , pos); +return -EFSCORRUPTED ; + } map.m_la =round_down (pos, bsz); len =min_t (erofs_off_t, bsz - (pos & (bsz -1 )), end - pos);
Signature · 1 line
2.43.5