public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Cc: stable@vger.kernel.org, Andrew Morton <akpm@linux-foundation.org>,
	Lizhi Xu <lizhi.xu@windriver.com>
Subject: Re: [PATCH 4.19 5.4 5.10] nilfs2: propagate directory read errors from nilfs_find_entry()
Date: Mon, 21 Oct 2024 11:44:31 +0200	[thread overview]
Message-ID: <2024102122-epic-possum-ecac@gregkh> (raw)
In-Reply-To: <20241019152136.5829-1-konishi.ryusuke@gmail.com>

On Sun, Oct 20, 2024 at 12:21:15AM +0900, Ryusuke Konishi wrote:
> commit 08cfa12adf888db98879dbd735bc741360a34168 upstream.
> 
> Syzbot reported that a task hang occurs in vcs_open() during a fuzzing
> test for nilfs2.
> 
> The root cause of this problem is that in nilfs_find_entry(), which
> searches for directory entries, ignores errors when loading a directory
> page/folio via nilfs_get_folio() fails.
> 
> If the filesystem images is corrupted, and the i_size of the directory
> inode is large, and the directory page/folio is successfully read but
> fails the sanity check, for example when it is zero-filled,
> nilfs_check_folio() may continue to spit out error messages in bursts.
> 
> Fix this issue by propagating the error to the callers when loading a
> page/folio fails in nilfs_find_entry().
> 
> The current interface of nilfs_find_entry() and its callers is outdated
> and cannot propagate error codes such as -EIO and -ENOMEM returned via
> nilfs_find_entry(), so fix it together.
> 
> Link: https://lkml.kernel.org/r/20241004033640.6841-1-konishi.ryusuke@gmail.com
> Fixes: 2ba466d74ed7 ("nilfs2: directory entry operations")
> Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
> Reported-by: Lizhi Xu <lizhi.xu@windriver.com>
> Closes: https://lkml.kernel.org/r/20240927013806.3577931-1-lizhi.xu@windriver.com
> Reported-by: syzbot+8a192e8d090fa9a31135@syzkaller.appspotmail.com
> Closes: https://syzkaller.appspot.com/bug?extid=8a192e8d090fa9a31135
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> ---
> Please apply this patch to the stable trees indicated by the subject
> prefix instead of the failed patches.
> 
> This patch is tailored to take page/folio conversion into account and
> avoid a few conflicts.  Compiled and tested successfully.

All now queued up, thanks for the backports.

greg k-h

      reply	other threads:[~2024-10-21  9:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-18  7:47 FAILED: patch "[PATCH] nilfs2: propagate directory read errors from" failed to apply to 5.10-stable tree gregkh
2024-10-19 15:21 ` [PATCH 4.19 5.4 5.10] nilfs2: propagate directory read errors from nilfs_find_entry() Ryusuke Konishi
2024-10-21  9:44   ` Greg Kroah-Hartman [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=2024102122-epic-possum-ecac@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=akpm@linux-foundation.org \
    --cc=konishi.ryusuke@gmail.com \
    --cc=lizhi.xu@windriver.com \
    --cc=stable@vger.kernel.org \
    /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