From 08fe691b6acb253b17b1414f67f4af4d0424966a Mon Sep 17 00:00:00 2001 From: xizx Date: Mon, 10 Sep 2018 10:15:03 +0800 Subject: [PATCH] utags:change the proc utag dir node permission dac avc error on "echo 1 > proc/hw/reload" in the init.oem.hw.sh audit: type=1400 audit(3738101.426:12): avc: denied { dac_override } for pid=495 comm="init.oem.hw.sh" uid=0 capability=1 scontext=u:r:init_hw:s0 tcontext=u:r:init_hw:s0 tclass=capability permissive=0 dac avc error on "echo 1 > proc/config/.reboot/ascii" in the init.oem.hw.sh [ 13.771240] init.oem.hw.sh: reset reboot counter [ 13.775002] type=1400 audit(1536562770.017:341): avc: denied { dac_override } for pid=1140 comm="init.oem.hw.sh" uid=0 capability=1 scontext=u:r:init_hw:s0 tcontext=u:r:init_hw:s0 tclass=capability permissive=0 Change-Id: I9392366183b32b260f0792ab3e7293ca55f9bcc1 Signed-off-by: xizx Reviewed-on: https://gerrit.mot.com/1239642 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Konstantin Makariev Submit-Approved: Jira Key --- drivers/misc/utag/utags.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/misc/utag/utags.c b/drivers/misc/utag/utags.c index 9407c6422faa..e81d55bfa645 100644 --- a/drivers/misc/utag/utags.c +++ b/drivers/misc/utag/utags.c @@ -627,7 +627,7 @@ static int proc_utag_util(struct ctrl *ctrl) { struct proc_dir_entry *dir; - dir = proc_mkdir_data("all", 0551, ctrl->root, NULL); + dir = proc_mkdir_data("all", 0771, ctrl->root, NULL); if (!dir) { pr_err("failed to create util\n"); return -EIO; @@ -670,7 +670,7 @@ static struct proc_dir_entry *proc_utag_dir(struct ctrl *ctrl, return dnode->dir; } - dir = proc_mkdir_data(tname, 0511, parent, NULL); + dir = proc_mkdir_data(tname, 0771, parent, NULL); if (!dir) { pr_err("failed to create dir %s\n", tname); return ERR_PTR(-ENOMEM); @@ -1884,7 +1884,7 @@ static int utags_probe(struct platform_device *pdev) return -ENOMEM; } - ctrl->root = proc_mkdir_data(ctrl->dir_name, 0511, NULL, NULL); + ctrl->root = proc_mkdir_data(ctrl->dir_name, 0771, NULL, NULL); if (!ctrl->root) { destroy_workqueue(ctrl->load_queue); destroy_workqueue(ctrl->store_queue);