From a41d6442f1f69376f385fc4eb9b4378046a9af7b Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E9=BB=84=E6=B6=9B?= Date: Mon, 22 Apr 2013 17:46:56 +0800 Subject: [PATCH] rk: only allow root access /proc/clocks and /sys/dvfs --- arch/arm/plat-rk/clock.c | 2 +- arch/arm/plat-rk/dvfs.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/arm/plat-rk/clock.c b/arch/arm/plat-rk/clock.c index 2fdd5bb5a0a4..473d161354a8 100644 --- a/arch/arm/plat-rk/clock.c +++ b/arch/arm/plat-rk/clock.c @@ -754,7 +754,7 @@ static const struct file_operations proc_clk_fops = { static int __init clk_proc_init(void) { - proc_create("clocks", 0, NULL, &proc_clk_fops); + proc_create("clocks", S_IFREG | S_IRUSR | S_IRGRP, NULL, &proc_clk_fops); return 0; } diff --git a/arch/arm/plat-rk/dvfs.c b/arch/arm/plat-rk/dvfs.c index bda91b07ba30..3551288cf9c8 100644 --- a/arch/arm/plat-rk/dvfs.c +++ b/arch/arm/plat-rk/dvfs.c @@ -1494,10 +1494,10 @@ struct dvfs_attribute { static struct dvfs_attribute dvfs_attrs[] = { /* node_name permision show_func store_func */ #ifdef CONFIG_RK_CLOCK_PROC - __ATTR(dvfs_tree, S_IRUGO | S_IWUSR, dvfs_tree_show, dvfs_tree_store), - __ATTR(avs_init, S_IRUGO | S_IWUSR, avs_init_show, avs_init_store), - //__ATTR(avs_dyn, S_IRUGO | S_IWUSR, avs_dyn_show, avs_dyn_store), - __ATTR(avs_now, S_IRUGO | S_IWUSR, avs_now_show, avs_now_store), + __ATTR(dvfs_tree, S_IRUSR | S_IRGRP | S_IWUSR, dvfs_tree_show, dvfs_tree_store), + __ATTR(avs_init, S_IRUSR | S_IRGRP | S_IWUSR, avs_init_show, avs_init_store), +// __ATTR(avs_dyn, S_IRUSR | S_IRGRP | S_IWUSR, avs_dyn_show, avs_dyn_store), + __ATTR(avs_now, S_IRUSR | S_IRGRP | S_IWUSR, avs_now_show, avs_now_store), #endif }; -- 2.34.1