public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: yangerkun <yangerkun@huawei.com>
To: Ritesh Harjani <riteshh@linux.ibm.com>, <adilger@dilger.ca>
Cc: <tytso@mit.edu>, <jack@suse.com>, <linux-ext4@vger.kernel.org>
Subject: Re: [PATCH] ext4: do not use extent after put_bh
Date: Fri, 30 Oct 2020 09:23:38 +0800	[thread overview]
Message-ID: <a77ce068-aa0f-77f3-abc4-58c0224757b0@huawei.com> (raw)
In-Reply-To: <93d5b1bf-0cf9-a483-ff5d-40a6a9c4b92b@linux.ibm.com>



在 2020/10/30 0:08, Ritesh Harjani 写道:
> 
> 
> On 10/28/20 11:26 AM, yangerkun wrote:
>> ext4_ext_search_right will read more extent block and call put_bh after
>> we get the information we need. However ret_ex will break this and may
>> cause use-after-free once pagecache has been freed. Fix it by dup the
>> extent we need.
> 
> 
> It would be good if we have a test case to reproduce it. Do you?
> Ideally it should go in fstests, if you have some way to forcefully
> reproduce it/simulate it. Let me know, if needed, I can as well help to
> get those into fstests.

Sorry for that. I found this bug while reading source code. Not with a 
testcase.

And time leave for drop pagecache is so small(time between 
get_implied_cluster_alloc and ext4_ext_search_right in 
ext4_ext_map_blocks, other caller for ext4_ext_search_right won't use 
@ret_ex). It may difficult to reproduce it expect a delay injection.

Thanks,
Kun.

> 
> -ritesh
> .

      reply	other threads:[~2020-10-30  1:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-28  5:56 [PATCH] ext4: do not use extent after put_bh yangerkun
2020-10-29  4:14 ` Theodore Y. Ts'o
2020-10-29 16:08 ` Ritesh Harjani
2020-10-30  1:23   ` yangerkun [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=a77ce068-aa0f-77f3-abc4-58c0224757b0@huawei.com \
    --to=yangerkun@huawei.com \
    --cc=adilger@dilger.ca \
    --cc=jack@suse.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=riteshh@linux.ibm.com \
    --cc=tytso@mit.edu \
    /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