From: syzbot <syzbot+24ac24ff58dc5b0d26b9@syzkaller.appspotmail.com>
To: linux-kernel@vger.kernel.org
Subject: Re: [syzbot] Re: [syzbot] [squashfs?] KMSAN: uninit-value in pick_link
Date: Thu, 01 Aug 2024 06:06:15 -0700 [thread overview]
Message-ID: <0000000000003b2d3b061e9ee030@google.com> (raw)
In-Reply-To: <000000000000a90e8c061e86a76b@google.com>
For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org.
***
Subject: Re: [syzbot] [squashfs?] KMSAN: uninit-value in pick_link
Author: lizhi.xu@windriver.com
why folio not inited?
#syz test: upstream 2f8c4f506285
diff --git a/mm/filemap.c b/mm/filemap.c
index 657bcd887fdb..a830b22c9708 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -3754,6 +3754,7 @@ static struct folio *do_read_cache_folio(struct address_space *mapping,
if (!folio)
return ERR_PTR(-ENOMEM);
err = filemap_add_folio(mapping, folio, index, gfp);
+ printk("err: %d, folio: %p, in: %p, read_folio: %p %s\n", err, folio, mapping->host, filler, __func__);
if (unlikely(err)) {
folio_put(folio);
if (err == -EEXIST)
@@ -3787,6 +3788,7 @@ static struct folio *do_read_cache_folio(struct address_space *mapping,
filler:
err = filemap_read_folio(file, filler, folio);
+ printk("err: %d, folio: %p, folio uptod: %d, %s\n", err, folio, folio_test_uptodate(folio), __func__);
if (err) {
folio_put(folio);
if (err == AOP_TRUNCATED_PAGE)
diff --git a/fs/namei.c b/fs/namei.c
index 3a4c40e12f78..3f72aa8d604d 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -5272,6 +5272,8 @@ const char *page_get_link(struct dentry *dentry, struct inode *inode,
page = read_mapping_page(mapping, 0, NULL);
if (IS_ERR(page))
return (char*)page;
+ else if (IS_ERR(page_folio(page)))
+ return (char*)page_folio(page);
}
set_delayed_call(callback, page_put_link, page);
BUG_ON(mapping_gfp_mask(mapping) & __GFP_HIGHMEM);
diff --git a/fs/squashfs/file.c b/fs/squashfs/file.c
index a8c1e7f9a609..d581cea14316 100644
--- a/fs/squashfs/file.c
+++ b/fs/squashfs/file.c
@@ -459,6 +459,8 @@ static int squashfs_read_folio(struct file *file, struct folio *folio)
TRACE("Entered squashfs_readpage, page index %lx, start block %llx\n",
page->index, squashfs_i(inode)->start);
+ printk("folio: %p, isize: %d, pidx: %d, idx: %d, fe: %d, %s\n",
+ folio, i_size_read(inode), page->index, index, file_end, __func__);
if (page->index >= ((i_size_read(inode) + PAGE_SIZE - 1) >>
PAGE_SHIFT))
goto out;
@@ -478,6 +480,7 @@ static int squashfs_read_folio(struct file *file, struct folio *folio)
} else
res = squashfs_readpage_fragment(page, expected);
+ printk("res: %d, %s\n", res, __func__);
if (!res)
return 0;
@@ -489,6 +492,7 @@ static int squashfs_read_folio(struct file *file, struct folio *folio)
if (res == 0)
SetPageUptodate(page);
unlock_page(page);
+ printk("out, res: %d, %s\n", res, __func__);
return res;
}
diff --git a/fs/squashfs/symlink.c b/fs/squashfs/symlink.c
index 6ef735bd841a..7e41196ea8de 100644
--- a/fs/squashfs/symlink.c
+++ b/fs/squashfs/symlink.c
@@ -49,6 +49,8 @@ static int squashfs_symlink_read_folio(struct file *file, struct folio *folio)
/*
* Skip index bytes into symlink metadata.
*/
+ printk("folio: %p, isize: %d, idx: %d, %s\n",
+ folio, i_size_read(inode), index, __func__);
if (index) {
bytes = squashfs_read_metadata(sb, NULL, &block, &offset,
index);
@@ -93,6 +95,7 @@ static int squashfs_symlink_read_folio(struct file *file, struct folio *folio)
flush_dcache_folio(folio);
error = 0;
out:
+ printk("error: %d, %s\n", error, __func__);
folio_end_read(folio, error == 0);
return error;
}
next prev parent reply other threads:[~2024-08-01 13:06 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-31 8:12 [syzbot] [squashfs?] KMSAN: uninit-value in pick_link syzbot
2024-08-01 1:23 ` [syzbot] " syzbot
2024-08-01 2:27 ` [PATCH] filemap: Init the newly allocated folio memory to 0 for the filemap Lizhi Xu
2024-08-01 2:58 ` Al Viro
2024-08-01 5:28 ` Lizhi Xu
2024-08-01 7:10 ` Al Viro
2024-08-01 7:24 ` Al Viro
2024-08-01 8:12 ` Lizhi Xu
2024-08-01 9:13 ` Lizhi Xu
2024-08-01 12:42 ` Al Viro
2024-08-01 15:17 ` [PATCH V2] squashfs: Add length check in squashfs_symlink_read_folio Lizhi Xu
2024-08-01 15:30 ` Jan Kara
2024-08-02 1:39 ` Lizhi Xu
2024-08-02 1:50 ` [PATCH V3] squashfs: Add i_size check in squash_read_inode Lizhi Xu
2024-08-02 3:01 ` [PATCH V4] " Lizhi Xu
2024-08-02 9:33 ` Jan Kara
2024-08-02 11:16 ` [PATCH V5] " Lizhi Xu
2024-08-02 13:52 ` Al Viro
2024-08-02 14:44 ` [PATCH] filemap: Init the newly allocated folio memory to 0 for the filemap Lizhi Xu
2024-08-02 15:03 ` Al Viro
2024-08-03 4:07 ` [PATCH V6] squashfs: Add symlink size check in squash_read_inode Lizhi Xu
2024-08-03 7:43 ` [PATCH V7] " Lizhi Xu
2024-08-04 21:16 ` Phillip Lougher
2024-08-04 21:20 ` Al Viro
2024-08-04 22:31 ` Phillip Lougher
2024-08-05 7:03 ` Christian Brauner
2024-08-05 1:02 ` Lizhi Xu
2024-08-05 1:40 ` Al Viro
2024-08-06 2:56 ` Lizhi Xu
2024-08-06 4:59 ` Al Viro
2024-08-06 6:19 ` Lizhi Xu
2024-08-06 6:58 ` Al Viro
2024-08-01 9:07 ` [syzbot] Re: [syzbot] [squashfs?] KMSAN: uninit-value in pick_link syzbot
2024-08-01 9:27 ` syzbot
2024-08-01 12:08 ` syzbot
2024-08-01 13:06 ` syzbot [this message]
2024-08-01 14:08 ` syzbot
2024-08-01 14:39 ` syzbot
2024-08-02 1:02 ` syzbot
2024-08-02 2:00 ` syzbot
2024-08-03 3:04 ` syzbot
2024-08-03 3:13 ` 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=0000000000003b2d3b061e9ee030@google.com \
--to=syzbot+24ac24ff58dc5b0d26b9@syzkaller.appspotmail.com \
--cc=linux-kernel@vger.kernel.org \
/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