[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tencent_2FB36AA36D497403B5E44E9764F76BA6DC05@qq.com>
Date: Sat, 23 Aug 2025 09:22:11 +0800
From: Edward Adam Davis <eadavis@...com>
To: syzbot+5a398eb460ddaa6f242f@...kaller.appspotmail.com
Cc: linux-kernel@...r.kernel.org,
syzkaller-bugs@...glegroups.com
Subject: Re: [syzbot] [erofs?] KASAN: global-out-of-bounds Read in z_erofs_decompress_queue
#syz test
diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c
index 2d73297003d2..085fa0685a57 100644
--- a/fs/erofs/zdata.c
+++ b/fs/erofs/zdata.c
@@ -762,6 +762,10 @@ static int z_erofs_register_pcluster(struct z_erofs_frontend *fe)
pcl->from_meta = map->m_flags & EROFS_MAP_META;
fe->mode = Z_EROFS_PCLUSTER_FOLLOWED;
+ if (pcl->algorithmformat >= Z_EROFS_COMPRESSION_MAX) {
+ err = -EINVAL;
+ goto out;
+ }
/*
* lock all primary followed works before visible to others
* and mutex_trylock *never* fails for a new pcluster.
@@ -796,6 +800,7 @@ static int z_erofs_register_pcluster(struct z_erofs_frontend *fe)
err_out:
mutex_unlock(&pcl->lock);
+out:
z_erofs_free_pcluster(pcl);
return err;
}
Powered by blists - more mailing lists