public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] clocksource: Fix permissions for available_clocksource
@ 2008-05-02 10:49 Heiko Carstens
  2008-05-02 14:36 ` Thomas Gleixner
  2008-05-02 18:31 ` john stultz
  0 siblings, 2 replies; 6+ messages in thread
From: Heiko Carstens @ 2008-05-02 10:49 UTC (permalink / raw)
  To: Andrew Morton; +Cc: John Stultz, Thomas Gleixner, linux-kernel

From: Heiko Carstens <heiko.carstens@de.ibm.com>

File permissions for
/sys/devices/system/clocksource/clocksource0/available_clocksource
are 600 which allows write access. But this is in fact a read only
file. So change permissions to 400.

Cc: John Stultz <johnstul@us.ibm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
---
 kernel/time/clocksource.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6/kernel/time/clocksource.c
===================================================================
--- linux-2.6.orig/kernel/time/clocksource.c
+++ linux-2.6/kernel/time/clocksource.c
@@ -474,7 +474,7 @@ sysfs_show_available_clocksources(struct
 static SYSDEV_ATTR(current_clocksource, 0600, sysfs_show_current_clocksources,
 		   sysfs_override_clocksource);
 
-static SYSDEV_ATTR(available_clocksource, 0600,
+static SYSDEV_ATTR(available_clocksource, 0400,
 		   sysfs_show_available_clocksources, NULL);
 
 static struct sysdev_class clocksource_sysclass = {

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] clocksource: Fix permissions for available_clocksource
  2008-05-02 10:49 [PATCH] clocksource: Fix permissions for available_clocksource Heiko Carstens
@ 2008-05-02 14:36 ` Thomas Gleixner
  2008-05-02 15:27   ` Heiko Carstens
  2008-05-02 18:31 ` john stultz
  1 sibling, 1 reply; 6+ messages in thread
From: Thomas Gleixner @ 2008-05-02 14:36 UTC (permalink / raw)
  To: Heiko Carstens; +Cc: Andrew Morton, John Stultz, linux-kernel

On Fri, 2 May 2008, Heiko Carstens wrote:
> From: Heiko Carstens <heiko.carstens@de.ibm.com>
> 
> File permissions for
> /sys/devices/system/clocksource/clocksource0/available_clocksource
> are 600 which allows write access. But this is in fact a read only
> file. So change permissions to 400.

Indeed. The question is whether we should make this 444. There is no
harm, when users can read the info. Same applies for the
current_clocksource entry, making it 644 should be fine.
 
Thanks,
	tglx

> Cc: John Stultz <johnstul@us.ibm.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
> ---
>  kernel/time/clocksource.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Index: linux-2.6/kernel/time/clocksource.c
> ===================================================================
> --- linux-2.6.orig/kernel/time/clocksource.c
> +++ linux-2.6/kernel/time/clocksource.c
> @@ -474,7 +474,7 @@ sysfs_show_available_clocksources(struct
>  static SYSDEV_ATTR(current_clocksource, 0600, sysfs_show_current_clocksources,
>  		   sysfs_override_clocksource);
>  
> -static SYSDEV_ATTR(available_clocksource, 0600,
> +static SYSDEV_ATTR(available_clocksource, 0400,
>  		   sysfs_show_available_clocksources, NULL);
>  
>  static struct sysdev_class clocksource_sysclass = {
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] clocksource: Fix permissions for available_clocksource
  2008-05-02 14:36 ` Thomas Gleixner
@ 2008-05-02 15:27   ` Heiko Carstens
  2008-05-02 15:34     ` Thomas Gleixner
  0 siblings, 1 reply; 6+ messages in thread
From: Heiko Carstens @ 2008-05-02 15:27 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: Andrew Morton, John Stultz, linux-kernel

On Fri, May 02, 2008 at 04:36:37PM +0200, Thomas Gleixner wrote:
> On Fri, 2 May 2008, Heiko Carstens wrote:
> > From: Heiko Carstens <heiko.carstens@de.ibm.com>
> > 
> > File permissions for
> > /sys/devices/system/clocksource/clocksource0/available_clocksource
> > are 600 which allows write access. But this is in fact a read only
> > file. So change permissions to 400.
> 
> Indeed. The question is whether we should make this 444. There is no
> harm, when users can read the info. Same applies for the
> current_clocksource entry, making it 644 should be fine.

Sure, I can send an on-top patch for this.

Btw. did you recently try writing "jiffies" to current_clocksource?
That seems to be a trick to stop the clock...

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] clocksource: Fix permissions for available_clocksource
  2008-05-02 15:27   ` Heiko Carstens
@ 2008-05-02 15:34     ` Thomas Gleixner
  2008-05-03 12:23       ` Heiko Carstens
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Gleixner @ 2008-05-02 15:34 UTC (permalink / raw)
  To: Heiko Carstens; +Cc: Andrew Morton, John Stultz, linux-kernel

On Fri, 2 May 2008, Heiko Carstens wrote:
> On Fri, May 02, 2008 at 04:36:37PM +0200, Thomas Gleixner wrote:
> > On Fri, 2 May 2008, Heiko Carstens wrote:
> > > From: Heiko Carstens <heiko.carstens@de.ibm.com>
> > > 
> > > File permissions for
> > > /sys/devices/system/clocksource/clocksource0/available_clocksource
> > > are 600 which allows write access. But this is in fact a read only
> > > file. So change permissions to 400.
> > 
> > Indeed. The question is whether we should make this 444. There is no
> > harm, when users can read the info. Same applies for the
> > current_clocksource entry, making it 644 should be fine.
> 
> Sure, I can send an on-top patch for this.

Yes, please.
 
> Btw. did you recently try writing "jiffies" to current_clocksource?
> That seems to be a trick to stop the clock...

Hmm, that's after the kernel switched to highres and/or nohz, right ?
This came up earlier, but it got dropped from my to todo list. :(
Will have a look.

Thanks,

	tglx

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] clocksource: Fix permissions for available_clocksource
  2008-05-02 10:49 [PATCH] clocksource: Fix permissions for available_clocksource Heiko Carstens
  2008-05-02 14:36 ` Thomas Gleixner
@ 2008-05-02 18:31 ` john stultz
  1 sibling, 0 replies; 6+ messages in thread
From: john stultz @ 2008-05-02 18:31 UTC (permalink / raw)
  To: Heiko Carstens; +Cc: Andrew Morton, Thomas Gleixner, linux-kernel


On Fri, 2008-05-02 at 12:49 +0200, Heiko Carstens wrote:
> From: Heiko Carstens <heiko.carstens@de.ibm.com>
> 
> File permissions for
> /sys/devices/system/clocksource/clocksource0/available_clocksource
> are 600 which allows write access. But this is in fact a read only
> file. So change permissions to 400.
> 
> Cc: John Stultz <johnstul@us.ibm.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>

Ah, good catch. 

Acked-by: John Stultz <johnstul@us.ibm.com>


> ---
>  kernel/time/clocksource.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Index: linux-2.6/kernel/time/clocksource.c
> ===================================================================
> --- linux-2.6.orig/kernel/time/clocksource.c
> +++ linux-2.6/kernel/time/clocksource.c
> @@ -474,7 +474,7 @@ sysfs_show_available_clocksources(struct
>  static SYSDEV_ATTR(current_clocksource, 0600, sysfs_show_current_clocksources,
>  		   sysfs_override_clocksource);
> 
> -static SYSDEV_ATTR(available_clocksource, 0600,
> +static SYSDEV_ATTR(available_clocksource, 0400,
>  		   sysfs_show_available_clocksources, NULL);
> 
>  static struct sysdev_class clocksource_sysclass = {


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] clocksource: Fix permissions for available_clocksource
  2008-05-02 15:34     ` Thomas Gleixner
@ 2008-05-03 12:23       ` Heiko Carstens
  0 siblings, 0 replies; 6+ messages in thread
From: Heiko Carstens @ 2008-05-03 12:23 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: Andrew Morton, John Stultz, linux-kernel

On Fri, May 02, 2008 at 05:34:06PM +0200, Thomas Gleixner wrote:
> On Fri, 2 May 2008, Heiko Carstens wrote:
> > On Fri, May 02, 2008 at 04:36:37PM +0200, Thomas Gleixner wrote:
> > > On Fri, 2 May 2008, Heiko Carstens wrote:
> > > > From: Heiko Carstens <heiko.carstens@de.ibm.com>
> > > > 
> > > > File permissions for
> > > > /sys/devices/system/clocksource/clocksource0/available_clocksource
> > > > are 600 which allows write access. But this is in fact a read only
> > > > file. So change permissions to 400.
> > > 
> > > Indeed. The question is whether we should make this 444. There is no
> > > harm, when users can read the info. Same applies for the
> > > current_clocksource entry, making it 644 should be fine.
> > 
> > Sure, I can send an on-top patch for this.
> 
> Yes, please.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
---
 kernel/time/clocksource.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: linux-2.6/kernel/time/clocksource.c
===================================================================
--- linux-2.6.orig/kernel/time/clocksource.c
+++ linux-2.6/kernel/time/clocksource.c
@@ -471,10 +471,10 @@ sysfs_show_available_clocksources(struct
 /*
  * Sysfs setup bits:
  */
-static SYSDEV_ATTR(current_clocksource, 0600, sysfs_show_current_clocksources,
+static SYSDEV_ATTR(current_clocksource, 0644, sysfs_show_current_clocksources,
 		   sysfs_override_clocksource);
 
-static SYSDEV_ATTR(available_clocksource, 0400,
+static SYSDEV_ATTR(available_clocksource, 0444,
 		   sysfs_show_available_clocksources, NULL);
 
 static struct sysdev_class clocksource_sysclass = {

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-05-03 12:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-02 10:49 [PATCH] clocksource: Fix permissions for available_clocksource Heiko Carstens
2008-05-02 14:36 ` Thomas Gleixner
2008-05-02 15:27   ` Heiko Carstens
2008-05-02 15:34     ` Thomas Gleixner
2008-05-03 12:23       ` Heiko Carstens
2008-05-02 18:31 ` john stultz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox