2011-02-04 12:23:36

by Vasily Kulikov

[permalink] [raw]
Subject: [PATCH 02/20] mach-omap2: pm: world-writable debugfs timer files

Don't allow all users to change timer settings.

Signed-off-by: Vasiliy Kulikov <[email protected]>
---
Cannot compile the driver, so it is not tested at all.

arch/arm/mach-omap2/pm-debug.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-omap2/pm-debug.c b/arch/arm/mach-omap2/pm-debug.c
index 125f565..a5a83b3 100644
--- a/arch/arm/mach-omap2/pm-debug.c
+++ b/arch/arm/mach-omap2/pm-debug.c
@@ -637,14 +637,14 @@ static int __init pm_dbg_init(void)

}

- (void) debugfs_create_file("enable_off_mode", S_IRUGO | S_IWUGO, d,
+ (void) debugfs_create_file("enable_off_mode", S_IRUGO | S_IWUSR, d,
&enable_off_mode, &pm_dbg_option_fops);
- (void) debugfs_create_file("sleep_while_idle", S_IRUGO | S_IWUGO, d,
+ (void) debugfs_create_file("sleep_while_idle", S_IRUGO | S_IWUSR, d,
&sleep_while_idle, &pm_dbg_option_fops);
- (void) debugfs_create_file("wakeup_timer_seconds", S_IRUGO | S_IWUGO, d,
+ (void) debugfs_create_file("wakeup_timer_seconds", S_IRUGO | S_IWUSR, d,
&wakeup_timer_seconds, &pm_dbg_option_fops);
(void) debugfs_create_file("wakeup_timer_milliseconds",
- S_IRUGO | S_IWUGO, d, &wakeup_timer_milliseconds,
+ S_IRUGO | S_IWUSR, d, &wakeup_timer_milliseconds,
&pm_dbg_option_fops);
pm_dbg_init_done = 1;

--
1.7.0.4


2011-02-04 20:10:38

by Tony Lindgren

[permalink] [raw]
Subject: Re: [PATCH 02/20] mach-omap2: pm: world-writable debugfs timer files

* Vasiliy Kulikov <[email protected]> [110204 04:21]:
> Don't allow all users to change timer settings.
>
> Signed-off-by: Vasiliy Kulikov <[email protected]>
> ---
> Cannot compile the driver, so it is not tested at all.

Taking this one too.

Tony

2011-02-04 22:53:55

by Kevin Hilman

[permalink] [raw]
Subject: Re: [PATCH 02/20] mach-omap2: pm: world-writable debugfs timer files

Vasiliy Kulikov <[email protected]> writes:

> Don't allow all users to change timer settings.
>
> Signed-off-by: Vasiliy Kulikov <[email protected]>
> ---
> Cannot compile the driver, so it is not tested at all.

Acked-by: Kevin Hilman <[email protected]>


> arch/arm/mach-omap2/pm-debug.c | 8 ++++----
> 1 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/pm-debug.c b/arch/arm/mach-omap2/pm-debug.c
> index 125f565..a5a83b3 100644
> --- a/arch/arm/mach-omap2/pm-debug.c
> +++ b/arch/arm/mach-omap2/pm-debug.c
> @@ -637,14 +637,14 @@ static int __init pm_dbg_init(void)
>
> }
>
> - (void) debugfs_create_file("enable_off_mode", S_IRUGO | S_IWUGO, d,
> + (void) debugfs_create_file("enable_off_mode", S_IRUGO | S_IWUSR, d,
> &enable_off_mode, &pm_dbg_option_fops);
> - (void) debugfs_create_file("sleep_while_idle", S_IRUGO | S_IWUGO, d,
> + (void) debugfs_create_file("sleep_while_idle", S_IRUGO | S_IWUSR, d,
> &sleep_while_idle, &pm_dbg_option_fops);
> - (void) debugfs_create_file("wakeup_timer_seconds", S_IRUGO | S_IWUGO, d,
> + (void) debugfs_create_file("wakeup_timer_seconds", S_IRUGO | S_IWUSR, d,
> &wakeup_timer_seconds, &pm_dbg_option_fops);
> (void) debugfs_create_file("wakeup_timer_milliseconds",
> - S_IRUGO | S_IWUGO, d, &wakeup_timer_milliseconds,
> + S_IRUGO | S_IWUSR, d, &wakeup_timer_milliseconds,
> &pm_dbg_option_fops);
> pm_dbg_init_done = 1;