From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Chao Yu <yuchao0@huawei.com>
Cc: Eric Biggers <ebiggers@kernel.org>,
kilobyte@angband.pl, linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH 2/2] fsck.f2fs: fix to check validation of i_xattr_nid
Date: Mon, 2 Nov 2020 08:04:15 -0800 [thread overview]
Message-ID: <20201102160415.GA529594@google.com> (raw)
In-Reply-To: <951032c7-0419-921e-876c-8c8e5c59c52a@huawei.com>
On 11/02, Chao Yu wrote:
> On 2020/11/2 10:39, Eric Biggers wrote:
> > On Mon, Nov 02, 2020 at 09:31:09AM +0800, Chao Yu wrote:
> > > On 2020/11/1 7:48, Eric Biggers wrote:
> > > > Hi Chao,
> > > >
> > > > On Tue, Apr 07, 2020 at 06:01:07PM +0800, Chao Yu wrote:
> > > > > Otherwise, fsck.f2fs will access invalid memory address as below:
> > > > >
> > > > > - fsck_verify
> > > > > - dump_node
> > > > > - dump_file
> > > > > - dump_inode_blk
> > > > > - dump_xattr
> > > > > - read_all_xattrs
> > > > > - get_node_info
> > > > > access &(F2FS_FSCK(sbi)->entries[nid])
> > > > >
> > > > > Signed-off-by: Chao Yu <yuchao0@huawei.com>
> > > > > ---
> > > > > fsck/dump.c | 2 ++
> > > > > fsck/fsck.c | 8 ++++++++
> > > > > fsck/fsck.h | 3 +++
> > > > > fsck/mount.c | 8 +++++---
> > > > > fsck/xattr.c | 20 ++++++++++++++++++--
> > > > > 5 files changed, 36 insertions(+), 5 deletions(-)
> > > > >
> > > >
> > > > This commit caused a regression where 'dump.f2fs -i <inode> <device>'
> > > > now segfaults if the inode has any extended attributes.
> > > >
> > > > It's because read_all_xattrs() now calls fsck_sanity_check_nid(), which
> > > > eventually dereferences f2fs_fsck::main_area_bitmap, which is NULL.
> > > >
> > > > I'm not sure what was intended here.
> > >
> > > Eric, could you please have a try with below commit:
> > >
> > > https://git.kernel.org/pub/scm/linux/kernel/git/chao/f2fs-tools.git/commit/?h=dev-test&id=aad80ed0099fb9530ae3af9789362353ff580252
> > >
> >
> > Works for me. I was wondering whether the fix would be more than that, but
> > maybe not.
>
> Thanks for both report and test.
>
> I don't have any other concern on current solution, let's ask for Jaegeuk's
> opinion anyway.
>
> Jaegeuk, could you please check previous buggy fix and current fix?
Thanks. I applied the new fix.
>
> Thanks,
>
> >
> > - Eric
> > .
> >
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
prev parent reply other threads:[~2020-11-02 16:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-07 10:01 [f2fs-dev] [PATCH 1/2] fsck.f2fs: fix to check validation of block address Chao Yu
2020-04-07 10:01 ` [f2fs-dev] [PATCH 2/2] fsck.f2fs: fix to check validation of i_xattr_nid Chao Yu
2020-10-31 23:48 ` Eric Biggers
2020-11-02 1:31 ` Chao Yu
2020-11-02 2:39 ` Eric Biggers
2020-11-02 3:28 ` Chao Yu
2020-11-02 16:04 ` Jaegeuk Kim [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=20201102160415.GA529594@google.com \
--to=jaegeuk@kernel.org \
--cc=ebiggers@kernel.org \
--cc=kilobyte@angband.pl \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=yuchao0@huawei.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;
as well as URLs for NNTP newsgroup(s).