diff options
Diffstat (limited to 'kernel-5.12-backport.patch')
-rw-r--r-- | kernel-5.12-backport.patch | 108 |
1 files changed, 89 insertions, 19 deletions
diff --git a/kernel-5.12-backport.patch b/kernel-5.12-backport.patch index f7c4d171b710..7d268f207dcf 100644 --- a/kernel-5.12-backport.patch +++ b/kernel-5.12-backport.patch @@ -239,7 +239,7 @@ --- a/xattr.c +++ b/xattr.c -@@ -476,7 +476,7 @@ +@@ -478,7 +478,7 @@ } #ifdef CONFIG_NTFS3_FS_POSIX_ACL @@ -248,7 +248,7 @@ struct inode *inode, int type, int locked) { -@@ -512,7 +512,7 @@ +@@ -514,7 +514,7 @@ /* Translate extended attribute to acl. */ if (err >= 0) { @@ -257,7 +257,7 @@ } else if (err == -ENODATA) { acl = NULL; } else { -@@ -533,10 +533,10 @@ +@@ -535,10 +535,10 @@ struct posix_acl *ntfs_get_acl(struct inode *inode, int type) { /* TODO: init_user_ns? */ @@ -270,7 +270,7 @@ struct inode *inode, struct posix_acl *acl, int type) { -@@ -554,7 +554,7 @@ +@@ -556,7 +556,7 @@ if (acl) { umode_t mode = inode->i_mode; @@ -279,7 +279,7 @@ &acl); if (err) goto out; -@@ -589,7 +589,7 @@ +@@ -591,7 +591,7 @@ value = kmalloc(size, GFP_NOFS); if (!value) return -ENOMEM; @@ -288,7 +288,7 @@ if (err < 0) goto out; flags = 0; -@@ -610,10 +610,10 @@ +@@ -612,13 +612,13 @@ /* * ntfs_set_acl - inode_operations::set_acl */ @@ -300,8 +300,65 @@ + return ntfs_set_acl_ex(inode, acl, type); } - /* -@@ -621,7 +621,7 @@ +-static int ntfs_xattr_get_acl(struct user_namespace *mnt_userns, ++static int ntfs_xattr_get_acl( + struct inode *inode, int type, void *buffer, + size_t size) + { +@@ -630,20 +630,20 @@ + return -EOPNOTSUPP; + } + +- acl = ntfs_get_acl(inode, type, false); ++ acl = ntfs_get_acl(inode, type); + if (IS_ERR(acl)) + return PTR_ERR(acl); + + if (!acl) + return -ENODATA; + +- err = posix_acl_to_xattr(mnt_userns, acl, buffer, size); ++ err = posix_acl_to_xattr(&init_user_ns, acl, buffer, size); + posix_acl_release(acl); + + return err; + } + +-static int ntfs_xattr_set_acl(struct user_namespace *mnt_userns, ++static int ntfs_xattr_set_acl( + struct inode *inode, int type, const void *value, + size_t size) + { +@@ -655,24 +655,24 @@ + return -EOPNOTSUPP; + } + +- if (!inode_owner_or_capable(mnt_userns, inode)) ++ if (!inode_owner_or_capable(inode)) + return -EPERM; + + if (!value) { + acl = NULL; + } else { +- acl = posix_acl_from_xattr(mnt_userns, value, size); ++ acl = posix_acl_from_xattr(&init_user_ns, value, size); + if (IS_ERR(acl)) + return PTR_ERR(acl); + + if (acl) { +- err = posix_acl_valid(mnt_userns, acl); ++ err = posix_acl_valid(&init_user_ns, acl); + if (err) + goto release_and_out; + } + } + +- err = ntfs_set_acl(mnt_userns, inode, acl, type); ++ err = ntfs_set_acl(inode, acl, type); + + release_and_out: + posix_acl_release(acl); +@@ -684,7 +684,7 @@ * * Called from ntfs_create_inode(). */ @@ -310,7 +367,7 @@ struct inode *dir) { struct posix_acl *default_acl, *acl; -@@ -632,18 +632,18 @@ +@@ -695,7 +695,7 @@ return err; if (default_acl) { @@ -319,10 +376,7 @@ ACL_TYPE_DEFAULT); posix_acl_release(default_acl); } else { - inode->i_default_acl = NULL; - } - - if (!acl) +@@ -706,7 +706,7 @@ inode->i_acl = NULL; else { if (!err) @@ -331,7 +385,7 @@ ACL_TYPE_ACCESS); posix_acl_release(acl); } -@@ -655,7 +655,7 @@ +@@ -718,7 +718,7 @@ /* * ntfs_acl_chmod - Helper for ntfs3_setattr(). */ @@ -340,7 +394,7 @@ { struct super_block *sb = inode->i_sb; -@@ -665,7 +665,7 @@ +@@ -728,13 +728,13 @@ if (S_ISLNK(inode->i_mode)) return -EOPNOTSUPP; @@ -349,8 +403,6 @@ } /* -@@ -671,7 +671,7 @@ - /* * ntfs_permission - inode_operations::permission */ -int ntfs_permission(struct user_namespace *mnt_userns, struct inode *inode, @@ -358,7 +410,7 @@ int mask) { if (ntfs_sb(inode->i_sb)->options->noacsrules) { -@@ -679,7 +679,7 @@ +@@ -742,7 +742,7 @@ return 0; } @@ -367,7 +419,16 @@ } /* -@@ -793,7 +793,7 @@ +@@ -854,7 +854,7 @@ + sizeof(XATTR_NAME_POSIX_ACL_DEFAULT)))) { + /* TODO: init_user_ns? */ + err = ntfs_xattr_get_acl( +- &init_user_ns, inode, ++ inode, + name_len == sizeof(XATTR_NAME_POSIX_ACL_ACCESS) - 1 + ? ACL_TYPE_ACCESS + : ACL_TYPE_DEFAULT, +@@ -873,7 +873,7 @@ * ntfs_setxattr - inode_operations::setxattr */ static noinline int ntfs_setxattr(const struct xattr_handler *handler, @@ -376,3 +437,12 @@ struct dentry *de, struct inode *inode, const char *name, const void *value, size_t size, int flags) +@@ -982,7 +982,7 @@ + !memcmp(name, XATTR_NAME_POSIX_ACL_DEFAULT, + sizeof(XATTR_NAME_POSIX_ACL_DEFAULT)))) { + err = ntfs_xattr_set_acl( +- mnt_userns, inode, ++ inode, + name_len == sizeof(XATTR_NAME_POSIX_ACL_ACCESS) - 1 + ? ACL_TYPE_ACCESS + : ACL_TYPE_DEFAULT, |