Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit d472882

Browse files
drosen-googleTreehugger Robot
authored andcommitted
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 <[email protected]>
1 parent ae96b41 commit d472882

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

fs/fuse/passthrough.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,13 @@ int fuse_backing_open(struct fuse_conn *fc, struct fuse_backing_map *map)
220220
pr_debug("%s: fd=%d flags=0x%x\n", __func__, map->fd, map->flags);
221221

222222
/* TODO: relax CAP_SYS_ADMIN once backing files are visible to lsof */
223+
/* Android already restricts access here, and we don't want to grant extra
224+
* Permissions to the daemon */
225+
#if 0
223226
res = -EPERM;
224227
if (!fc->passthrough || !capable(CAP_SYS_ADMIN))
225228
goto out;
229+
#endif
226230

227231
res = -EINVAL;
228232
if (map->flags || map->padding)
@@ -275,9 +279,13 @@ int fuse_backing_close(struct fuse_conn *fc, int backing_id)
275279
pr_debug("%s: backing_id=%d\n", __func__, backing_id);
276280

277281
/* TODO: relax CAP_SYS_ADMIN once backing files are visible to lsof */
282+
/* Android already restricts access here, and we don't want to grant extra
283+
* Permissions to the daemon */
284+
#if 0
278285
err = -EPERM;
279286
if (!fc->passthrough || !capable(CAP_SYS_ADMIN))
280287
goto out;
288+
#endif
281289

282290
err = -EINVAL;
283291
if (backing_id <= 0)

0 commit comments

Comments
 (0)