erofs-utils: validate the extent length for uncompressed pclusters
PATCH 1/1 erofs-utils: validate the extent length for uncompressed pclusters
From: Yue Hu <[email protected]>
Keep in sync with the kernel commit c505feba4c0d ("erofs: validate the extent length for uncompressed pclusters"), so that we can catch the issue as well in fuse.
Signed-off-by Yue Hu <[email protected]>
--- lib/zmap.c | 5 +++++ 1 file changed, 5 insertions(+)
lib/zmap.c +5 -0
@@ -647,6 +647,11 @@ static int z_erofs_do_map_blocks(struct erofs_inode *vi, }if (m.headtype ==Z_EROFS_VLE_CLUSTER_TYPE_PLAIN ) { +if (map->m_llen > map->m_plen) { +DBG_BUGON (1 ); + err = -EFSCORRUPTED ; + goto out; + }if (vi->z_advise &Z_EROFS_ADVISE_INTERLACED_PCLUSTER ) map->m_algorithmformat =Z_EROFS_COMPRESSION_INTERLACED ;
Signature · 1 line
2.17.1