From: Yue Hu <zbestahu@gmail.com>
To: Gao Xiang <hsiangkao@linux.alibaba.com>
Cc: linux-erofs@lists.ozlabs.org,
syzbot+7bc44a489f0ef0670bd5@syzkaller.appspotmail.com,
Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>,
syzkaller-bugs@googlegroups.com,
LKML <linux-kernel@vger.kernel.org>,
Roberto Sassu <roberto.sassu@huaweicloud.com>,
linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] erofs: fix uninitialized page cache reported by KMSAN
Date: Tue, 5 Mar 2024 10:17:42 +0800 [thread overview]
Message-ID: <20240305101742.00000a0a.zbestahu@gmail.com> (raw)
In-Reply-To: <20240304035339.425857-1-hsiangkao@linux.alibaba.com>
On Mon, 4 Mar 2024 11:53:39 +0800
Gao Xiang <hsiangkao@linux.alibaba.com> wrote:
> syzbot reports a KMSAN reproducer [1] which generates a crafted
> filesystem image and causes IMA to read uninitialized page cache.
>
> Later, (rq->outputsize > rq->inputsize) will be formally supported
> after either large uncompressed pclusters (> block size) or big
> lclusters are landed. However, currently there is no way to generate
> such filesystems by using mkfs.erofs.
>
> Thus, let's mark this condition as unsupported for now.
>
> [1] https://lore.kernel.org/r/0000000000002be12a0611ca7ff8@google.com
>
> Reported-by: syzbot+7bc44a489f0ef0670bd5@syzkaller.appspotmail.com
> Fixes: 1ca01520148a ("erofs: refine z_erofs_transform_plain() for sub-page block support")
> Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
> ---
> fs/erofs/decompressor.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/fs/erofs/decompressor.c b/fs/erofs/decompressor.c
> index d4cee95af14c..2ec9b2bb628d 100644
> --- a/fs/erofs/decompressor.c
> +++ b/fs/erofs/decompressor.c
> @@ -323,7 +323,8 @@ static int z_erofs_transform_plain(struct z_erofs_decompress_req *rq,
> unsigned int cur = 0, ni = 0, no, pi, po, insz, cnt;
> u8 *kin;
>
> - DBG_BUGON(rq->outputsize > rq->inputsize);
> + if (rq->outputsize > rq->inputsize)
> + return -EOPNOTSUPP;
> if (rq->alg == Z_EROFS_COMPRESSION_INTERLACED) {
> cur = bs - (rq->pageofs_out & (bs - 1));
> pi = (rq->pageofs_in + rq->inputsize - cur) & ~PAGE_MASK;
Reviewed-by: Yue Hu <huyue2@coolpad.com>
next prev parent reply other threads:[~2024-03-05 2:17 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-20 6:41 [syzbot] [integrity?] [lsm?] KMSAN: uninit-value in ima_add_template_entry syzbot
2024-02-20 10:40 ` Roberto Sassu
2024-03-03 14:54 ` Tetsuo Handa
2024-03-03 23:53 ` Gao Xiang
2024-03-04 3:53 ` [PATCH] erofs: fix uninitialized page cache reported by KMSAN Gao Xiang
2024-03-04 6:04 ` Gao Xiang
2024-03-04 6:51 ` [syzbot] [erofs] KMSAN: uninit-value in ima_add_template_entry syzbot
2024-03-04 17:51 ` [PATCH] erofs: fix uninitialized page cache reported by KMSAN Sandeep Dhavale
2024-03-05 2:17 ` Yue Hu [this message]
2024-03-07 1:04 ` Chao Yu
2024-03-04 8:15 ` [syzbot] [integrity?] [lsm?] KMSAN: uninit-value in ima_add_template_entry Roberto Sassu
2024-03-02 22:01 ` [syzbot] [lsm?] [integrity?] " syzbot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240305101742.00000a0a.zbestahu@gmail.com \
--to=zbestahu@gmail.com \
--cc=hsiangkao@linux.alibaba.com \
--cc=linux-erofs@lists.ozlabs.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=penguin-kernel@I-love.SAKURA.ne.jp \
--cc=roberto.sassu@huaweicloud.com \
--cc=syzbot+7bc44a489f0ef0670bd5@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).