mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
To: Hongling Zeng <zenghongling@kylinos.cn>
Cc: <ntfs3@lists.linux.dev>, <linux-kernel@vger.kernel.org>,
	<zhongling0719@126.com>, <stable@vger.kernel.org>
Subject: Re: [PATCH] ntfs3: add permission checks for NTFS system attributes
Date: Wed, 18 Nov 2026 17:47:04 +0100	[thread overview]
Message-ID: <869e98bb-1650-4b7e-9bd1-f7d60fac0a78@paragon-software.com> (raw)
In-Reply-To: <20260820085526.169144-1-zenghongling@kylinos.cn>

On 8/20/26 10:55, Hongling Zeng wrote:

> ntfs3_setxattr() allows system.dos_attrib, system.ntfs_attrib, and
> system.ntfs_attrib_be to update NTFS file attributes without permission
> checks. These attributes affect the inode mode because the READONLY flag
> is mapped to write permission bits, allowing unprivileged users to bypass
> file access controls.
>
> system.ntfs_security allows modifying NTFS security descriptors which
> control access control. Similar to POSIX ACLs where file owners can
> modify access permissions, require inode owner or CAP_FOWNER for these
> NTFS system attributes.
>
> Fixes: 4534a70b7056 ("fs/ntfs3: Add headers and misc files")
> Cc: stable@vger.kernel.org
> Signed-off-by: Hongling Zeng <zenghongling@kylinos.cn>
> ---
>   fs/ntfs3/xattr.c | 16 ++++++++++++++++
>   1 file changed, 16 insertions(+)
>
> diff --git a/fs/ntfs3/xattr.c b/fs/ntfs3/xattr.c
> index 7a81369a1173..4e41aca0d5c7 100644
> --- a/fs/ntfs3/xattr.c
> +++ b/fs/ntfs3/xattr.c
> @@ -868,6 +868,22 @@ static noinline int ntfs_setxattr(const struct xattr_handler *handler,
>   	struct ntfs_inode *ni = ntfs_i(inode);
>   	enum FILE_ATTRIBUTE new_fa;
>   
> +	/*
> +	 * system.dos_attrib and system.ntfs_attrib affect file permissions
> +	 * because the READONLY flag is mapped to write permission bits.
> +	 * system.ntfs_security controls NTFS security descriptors.
> +	 *
> +	 * Require the caller to own the inode or hold CAP_FOWNER before allowing
> +	 * these NTFS system attributes to be changed.
> +	 */
> +	if (!strcmp(name, SYSTEM_DOS_ATTRIB) ||
> +	    !strcmp(name, SYSTEM_NTFS_ATTRIB) ||
> +	    !strcmp(name, SYSTEM_NTFS_ATTRIB_BE) ||
> +	    !strcmp(name, SYSTEM_NTFS_SECURITY)) {
> +		if (!inode_owner_or_capable(idmap, inode))
> +			return -EPERM;
> +	}
> +
>   	/* Dispatch request. */
>   	if (!strcmp(name, SYSTEM_DOS_ATTRIB)) {
>   		if (sizeof(u8) != size)

Hello,

Your patch is applied, thank you.

Regards,
Konstantin


      reply	other threads:[~2026-11-18 16:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-20  8:55 Hongling Zeng
2026-11-18 16:47 ` Konstantin Komarov [this message]

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=869e98bb-1650-4b7e-9bd1-f7d60fac0a78@paragon-software.com \
    --to=almaz.alexandrovich@paragon-software.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ntfs3@lists.linux.dev \
    --cc=stable@vger.kernel.org \
    --cc=zenghongling@kylinos.cn \
    --cc=zhongling0719@126.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

all inboxes | Powered by JetHome®