Linux-EROFS Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Chao Yu <chao@kernel.org>
To: Gao Xiang <hsiangkao@linux.alibaba.com>, linux-erofs@lists.ozlabs.org
Cc: chao@kernel.org, LKML <linux-kernel@vger.kernel.org>,
	oliver.yang@linux.alibaba.com,
	syzbot+52bae5c495dbe261a0bc@syzkaller.appspotmail.com
Subject: Re: [PATCH] erofs: fix use-after-free on sbi->sync_decompress
Date: Fri, 22 May 2026 21:00:44 +0800	[thread overview]
Message-ID: <4fb20b32-5651-4aff-9a4f-8db5652db476@kernel.org> (raw)
In-Reply-To: <20260522082716.3598160-1-hsiangkao@linux.alibaba.com>

On 5/22/26 16:27, Gao Xiang wrote:
> z_erofs_decompress_kickoff() can race with filesystem unmount, causing
> a use-after-free on sbi->sync_decompress.
> 
> When I/O completes, z_erofs_endio() calls z_erofs_decompress_kickoff()
> to queue z_erofs_decompressqueue_work() asynchronously. Then, after all
> folios are unlocked, unmount workflow can proceed and sbi will be freed
> before accessing to sbi->sync_decompress.
> 
> Thread (unmount)        I/O completion        kworker
>                          queue_work
>                                                z_erofs_decompressqueue_work
>                                                 (all folios are unlocked)
> cleanup_mnt
>   ..
>   erofs_kill_sb
>    erofs_sb_free
>     kfree(sbi)
>                          access sbi->sync_decompress  // UAF!!
> 
> Fixes: 40452ffca3c1 ("erofs: add sysfs node to control sync decompression strategy")
> Reported-by: syzbot+52bae5c495dbe261a0bc@syzkaller.appspotmail.com
> Closes: https://syzkaller.appspot.com/bug?extid=52bae5c495dbe261a0bc
> Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>

Reviewed-by: Chao Yu <chao@kernel.org>

Thanks,


      parent reply	other threads:[~2026-05-22 13:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-22  8:27 [PATCH] erofs: fix use-after-free on sbi->sync_decompress Gao Xiang
2026-05-22 12:08 ` Jianan Huang
2026-05-22 13:00 ` Chao Yu [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=4fb20b32-5651-4aff-9a4f-8db5652db476@kernel.org \
    --to=chao@kernel.org \
    --cc=hsiangkao@linux.alibaba.com \
    --cc=linux-erofs@lists.ozlabs.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oliver.yang@linux.alibaba.com \
    --cc=syzbot+52bae5c495dbe261a0bc@syzkaller.appspotmail.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