From: Jan Kara <jack@suse.cz>
To: Baokun Li <libaokun1@huawei.com>
Cc: linux-ext4@vger.kernel.org, tytso@mit.edu,
adilger.kernel@dilger.ca, jack@suse.cz, ritesh.list@gmail.com,
lczerner@redhat.com, enwlinux@gmail.com,
linux-kernel@vger.kernel.org, yi.zhang@huawei.com,
yebin10@huawei.com, yukuai3@huawei.com
Subject: Re: [PATCH v2 1/4] ext4: add EXT4_INODE_HAVE_XATTR_SPACE macro in xattr.h
Date: Wed, 15 Jun 2022 14:46:33 +0200 [thread overview]
Message-ID: <20220615124633.6uddzv5msnmwi7c4@quack3.lan> (raw)
In-Reply-To: <20220615040630.808783-2-libaokun1@huawei.com>
On Wed 15-06-22 12:06:27, Baokun Li wrote:
> When adding an xattr to an inode, we must ensure that the inode_size is
> not less than EXT4_GOOD_OLD_INODE_SIZE + extra_isize + pad. Otherwise,
> the end position may be greater than the start position, resulting in UAF.
>
> Signed-off-by: Baokun Li <libaokun1@huawei.com>
...
> +/*
> + * If we want to add an xattr to the inode, we should make sure that
> + * i_extra_isize is not 0 and that the inode size is not less than
> + * EXT4_GOOD_OLD_INODE_SIZE + extra_isize + pad.
> + * EXT4_GOOD_OLD_INODE_SIZE extra_isize header entry pad data
> + * |--------------------------|------------|------|---------|---|-------|
> + */
> +#define EXT4_INODE_HAVE_XATTR_SPACE(inode) \
Gramatically correct would be EXT4_INODE_**HAS**_XATTR_SPACE and I'd be for
using that. Otherwise the whole series looks good so feel free to add:
Reviewed-by: Jan Kara <jack@suse.cz>
Honza
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
next prev parent reply other threads:[~2022-06-15 12:47 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-15 4:06 [PATCH v2 0/4] ext4: fix use-after-free in ext4_xattr_set_entry Baokun Li
2022-06-15 4:06 ` [PATCH v2 1/4] ext4: add EXT4_INODE_HAVE_XATTR_SPACE macro in xattr.h Baokun Li
2022-06-15 12:46 ` Jan Kara [this message]
2022-06-16 1:06 ` Baokun Li
2022-06-15 4:06 ` [PATCH v2 2/4] ext4: fix use-after-free in ext4_xattr_set_entry Baokun Li
2022-06-15 4:06 ` [PATCH v2 3/4] ext4: correct max_inline_xattr_value_size computing Baokun Li
2022-06-15 4:06 ` [PATCH v2 4/4] ext4: correct the misjudgment in ext4_iget_extra_inode Baokun Li
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=20220615124633.6uddzv5msnmwi7c4@quack3.lan \
--to=jack@suse.cz \
--cc=adilger.kernel@dilger.ca \
--cc=enwlinux@gmail.com \
--cc=lczerner@redhat.com \
--cc=libaokun1@huawei.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ritesh.list@gmail.com \
--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