From f0a8f34910d0014b6e2b80d67d6b64c6095d4dc3 Mon Sep 17 00:00:00 2001 From: Kalesh Singh Date: Fri, 11 Feb 2022 09:36:26 -0800 Subject: [PATCH] ANDROID: Revert "tracefs: Have tracefs directories not set OTH permission bits by default" This reverts commit e2c27194fcd9f9703d927aeea104ec304bcf0ae3. This change breaks Android userspace tools (tracepoint bpf programs, simpleperf, atrace, perfetto, ...) that assume access to tracefs. On Android T and S (QPR2) this is fixed by adding a gid mount option in userspace, for devices with older kernels the permission change needs to be reverted. Bug: 219393750 Bug: 217150407 Bug: 216676030 Signed-off-by: Kalesh Singh Change-Id: I53a63c42b4cf1133a6a2fc1674380ffd8f331392 (cherry picked from commit d2392cf8b12d8c1526e4d5766c642a47aecc28e7) --- fs/tracefs/inode.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/tracefs/inode.c b/fs/tracefs/inode.c index 3616839c5c4b..a1d14740afac 100644 --- a/fs/tracefs/inode.c +++ b/fs/tracefs/inode.c @@ -506,8 +506,7 @@ static struct dentry *__create_dir(const char *name, struct dentry *parent, if (unlikely(!inode)) return failed_creating(dentry); - /* Do not set bits for OTH */ - inode->i_mode = S_IFDIR | S_IRWXU | S_IRUSR| S_IRGRP | S_IXUSR | S_IXGRP; + inode->i_mode = S_IFDIR | S_IRWXU | S_IRUGO | S_IXUGO; inode->i_op = ops; inode->i_fop = &simple_dir_operations; inode->i_uid = d_inode(dentry->d_parent)->i_uid;