From nobody Fri Sep 12 00:27:20 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A8A0BC636D4 for ; Wed, 15 Feb 2023 13:35:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229516AbjBONfF (ORCPT ); Wed, 15 Feb 2023 08:35:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231687AbjBONe6 (ORCPT ); Wed, 15 Feb 2023 08:34:58 -0500 X-Greylist: delayed 85 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Wed, 15 Feb 2023 05:34:56 PST Received: from relayaws-01.paragon-software.com (relayaws-01.paragon-software.com [35.157.23.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A06B23A92; Wed, 15 Feb 2023 05:34:56 -0800 (PST) Received: from dlg2.mail.paragon-software.com (vdlg-exch-02.paragon-software.com [172.30.1.105]) by relayaws-01.paragon-software.com (Postfix) with ESMTPS id 565C72147; Wed, 15 Feb 2023 13:30:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paragon-software.com; s=mail; t=1676467844; bh=cRbFAcsOeNInjJ/7aNI+flXOVb7jAlQp1y5wkLFBBeE=; h=Date:Subject:From:To:CC:References:In-Reply-To; b=SM6lEK6RBNg0roCsqmraz/E86Mlrmp5zFPFxVPk0W/vslDtU9jZTljAGe7xmvMu+5 v1G2ot0abrwTUAkmqgKxwJFZ/H1/WR0aoseMoZ5BaG9ihYD3xc6ZTJHmVmadoXf2yf 7PEKU5DxGSPdCOEUuuyZ2jkUn4eeuqi7e4njZBeA= Received: from [192.168.211.36] (192.168.211.36) by vdlg-exch-02.paragon-software.com (172.30.1.105) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.7; Wed, 15 Feb 2023 16:34:54 +0300 Message-ID: <331371f5-6c34-65aa-f81e-c27e428b9d4e@paragon-software.com> Date: Wed, 15 Feb 2023 17:34:53 +0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.2 Subject: [PATCH 02/11] fs/ntfs3: Remove noacsrules Content-Language: en-US From: Konstantin Komarov To: CC: Linux Kernel Mailing List , References: In-Reply-To: Content-Type: text/plain; charset="utf-8"; format="flowed" Content-Transfer-Encoding: quoted-printable X-Originating-IP: [192.168.211.36] X-ClientProxiedBy: vdlg-exch-02.paragon-software.com (172.30.1.105) To vdlg-exch-02.paragon-software.com (172.30.1.105) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently, this option does not work properly. Its use leads to unstable=20 results. If we figure out how to implement it without errors, we will add it later. Signed-off-by: Konstantin Komarov --- =C2=A0Documentation/filesystems/ntfs3.rst | 11 ----------- =C2=A0fs/ntfs3/file.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | 11 = ----------- =C2=A0fs/ntfs3/inode.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0 1 - =C2=A0fs/ntfs3/namei.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0 1 - =C2=A0fs/ntfs3/ntfs_fs.h=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0 3 --- =C2=A0fs/ntfs3/super.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0 9 += -------- =C2=A0fs/ntfs3/xattr.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | 14 ------= -------- =C2=A07 files changed, 1 insertion(+), 49 deletions(-) diff --git a/Documentation/filesystems/ntfs3.rst=20 b/Documentation/filesystems/ntfs3.rst index 5aa102bd72c2..f0cf05cad2ba 100644 --- a/Documentation/filesystems/ntfs3.rst +++ b/Documentation/filesystems/ntfs3.rst @@ -61,17 +61,6 @@ this table marked with no it means default is without=20 **no**. =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 directories, fmask applies only= to files and dmask only to=20 directories. =C2=A0=C2=A0=C2=A0 * - fmask=3D -=C2=A0=C2=A0 * - noacsrules -=C2=A0=C2=A0=C2=A0=C2=A0 - "No access rules" mount option sets access righ= ts for=20 files/folders to -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 777 and owner/group to root. This mou= nt option absorbs all other -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 permissions. - -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 - Permissions change for files/folder= s will be reported as=20 successful, -=C2=A0=C2=A0=C2=A0 =C2=A0but they will remain 777. - -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 - Owner/group change will be reported= as successful, butthey=20 will stay -=C2=A0=C2=A0=C2=A0 =C2=A0as root. - =C2=A0=C2=A0=C2=A0 * - nohidden =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 - Files with the Windows-specific HIDDEN (F= ILE_ATTRIBUTE_HIDDEN)=20 attribute =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 will not be shown under Linux. diff --git a/fs/ntfs3/file.c b/fs/ntfs3/file.c index d37df7376543..9cef189fc0c5 100644 --- a/fs/ntfs3/file.c +++ b/fs/ntfs3/file.c @@ -654,22 +654,12 @@ static long ntfs_fallocate(struct file *file, int=20 mode, loff_t vbo, loff_t len) =C2=A0int ntfs3_setattr(struct user_namespace *mnt_userns, struct dentry=20 *dentry, =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0 struct iattr *attr) =C2=A0{ -=C2=A0=C2=A0=C2=A0 struct super_block *sb =3D dentry->d_sb; -=C2=A0=C2=A0=C2=A0 struct ntfs_sb_info *sbi =3D sb->s_fs_info; =C2=A0=C2=A0=C2=A0=C2=A0 struct inode *inode =3D d_inode(dentry); =C2=A0=C2=A0=C2=A0=C2=A0 struct ntfs_inode *ni =3D ntfs_i(inode); =C2=A0=C2=A0=C2=A0=C2=A0 u32 ia_valid =3D attr->ia_valid; =C2=A0=C2=A0=C2=A0=C2=A0 umode_t mode =3D inode->i_mode; =C2=A0=C2=A0=C2=A0=C2=A0 int err; -=C2=A0=C2=A0=C2=A0 if (sbi->options->noacsrules) { -=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 /* "No access rules" - Force any cha= nges of time etc. */ -=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 attr->ia_valid |=3D ATTR_FORCE; -=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 /* and disable for editing some attr= ibutes. */ -=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 attr->ia_valid &=3D ~(ATTR_UID | ATT= R_GID | ATTR_MODE); -=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 ia_valid =3D attr->ia_valid; -=C2=A0=C2=A0=C2=A0 } - =C2=A0=C2=A0=C2=A0=C2=A0 err =3D setattr_prepare(mnt_userns, dentry, attr); =C2=A0=C2=A0=C2=A0=C2=A0 if (err) =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 goto out; @@ -1153,7 +1143,6 @@ const struct inode_operations=20 ntfs_file_inode_operations =3D { =C2=A0=C2=A0=C2=A0=C2=A0 .getattr=C2=A0=C2=A0=C2=A0 =3D ntfs_getattr, =C2=A0=C2=A0=C2=A0=C2=A0 .setattr=C2=A0=C2=A0=C2=A0 =3D ntfs3_setattr, =C2=A0=C2=A0=C2=A0=C2=A0 .listxattr=C2=A0=C2=A0=C2=A0 =3D ntfs_listxattr, -=C2=A0=C2=A0=C2=A0 .permission=C2=A0=C2=A0=C2=A0 =3D ntfs_permission, =C2=A0=C2=A0=C2=A0=C2=A0 .get_inode_acl=C2=A0=C2=A0=C2=A0 =3D ntfs_get_acl, =C2=A0=C2=A0=C2=A0=C2=A0 .set_acl=C2=A0=C2=A0=C2=A0 =3D ntfs_set_acl, =C2=A0=C2=A0=C2=A0=C2=A0 .fiemap=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =3D = ntfs_fiemap, diff --git a/fs/ntfs3/inode.c b/fs/ntfs3/inode.c index 5e06299591ed..51e342ad79fd 100644 --- a/fs/ntfs3/inode.c +++ b/fs/ntfs3/inode.c @@ -2070,7 +2070,6 @@ const struct inode_operations=20 ntfs_link_inode_operations =3D { =C2=A0=C2=A0=C2=A0=C2=A0 .get_link=C2=A0=C2=A0=C2=A0 =3D ntfs_get_link, =C2=A0=C2=A0=C2=A0=C2=A0 .setattr=C2=A0=C2=A0=C2=A0 =3D ntfs3_setattr, =C2=A0=C2=A0=C2=A0=C2=A0 .listxattr=C2=A0=C2=A0=C2=A0 =3D ntfs_listxattr, -=C2=A0=C2=A0=C2=A0 .permission=C2=A0=C2=A0=C2=A0 =3D ntfs_permission, =C2=A0}; =C2=A0const struct address_space_operations ntfs_aops =3D { diff --git a/fs/ntfs3/namei.c b/fs/ntfs3/namei.c index 53ddea219e37..5d5fe2f1f77c 100644 --- a/fs/ntfs3/namei.c +++ b/fs/ntfs3/namei.c @@ -607,7 +607,6 @@ const struct inode_operations=20 ntfs_dir_inode_operations =3D { =C2=A0=C2=A0=C2=A0=C2=A0 .rmdir=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =3D n= tfs_rmdir, =C2=A0=C2=A0=C2=A0=C2=A0 .mknod=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =3D n= tfs_mknod, =C2=A0=C2=A0=C2=A0=C2=A0 .rename=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =3D = ntfs_rename, -=C2=A0=C2=A0=C2=A0 .permission=C2=A0=C2=A0=C2=A0 =3D ntfs_permission, =C2=A0=C2=A0=C2=A0=C2=A0 .get_inode_acl=C2=A0=C2=A0=C2=A0 =3D ntfs_get_acl, =C2=A0=C2=A0=C2=A0=C2=A0 .set_acl=C2=A0=C2=A0=C2=A0 =3D ntfs_set_acl, =C2=A0=C2=A0=C2=A0=C2=A0 .setattr=C2=A0=C2=A0=C2=A0 =3D ntfs3_setattr, diff --git a/fs/ntfs3/ntfs_fs.h b/fs/ntfs3/ntfs_fs.h index 2050eb3f6a5a..556b76f526cb 100644 --- a/fs/ntfs3/ntfs_fs.h +++ b/fs/ntfs3/ntfs_fs.h @@ -100,7 +100,6 @@ struct ntfs_mount_options { =C2=A0=C2=A0=C2=A0=C2=A0 unsigned hide_dot_files : 1; /* Set hidden flag o= n dot files. */ =C2=A0=C2=A0=C2=A0=C2=A0 unsigned windows_names : 1; /* Disallow names for= bidden by Windows. */ =C2=A0=C2=A0=C2=A0=C2=A0 unsigned force : 1; /* RW mount dirty volume. */ -=C2=A0=C2=A0=C2=A0 unsigned noacsrules : 1; /* Exclude acs rules. */ =C2=A0=C2=A0=C2=A0=C2=A0 unsigned prealloc : 1; /* Preallocate space when = file is growing. */ =C2=A0=C2=A0=C2=A0=C2=A0 unsigned nocase : 1; /* case insensitive. */ =C2=A0}; @@ -868,8 +867,6 @@ int ntfs_init_acl(struct user_namespace *mnt_userns,=20 struct inode *inode, =C2=A0#endif =C2=A0int ntfs_acl_chmod(struct user_namespace *mnt_userns, struct dentry=20 *dentry); -int ntfs_permission(struct user_namespace *mnt_userns, struct inode *inode, -=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 int mask); =C2=A0ssize_t ntfs_listxattr(struct dentry *dentry, char *buffer, size_t s= ize); =C2=A0extern const struct xattr_handler *ntfs_xattr_handlers[]; diff --git a/fs/ntfs3/super.c b/fs/ntfs3/super.c index 19d0889b131f..10c019ef7da3 100644 --- a/fs/ntfs3/super.c +++ b/fs/ntfs3/super.c @@ -253,7 +253,6 @@ enum Opt { =C2=A0=C2=A0=C2=A0=C2=A0 Opt_acl, =C2=A0=C2=A0=C2=A0=C2=A0 Opt_iocharset, =C2=A0=C2=A0=C2=A0=C2=A0 Opt_prealloc, -=C2=A0=C2=A0=C2=A0 Opt_noacsrules, =C2=A0=C2=A0=C2=A0=C2=A0 Opt_nocase, =C2=A0=C2=A0=C2=A0=C2=A0 Opt_err, =C2=A0}; @@ -274,7 +273,6 @@ static const struct fs_parameter_spec=20 ntfs_fs_parameters[] =3D { =C2=A0=C2=A0=C2=A0=C2=A0 fsparam_flag_no("acl",=C2=A0=C2=A0=C2=A0 =C2=A0= =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 Opt_acl), =C2=A0=C2=A0=C2=A0=C2=A0 fsparam_flag_no("showmeta",=C2=A0=C2=A0=C2=A0 =C2= =A0=C2=A0=C2=A0 Opt_showmeta), =C2=A0=C2=A0=C2=A0=C2=A0 fsparam_flag_no("prealloc",=C2=A0=C2=A0=C2=A0 =C2= =A0=C2=A0=C2=A0 Opt_prealloc), -=C2=A0=C2=A0=C2=A0 fsparam_flag_no("acsrules",=C2=A0=C2=A0=C2=A0 =C2=A0=C2= =A0=C2=A0 Opt_noacsrules), =C2=A0=C2=A0=C2=A0=C2=A0 fsparam_flag_no("nocase",=C2=A0=C2=A0=C2=A0 =C2= =A0=C2=A0=C2=A0 Opt_nocase), =C2=A0=C2=A0=C2=A0=C2=A0 fsparam_string("iocharset",=C2=A0=C2=A0=C2=A0 =C2= =A0=C2=A0=C2=A0 Opt_iocharset), =C2=A0=C2=A0=C2=A0=C2=A0 {} @@ -387,9 +385,6 @@ static int ntfs_fs_parse_param(struct fs_context *fc, =C2=A0=C2=A0=C2=A0=C2=A0 case Opt_prealloc: =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 opts->prealloc =3D result.nega= ted ? 0 : 1; =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 break; -=C2=A0=C2=A0=C2=A0 case Opt_noacsrules: -=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 opts->noacsrules =3D result.negated = ? 1 : 0; -=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 break; =C2=A0=C2=A0=C2=A0=C2=A0 case Opt_nocase: =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 opts->nocase =3D result.negate= d ? 1 : 0; =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 break; @@ -572,8 +567,6 @@ static int ntfs_show_options(struct seq_file *m,=20 struct dentry *root) =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 seq_puts(m, ",hide_dot_files"); =C2=A0=C2=A0=C2=A0=C2=A0 if (opts->force) =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 seq_puts(m, ",force"); -=C2=A0=C2=A0=C2=A0 if (opts->noacsrules) -=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 seq_puts(m, ",noacsrules"); =C2=A0=C2=A0=C2=A0=C2=A0 if (opts->prealloc) =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 seq_puts(m, ",prealloc"); =C2=A0=C2=A0=C2=A0=C2=A0 if (sb->s_flags & SB_POSIXACL) @@ -791,7 +784,7 @@ static int ntfs_init_from_boot(struct super_block=20 *sb, u32 sector_size, =C2=A0=C2=A0=C2=A0=C2=A0 if (boot_sector_size !=3D sector_size) { =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 ntfs_warn( =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 sb, -=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 "Different NTFS' = sector size (%u) and media sector size (%u)", +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 "Different NTFS s= ector size (%u) and media sector size (%u)", =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 boot_sector= _size, sector_size); =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 dev_size +=3D sector_size - 1; =C2=A0=C2=A0=C2=A0=C2=A0 } diff --git a/fs/ntfs3/xattr.c b/fs/ntfs3/xattr.c index 3fa48c8f68d9..c42fbc56eb39 100644 --- a/fs/ntfs3/xattr.c +++ b/fs/ntfs3/xattr.c @@ -711,20 +711,6 @@ int ntfs_acl_chmod(struct user_namespace=20 *mnt_userns, struct dentry *dentry) =C2=A0=C2=A0=C2=A0=C2=A0 return posix_acl_chmod(mnt_userns, dentry, inode-= >i_mode); =C2=A0} -/* - * ntfs_permission - inode_operations::permission - */ -int ntfs_permission(struct user_namespace *mnt_userns, struct inode *inode, -=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 int mask) -{ -=C2=A0=C2=A0=C2=A0 if (ntfs_sb(inode->i_sb)->options->noacsrules) { -=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 /* "No access rules" mode - Allow al= l changes. */ -=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 return 0; -=C2=A0=C2=A0=C2=A0 } - -=C2=A0=C2=A0=C2=A0 return generic_permission(mnt_userns, inode, mask); -} - =C2=A0/* =C2=A0 * ntfs_listxattr - inode_operations::listxattr =C2=A0 */ --=20 2.34.1