diff options
author | Subash Abhinov Kasiviswanathan <subashab@codeaurora.org> | 2020-04-20 13:18:12 -0600 |
---|---|---|
committer | Subash Abhinov Kasiviswanathan <subashab@codeaurora.org> | 2020-04-20 13:18:12 -0600 |
commit | fe2f4dbf0cbc0383d55490185a6164681909a165 (patch) | |
tree | d90331c6bb84b45c23ea8c9b356ad14311faf20a | |
parent | b74079bcf465e1c0789c337f90d9e24c13aeb6de (diff) | |
download | data-kernel-fe2f4dbf0cbc0383d55490185a6164681909a165.tar.gz |
rmnet_shs: Change file permissions
Remove the root user and group permissions from the proc files.
CRs-Fixed: 2668115
Change-Id: Ib0b9502db4d52c20554e19762d72afd05c7b1532
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
-rw-r--r-- | drivers/rmnet/shs/rmnet_shs_wq_mem.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/rmnet/shs/rmnet_shs_wq_mem.c b/drivers/rmnet/shs/rmnet_shs_wq_mem.c index 062edb7..e914d78 100644 --- a/drivers/rmnet/shs/rmnet_shs_wq_mem.c +++ b/drivers/rmnet/shs/rmnet_shs_wq_mem.c @@ -955,8 +955,17 @@ void rmnet_shs_wq_mem_update_cached_netdevs(void) /* Creates the proc folder and files for shs shared memory */ void rmnet_shs_wq_mem_init(void) { + kuid_t shs_uid; + kgid_t shs_gid; + shs_proc_dir = proc_mkdir("shs", NULL); + shs_uid = make_kuid(&init_user_ns, 1001); + shs_gid = make_kgid(&init_user_ns, 1001); + + if (uid_valid(shs_uid) && gid_valid(shs_gid)) + proc_set_user(shs_proc_dir, shs_uid, shs_gid); + proc_create(RMNET_SHS_PROC_CAPS, 0644, shs_proc_dir, &rmnet_shs_caps_fops); proc_create(RMNET_SHS_PROC_G_FLOWS, 0644, shs_proc_dir, &rmnet_shs_g_flows_fops); proc_create(RMNET_SHS_PROC_SS_FLOWS, 0644, shs_proc_dir, &rmnet_shs_ss_flows_fops); |