rk: only allow root access /proc/clocks and /sys/dvfs
author黄涛 <huangtao@rock-chips.com>
Mon, 22 Apr 2013 09:46:56 +0000 (17:46 +0800)
committer黄涛 <huangtao@rock-chips.com>
Mon, 22 Apr 2013 09:47:44 +0000 (17:47 +0800)
arch/arm/plat-rk/clock.c
arch/arm/plat-rk/dvfs.c

index 2fdd5bb5a0a440ff95d437c9b4923097828a9e22..473d161354a8aff37de5731eac02f5ac8a977b19 100644 (file)
@@ -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;
 
 }
index bda91b07ba305d3a9efaf63b54061d97610bec8b..3551288cf9c81967251b3a1f19e67cb7131b4f43 100644 (file)
@@ -1494,10 +1494,10 @@ struct dvfs_attribute {
 static struct dvfs_attribute dvfs_attrs[] = {\r
        /*     node_name        permision               show_func       store_func */\r
 #ifdef CONFIG_RK_CLOCK_PROC\r
-       __ATTR(dvfs_tree,       S_IRUGO | S_IWUSR,      dvfs_tree_show, dvfs_tree_store),\r
-       __ATTR(avs_init,        S_IRUGO | S_IWUSR,      avs_init_show,  avs_init_store),\r
-       //__ATTR(avs_dyn,               S_IRUGO | S_IWUSR,      avs_dyn_show,   avs_dyn_store),\r
-       __ATTR(avs_now,         S_IRUGO | S_IWUSR,      avs_now_show,   avs_now_store),\r
+       __ATTR(dvfs_tree,       S_IRUSR | S_IRGRP | S_IWUSR,    dvfs_tree_show, dvfs_tree_store),\r
+       __ATTR(avs_init,        S_IRUSR | S_IRGRP | S_IWUSR,    avs_init_show,  avs_init_store),\r
+//     __ATTR(avs_dyn,         S_IRUSR | S_IRGRP | S_IWUSR,    avs_dyn_show,   avs_dyn_store),\r
+       __ATTR(avs_now,         S_IRUSR | S_IRGRP | S_IWUSR,    avs_now_show,   avs_now_store),\r
 #endif\r
 };\r
 \r