From: Ritesh Harjani <ritesh.list@gmail.com>
To: Baokun Li <libaokun1@huawei.com>
Cc: linux-ext4@vger.kernel.org, tytso@mit.edu,
adilger.kernel@dilger.ca, jack@suse.cz, lczerner@redhat.com,
enwlinux@gmail.com, linux-kernel@vger.kernel.org,
yi.zhang@huawei.com, yebin10@huawei.com, yukuai3@huawei.com
Subject: Re: [PATCH v3 4/4] ext4: correct the misjudgment in ext4_iget_extra_inode
Date: Thu, 16 Jun 2022 09:38:29 +0530 [thread overview]
Message-ID: <20220616040829.kb66mg2dnitnlkau@riteshh-domain> (raw)
In-Reply-To: <20220616021358.2504451-5-libaokun1@huawei.com>
On 22/06/16 10:13AM, Baokun Li wrote:
> Use the EXT4_INODE_HAS_XATTR_SPACE macro to more accurately
> determine whether the inode have xattr space.
Right. I also noticed there are few places in fs/ext4/xattr.c
and in fs/ext4/inline.c where sizeof(__u32) is being used which (I think)
should be EXT4_XATTR_PAD. But that need not be part of this patch series.
Looks good to me. Feel free to add -
Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
>
> Signed-off-by: Baokun Li <libaokun1@huawei.com>
> ---
> fs/ext4/inode.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
> index 53877ffe3c41..ae463cd9b405 100644
> --- a/fs/ext4/inode.c
> +++ b/fs/ext4/inode.c
> @@ -4687,8 +4687,7 @@ static inline int ext4_iget_extra_inode(struct inode *inode,
> __le32 *magic = (void *)raw_inode +
> EXT4_GOOD_OLD_INODE_SIZE + ei->i_extra_isize;
>
> - if (EXT4_GOOD_OLD_INODE_SIZE + ei->i_extra_isize + sizeof(__le32) <=
> - EXT4_INODE_SIZE(inode->i_sb) &&
> + if (EXT4_INODE_HAS_XATTR_SPACE(inode) &&
> *magic == cpu_to_le32(EXT4_XATTR_MAGIC)) {
> ext4_set_inode_state(inode, EXT4_STATE_XATTR);
> return ext4_find_inline_data_nolock(inode);
> --
> 2.31.1
>
next prev parent reply other threads:[~2022-06-16 4:08 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-16 2:13 [PATCH v3 0/4] ext4: fix use-after-free in ext4_xattr_set_entry Baokun Li
2022-06-16 2:13 ` [PATCH v3 1/4] ext4: add EXT4_INODE_HAS_XATTR_SPACE macro in xattr.h Baokun Li
2022-06-16 4:00 ` Ritesh Harjani
2022-06-16 10:06 ` Jan Kara
2022-06-16 2:13 ` [PATCH v3 2/4] ext4: fix use-after-free in ext4_xattr_set_entry Baokun Li
2022-06-16 4:02 ` Ritesh Harjani
2022-06-16 10:07 ` Jan Kara
2022-06-16 2:13 ` [PATCH v3 3/4] ext4: correct max_inline_xattr_value_size computing Baokun Li
2022-06-16 4:04 ` Ritesh Harjani
2022-06-16 10:08 ` Jan Kara
2022-06-16 2:13 ` [PATCH v3 4/4] ext4: correct the misjudgment in ext4_iget_extra_inode Baokun Li
2022-06-16 4:08 ` Ritesh Harjani [this message]
2022-06-16 10:09 ` Jan Kara
2022-07-14 15:00 ` [PATCH v3 0/4] ext4: fix use-after-free in ext4_xattr_set_entry Theodore Ts'o
2022-07-22 13:58 ` 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=20220616040829.kb66mg2dnitnlkau@riteshh-domain \
--to=ritesh.list@gmail.com \
--cc=adilger.kernel@dilger.ca \
--cc=enwlinux@gmail.com \
--cc=jack@suse.cz \
--cc=lczerner@redhat.com \
--cc=libaokun1@huawei.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tytso@mit.edu \
--cc=yebin10@huawei.com \
--cc=yi.zhang@huawei.com \
--cc=yukuai3@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