ANDROID: fuse: Allow passthrough without CAP_SYS_ADMIN

Android already restricts this to Media Provider, and we'd prefer not to
elevate Media Provider's permissions unless absolutely necessary.

Change-Id: I56301d1da1f4bb5e84585712b6cd36344f1c82d6
Bug: 333497409
Test: Can Open File in Passthrough Mode
Signed-off-by: Daniel Rosenberg <drosen@google.com>
This commit is contained in:
Daniel Rosenberg
2024-07-01 15:18:20 -07:00
committed by Treehugger Robot
parent ae96b41eae
commit d472882118
+8
View File
@@ -220,9 +220,13 @@ int fuse_backing_open(struct fuse_conn *fc, struct fuse_backing_map *map)
pr_debug("%s: fd=%d flags=0x%x\n", __func__, map->fd, map->flags);
/* TODO: relax CAP_SYS_ADMIN once backing files are visible to lsof */
/* Android already restricts access here, and we don't want to grant extra
* Permissions to the daemon */
#if 0
res = -EPERM;
if (!fc->passthrough || !capable(CAP_SYS_ADMIN))
goto out;
#endif
res = -EINVAL;
if (map->flags || map->padding)
@@ -275,9 +279,13 @@ int fuse_backing_close(struct fuse_conn *fc, int backing_id)
pr_debug("%s: backing_id=%d\n", __func__, backing_id);
/* TODO: relax CAP_SYS_ADMIN once backing files are visible to lsof */
/* Android already restricts access here, and we don't want to grant extra
* Permissions to the daemon */
#if 0
err = -EPERM;
if (!fc->passthrough || !capable(CAP_SYS_ADMIN))
goto out;
#endif
err = -EINVAL;
if (backing_id <= 0)