From: Eric Biggers <ebiggers@kernel.org>
To: Jun Nie <jun.nie@linaro.org>
Cc: tytso@mit.edu, adilger.kernel@dilger.ca,
linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org,
tudor.ambarus@linaro.org
Subject: Re: [PATCH 2/2] ext4: refuse to create ea block when umounted
Date: Fri, 30 Dec 2022 12:13:25 -0800 [thread overview]
Message-ID: <Y69GZdLcWkCvZhq1@sol.localdomain> (raw)
In-Reply-To: <20221230110016.476621-2-jun.nie@linaro.org>
On Fri, Dec 30, 2022 at 07:00:16PM +0800, Jun Nie wrote:
> The ea block expansion need to access s_root while it is
> already set as NULL when umount is triggered. Refuse this
> request to avoid panic.
>
> Reported-by: syzbot+2dacb8f015bf1420155f@syzkaller.appspotmail.com
> Link: https://syzkaller.appspot.com/bug?id=3613786cb88c93aa1c6a279b1df6a7b201347d08
> Signed-off-by: Jun Nie <jun.nie@linaro.org>
> ---
> fs/ext4/xattr.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c
> index 235a517d9c17..ac58494e49b6 100644
> --- a/fs/ext4/xattr.c
> +++ b/fs/ext4/xattr.c
> @@ -1422,6 +1422,12 @@ static struct inode *ext4_xattr_inode_create(handle_t *handle,
> uid_t owner[2] = { i_uid_read(inode), i_gid_read(inode) };
> int err;
>
> + if (inode->i_sb->s_root == NULL) {
> + ext4_error(inode->i_sb,
> + "refuse to create EA inode when umounting");
> + return ERR_PTR(-EINVAL);
> + }
> +
Why is an xattr being set during unmount?
- Eric
next prev parent reply other threads:[~2022-12-30 20:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-30 11:00 [PATCH 1/2] ext4: optimize ea_inode block expansion Jun Nie
2022-12-30 11:00 ` [PATCH 2/2] ext4: refuse to create ea block when umounted Jun Nie
2022-12-30 20:13 ` Eric Biggers [this message]
2022-12-31 3:27 ` Theodore Ts'o
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=Y69GZdLcWkCvZhq1@sol.localdomain \
--to=ebiggers@kernel.org \
--cc=adilger.kernel@dilger.ca \
--cc=jun.nie@linaro.org \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tudor.ambarus@linaro.org \
--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