From: sashiko-bot@kernel.org
To: "Jiaming Zhang" <r772577952@gmail.com>, linux-ext4@vger.kernel.org
Cc: tytso@mit.edu
Subject: Re: [PATCH v2] ext4: clear in-inode xattr space before adding the first xattr
Date: Wed, 21 Oct 2026 09:06:44 +0000 [thread overview]
Message-ID: <sashiko-outbox-180005@kernel.org> (raw)
In-Reply-To: <20261021085635.3633692-1-r772577952@gmail.com>
> An inode can hold extended attributes in the space that follows its extra
> fields, whose size is given by i_extra_isize. When ext4 loads an inode,
> ext4_iget_extra_inode() validates that space only if it starts with the
> xattr magic, and only then sets EXT4_STATE_XATTR. Without the magic, the
> space is treated as empty and is not checked.
>
> ext4_xattr_ibody_set() passes the space to ext4_xattr_set_entry() whether
> or not EXT4_STATE_XATTR is set. ext4_xattr_set_entry() walks the entries
> there to find min_offs, the lowest value offset. That offset decides
> whether the new value fits and where the value is copied:
>
> free = min_offs - ((void *)last - s->base) - sizeof(__u32);
> ...
> void *val = s->base + min_offs - new_size;
>
> [ ... ]
> Fixes: ac27a0ec112a ("[PATCH] ext4: initial copy of files from ext3")
> Closes: https://lore.kernel.org/lkml/CANypQFZzxTAH=4QRRDoqH6VAw1daAq88NDWiQKoM7QTOnP40sg@mail.gmail.com/
> Cc: stable@vger.kernel.org
> Assisted-by: Claude Code:claude-opus-5-5
> Signed-off-by: Jiaming Zhang <r772577952@gmail.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261021085635.3633692-1-r772577952@gmail.com?part=1
next prev parent reply other threads:[~2026-10-21 9:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-21 8:56 [PATCH v2] ext4: clear in-inode xattr space before adding the first xattr Jiaming Zhang
2026-10-21 9:06 ` sashiko-bot [this message]
2026-10-21 15:12 ` Jan Kara
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=sashiko-outbox-180005@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-ext4@vger.kernel.org \
--cc=r772577952@gmail.com \
--cc=sashiko-reviews@lists.linux.dev \
--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