From: Chao Yu via Linux-f2fs-devel <linux-f2fs-devel@lists.sourceforge.net>
To: Leo Stone <leocstone@gmail.com>, jaegeuk@kernel.org
Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH] f2fs: Add check for deleted inode
Date: Fri, 29 Nov 2024 10:01:17 +0800 [thread overview]
Message-ID: <63a65be2-7ad9-4d65-8c3e-d872f83c011d@kernel.org> (raw)
In-Reply-To: <icjuhtz35zvp5j6zvgbubydbmirbsr4ceasgxr3rk333bj55dp@mp5yf532hd4i>
On 2024/11/26 1:56, Leo Stone wrote:
> On Mon, Nov 25, 2024 at 07:16:41PM +0800, Chao Yu wrote:
>>
>> I'm fine w/ this change, but I didn't get it, how did above commit introduce
>> this bug?
>
> Hello Chao,
>
> The commit from the bisect didn't exactly introduce this bug, since it
> would still be possible to make a different image that does the exact
> same thing in the older code.
>
> This commit was blamed in the bisect because it changes the layout of
> struct f2fs_inode:
>
>> @@ -271,6 +272,10 @@ struct f2fs_inode {
>> __le32 i_inode_checksum;/* inode meta checksum */
>> __le64 i_crtime; /* creation time */
>> __le32 i_crtime_nsec; /* creation time in nano scale */
>> + __le64 i_compr_blocks; /* # of compressed blocks */
>> + __u8 i_compress_algorithm; /* compress algorithm */
>> + __u8 i_log_cluster_size; /* log of cluster size */
>> + __le16 i_padding; /* padding */
>> __le32 i_extra_end[0]; /* for attribute size calculation */
>> } __packed;
>> __le32 i_addr[DEF_ADDRS_PER_INODE]; /* Pointers to data blocks */
>
> This changes F2FS_TOTAL_EXTRA_ATTR_SIZE, which allows the syzbot
> reproducer's inode to pass the sanity check for corrupted i_extra_size.
> Before this change, the inode gets rejected as corrupt:
>
>> [ 62.794566][ T9662] F2FS-fs (loop0): sanity_check_inode: inode (ino=7) has corrupted i_extra_isize: 36, max: 24
Leo,
Ah, right, thanks for the explanation, anyway, can you please correct this
"Fixes line"?
Thanks,
>
> Thanks,
> Leo
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
WARNING: multiple messages have this Message-ID (diff)
From: Chao Yu <chao@kernel.org>
To: Leo Stone <leocstone@gmail.com>, jaegeuk@kernel.org
Cc: Chao Yu <chao@kernel.org>,
linux-f2fs-devel@lists.sourceforge.net,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] f2fs: Add check for deleted inode
Date: Fri, 29 Nov 2024 10:01:17 +0800 [thread overview]
Message-ID: <63a65be2-7ad9-4d65-8c3e-d872f83c011d@kernel.org> (raw)
In-Reply-To: <icjuhtz35zvp5j6zvgbubydbmirbsr4ceasgxr3rk333bj55dp@mp5yf532hd4i>
On 2024/11/26 1:56, Leo Stone wrote:
> On Mon, Nov 25, 2024 at 07:16:41PM +0800, Chao Yu wrote:
>>
>> I'm fine w/ this change, but I didn't get it, how did above commit introduce
>> this bug?
>
> Hello Chao,
>
> The commit from the bisect didn't exactly introduce this bug, since it
> would still be possible to make a different image that does the exact
> same thing in the older code.
>
> This commit was blamed in the bisect because it changes the layout of
> struct f2fs_inode:
>
>> @@ -271,6 +272,10 @@ struct f2fs_inode {
>> __le32 i_inode_checksum;/* inode meta checksum */
>> __le64 i_crtime; /* creation time */
>> __le32 i_crtime_nsec; /* creation time in nano scale */
>> + __le64 i_compr_blocks; /* # of compressed blocks */
>> + __u8 i_compress_algorithm; /* compress algorithm */
>> + __u8 i_log_cluster_size; /* log of cluster size */
>> + __le16 i_padding; /* padding */
>> __le32 i_extra_end[0]; /* for attribute size calculation */
>> } __packed;
>> __le32 i_addr[DEF_ADDRS_PER_INODE]; /* Pointers to data blocks */
>
> This changes F2FS_TOTAL_EXTRA_ATTR_SIZE, which allows the syzbot
> reproducer's inode to pass the sanity check for corrupted i_extra_size.
> Before this change, the inode gets rejected as corrupt:
>
>> [ 62.794566][ T9662] F2FS-fs (loop0): sanity_check_inode: inode (ino=7) has corrupted i_extra_isize: 36, max: 24
Leo,
Ah, right, thanks for the explanation, anyway, can you please correct this
"Fixes line"?
Thanks,
>
> Thanks,
> Leo
next prev parent reply other threads:[~2024-11-29 2:01 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-24 1:04 [f2fs-dev] [PATCH] f2fs: Add check for deleted inode Leo Stone
2024-11-24 1:04 ` Leo Stone
2024-11-24 1:40 ` [f2fs-dev] [syzbot] [f2fs?] WARNING in f2fs_unlink syzbot
2024-11-24 1:40 ` syzbot
2024-11-25 11:16 ` [f2fs-dev] [PATCH] f2fs: Add check for deleted inode Chao Yu via Linux-f2fs-devel
2024-11-25 11:16 ` Chao Yu
2024-11-25 17:56 ` [f2fs-dev] " Leo Stone
2024-11-25 17:56 ` Leo Stone
2024-11-29 2:01 ` Chao Yu via Linux-f2fs-devel [this message]
2024-11-29 2:01 ` Chao Yu
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=63a65be2-7ad9-4d65-8c3e-d872f83c011d@kernel.org \
--to=linux-f2fs-devel@lists.sourceforge.net \
--cc=chao@kernel.org \
--cc=jaegeuk@kernel.org \
--cc=leocstone@gmail.com \
--cc=linux-kernel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.