summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYurii Zubrytskyi <zyy@google.com>2021-02-18 09:22:52 -0800
committerPaul Lawrence <paullawrence@google.com>2021-02-22 18:50:56 +0000
commit5bf1af0c987ac1394ccd817e5e794fc916703cd0 (patch)
treee1fd66ec5c4adeee5f31c7183a808716e6face10
parenta7961b063571ea2f574d798e3547e10748d4aa84 (diff)
ANDROID: Incremental fs: set the correct access to mapped files
Backing file needs to have write permissions for all users even though the mounted view doesn't - otherwise incfs can't change the internal file data. Bug: 180535478 Test: adb install <apk> Signed-off-by: Yurii Zubrytskyi <zyy@google.com> Signed-off-by: Paul Lawrence <paullawrence@google.com> Change-Id: I5d7915b28072cff1508ba45b56e844cb678ca466
-rw-r--r--fs/incfs/pseudo_files.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/incfs/pseudo_files.c b/fs/incfs/pseudo_files.c
index e6fdc9d18111..351523ddfa8e 100644
--- a/fs/incfs/pseudo_files.c
+++ b/fs/incfs/pseudo_files.c
@@ -864,6 +864,12 @@ static long ioctl_create_mapped_file(struct file *file, void __user *arg)
if (error)
goto out;
+ error = chmod(file_dentry, args.mode | 0222);
+ if (error) {
+ pr_debug("incfs: chmod err: %d\n", error);
+ goto delete_file;
+ }
+
/* Save the file's size as an xattr for easy fetching in future. */
size_attr_value = cpu_to_le64(args.size);
error = vfs_setxattr(file_dentry, INCFS_XATTR_SIZE_NAME,