From: Chao Yu <chao@kernel.org>
To: Rochan Avlur <rochan.avlur@gmail.com>, Jaegeuk Kim <jaegeuk@kernel.org>
Cc: chao@kernel.org, Christian Brauner <brauner@kernel.org>,
linux-f2fs-devel@lists.sourceforge.net,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH] f2fs: use the mount idmap for the owner check in f2fs_xattr_advise_set()
Date: Mon, 3 Aug 2026 16:40:57 +0800 [thread overview]
Message-ID: <0b6c89a7-0c09-4244-8238-be12862328a3@kernel.org> (raw)
In-Reply-To: <20260729041656.51967-1-rochan.avlur@gmail.com>
On 7/29/26 12:16, Rochan Avlur wrote:
> f2fs_xattr_advise_set() calls inode_owner_or_capable() with
> &nop_mnt_idmap before allowing the advise xattr to be set, instead of
> the idmap that was passed into the handler.
>
> Since f2fs supports idmapped mounts, this compares the caller's fsuid
> against the unmapped on-disk owner rather than the mapped owner; resulting
> in the actual owner to be wrongly denied with -EPERM. Use the idmap
> argument that was already passed to the xattr handler instead.
>
> Fixes: 984fc4e76d63 ("f2fs: support idmapped mounts")
> Cc: stable@vger.kernel.org
> Signed-off-by: Rochan Avlur <rochan.avlur@gmail.com>
Thanks for the patch.
I notice there is already a patch:
https://lore.kernel.org/linux-f2fs-devel/20260716025908.608098-1-zhanxusheng@xiaomi.com
Thanks,
> ---
> fs/f2fs/xattr.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/f2fs/xattr.c b/fs/f2fs/xattr.c
> index 610d5810074d..281e2fd6c778 100644
> --- a/fs/f2fs/xattr.c
> +++ b/fs/f2fs/xattr.c
> @@ -118,7 +118,7 @@ static int f2fs_xattr_advise_set(const struct xattr_handler *handler,
> unsigned char old_advise = F2FS_I(inode)->i_advise;
> unsigned char new_advise;
>
> - if (!inode_owner_or_capable(&nop_mnt_idmap, inode))
> + if (!inode_owner_or_capable(idmap, inode))
> return -EPERM;
> if (value == NULL)
> return -EINVAL;
next prev parent reply other threads:[~2026-08-03 8:41 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-29 4:16 Rochan Avlur
2026-07-30 10:23 ` Christian Brauner
2026-08-03 23:33 ` [f2fs-dev] " Jaegeuk Kim
2026-08-03 8:40 ` Chao Yu [this message]
2026-08-03 13:43 ` Rochan Avlur
2026-08-05 21:20 ` [f2fs-dev] " patchwork-bot+f2fs
-- strict thread matches above, loose matches on Subject: below --
2026-07-16 2:59 Zhan Xusheng
2026-08-03 6:34 ` 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=0b6c89a7-0c09-4244-8238-be12862328a3@kernel.org \
--to=chao@kernel.org \
--cc=brauner@kernel.org \
--cc=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rochan.avlur@gmail.com \
--cc=stable@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®