From: "heming.zhao@suse.com" <heming.zhao@suse.com>
To: Lizhi Xu <lizhi.xu@windriver.com>,
joseph.qi@linux.alibaba.com,
syzbot+ab134185af9ef88dfed5@syzkaller.appspotmail.com
Cc: jlbec@evilplan.org, linux-kernel@vger.kernel.org,
mark@fasheh.com, ocfs2-devel@lists.linux.dev,
syzkaller-bugs@googlegroups.com
Subject: Re: [PATCH] ocfs2: remove unreasonable unlock
Date: Tue, 20 Aug 2024 12:04:39 +0800 [thread overview]
Message-ID: <2e662cb6-47d9-4bbd-855d-1f6d5edb8633@suse.com> (raw)
In-Reply-To: <20240819025112.2505463-1-lizhi.xu@windriver.com>
On 8/19/24 10:51, Lizhi Xu wrote:
> There was a lock release before exiting, so remove the unreasonable unlock.
>
> Reported-and-tested-by: syzbot+ab134185af9ef88dfed5@syzkaller.appspotmail.com
> Closes: https://syzkaller.appspot.com/bug?extid=ab134185af9ef88dfed5
> Signed-off-by: Lizhi Xu <lizhi.xu@windriver.com>
> ---
> fs/ocfs2/buffer_head_io.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/fs/ocfs2/buffer_head_io.c b/fs/ocfs2/buffer_head_io.c
> index cdb9b9bdea1f..e62c7e1de4eb 100644
> --- a/fs/ocfs2/buffer_head_io.c
> +++ b/fs/ocfs2/buffer_head_io.c
> @@ -235,7 +235,6 @@ int ocfs2_read_blocks(struct ocfs2_caching_info *ci, u64 block, int nr,
> if (bhs[i] == NULL) {
> bhs[i] = sb_getblk(sb, block++);
> if (bhs[i] == NULL) {
> - ocfs2_metadata_cache_io_unlock(ci);
> status = -ENOMEM;
> mlog_errno(status);
> /* Don't forget to put previous bh! */
The fix looks good to me. However, I found another issue in this function.
In the for-loop after the 'read_failure' label, the condition
'(bh == NULL) && flags includes OCFS2_BH_READAHEAD' is missing.
When this contidion is true, this for-loop will call ocfs2_set_buffer_uptodate(ci, bh),
which then triggers a NULL pointer access error.
If you agree with my analysis, please add the new fix and send a v2 patch.
Thanks,
Heming
next prev parent reply other threads:[~2024-08-20 4:04 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-18 17:06 [syzbot] [ocfs2?] WARNING: bad unlock balance in ocfs2_read_blocks syzbot
2024-08-19 2:01 ` [syzbot] " syzbot
2024-08-19 2:51 ` [PATCH] ocfs2: remove unreasonable unlock Lizhi Xu
2024-08-20 4:04 ` heming.zhao [this message]
2024-08-20 5:59 ` Lizhi Xu
2024-08-20 6:55 ` [PATCH V2 1/2] " Lizhi Xu
2024-08-20 6:55 ` [PATCH V2 2/2] ocfs2: Fix uaf in ocfs2_read_blocks Lizhi Xu
2024-08-20 7:15 ` Heming Zhao
2024-08-20 7:37 ` [PATCH V3] ocfs2: Fix uaf in ocfs2_set_buffer_uptodate Lizhi Xu
2024-08-20 8:32 ` Heming Zhao
2024-08-20 9:45 ` [PATCH V3 1/2] ocfs2: remove unreasonable unlock Lizhi Xu
2024-08-20 9:45 ` [PATCH V3 2/2] ocfs2: Fix uaf in ocfs2_set_buffer_uptodate Lizhi Xu
2024-08-20 11:32 ` Heming Zhao
2024-08-20 13:44 ` [PATCH] ocfs2: remove unreasonable unlock Lizhi Xu
2024-08-21 0:08 ` [PATCH V3 2/2] ocfs2: Fix uaf in ocfs2_set_buffer_uptodate Joseph Qi
2024-08-21 2:34 ` Joseph Qi
2024-08-21 2:39 ` Heming Zhao
2024-08-21 5:55 ` Lizhi Xu
2024-08-21 6:14 ` [PATCH V4 2/2] ocfs2: Fix possible null-ptr-deref " Lizhi Xu
2024-08-21 6:23 ` heming.zhao
2024-08-21 6:55 ` Lizhi Xu
2024-08-21 7:37 ` heming.zhao
2024-08-21 7:58 ` Joseph Qi
2024-08-21 9:14 ` Lizhi Xu
2024-08-21 11:40 ` Heming Zhao
2024-08-21 21:39 ` Andrew Morton
2024-09-02 0:54 ` Andrew Morton
2024-09-02 1:03 ` Heming Zhao
2024-09-02 2:20 ` Joseph Qi
2024-09-02 14:23 ` Lizhi Xu
2024-08-21 7:59 ` Joseph Qi
2024-08-20 23:55 ` [PATCH V3 1/2] ocfs2: remove unreasonable unlock Joseph Qi
2024-08-20 7:28 ` [PATCH V2 " Heming Zhao
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=2e662cb6-47d9-4bbd-855d-1f6d5edb8633@suse.com \
--to=heming.zhao@suse.com \
--cc=jlbec@evilplan.org \
--cc=joseph.qi@linux.alibaba.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lizhi.xu@windriver.com \
--cc=mark@fasheh.com \
--cc=ocfs2-devel@lists.linux.dev \
--cc=syzbot+ab134185af9ef88dfed5@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
all inboxes | Powered by JetHome®