From: syzbot <syzbot+2313dda4dc4885c93578@syzkaller.appspotmail.com>
To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] Re: KASAN: use-after-free Read in ocfs2_search_extent_list()
Date: Tue, 10 Dec 2024 03:27:34 -0800 [thread overview]
Message-ID: <675825a6.050a0220.a30f1.01cc.GAE@google.com> (raw)
In-Reply-To: <67577778.050a0220.a30f1.01bc.GAE@google.com>
For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.
***
Subject: Re: KASAN: use-after-free Read in ocfs2_search_extent_list()
Author: dmantipov@yandex.ru
#syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 7cb1b466315004af98f6ba6c2546bb713ca3c237
diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c
index 395e23920632..841135341898 100644
--- a/fs/ocfs2/alloc.c
+++ b/fs/ocfs2/alloc.c
@@ -770,6 +770,10 @@ int ocfs2_search_extent_list(struct ocfs2_extent_list *el, u32 v_cluster)
struct ocfs2_extent_rec *rec;
u32 rec_end, rec_start, clusters;
+ /* Do not search over an invalid extent list. */
+ if (le16_to_cpu(el->l_next_free_rec) >= le16_to_cpu(el->l_count))
+ return ret;
+
for(i = 0; i < le16_to_cpu(el->l_next_free_rec); i++) {
rec = &el->l_recs[i];
prev parent reply other threads:[~2024-12-10 11:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-09 23:04 [syzbot] [ocfs2?] KASAN: use-after-free Read in ocfs2_search_extent_list syzbot
2024-12-10 11:02 ` Edward Adam Davis
2024-12-10 11:28 ` syzbot
2024-12-10 11:23 ` Julian Sun
2024-12-10 11:47 ` syzbot
2024-12-10 11:27 ` syzbot [this message]
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=675825a6.050a0220.a30f1.01cc.GAE@google.com \
--to=syzbot+2313dda4dc4885c93578@syzkaller.appspotmail.com \
--cc=linux-kernel@vger.kernel.org \
--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