From: Christoph Hellwig <hch@infradead.org>
To: Sam Sun <samsun1006219@gmail.com>
Cc: brauner@kernel.org, "Darrick J. Wong" <djwong@kernel.org>,
linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org, syzkaller@googlegroups.com
Subject: Re: [BUG] iomap: NULL dereference in iomap_finish_folio_read after deferred failed read
Date: Sun, 24 May 2026 22:43:13 -0700 [thread overview]
Message-ID: <ahPhcZvPD4S20UJf@infradead.org> (raw)
In-Reply-To: <CAEkJfYPhWdd59RKmuNLJg-bkypHz7xiOwaWyNVu3A8CUqQCnvg@mail.gmail.com>
On Sat, May 23, 2026 at 06:58:46PM +0800, Sam Sun wrote:
> Dear developers and maintainers,
>
> We encountered a NULL pointer dereference in the deferred buffered
> read failure path. Unfortunately, no reproducer is available yet.
[snip]
> We analyzed the cause of this report. It seems that failed buffered
> read bios are deferred to a global work item "failed_read_work". The
> deferred worker still owns the bio/folio, but by the time it calls
> `iomap_finish_folio_read()`, the folio may have been truncated,
> invalidated, or otherwise detached from its mapping. In that case,
> `folio->mapping` is NULL, but the error reporting path unconditionally
> dereferences `folio->mapping->host`. This pattern still exists on the
> latest kernel commit.
>
> A possible fix could be avoiding the `folio->mapping->host`
The folio is locked until the folio_end_read() call. So I don't see
what could legitimately clear folio->mapping here. Curiously waiting
for the reproducer to see waht is going wrong here.
next prev parent reply other threads:[~2026-05-25 5:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-23 10:58 Sam Sun
2026-05-25 5:43 ` Christoph Hellwig [this message]
2026-05-27 3:23 ` Sam Sun
2026-05-27 4:12 ` Joanne Koong
2026-05-29 10:24 ` Sam Sun
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=ahPhcZvPD4S20UJf@infradead.org \
--to=hch@infradead.org \
--cc=brauner@kernel.org \
--cc=djwong@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=samsun1006219@gmail.com \
--cc=syzkaller@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
Powered by JetHome