All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Renninger <trenn@suse.de>
To: Daniel J Blueman <daniel.blueman@gmail.com>
Cc: cpufreq@vger.kernel.org, Dave Jones <davej@redhat.com>,
	linux@dominikbrodowski.net
Subject: Re: [2.6.38-rc7, patch] cpuinfo_cur_freq unreadable by non-root
Date: Wed, 2 Mar 2011 10:27:38 +0100	[thread overview]
Message-ID: <201103021027.38810.trenn@suse.de> (raw)
In-Reply-To: <AANLkTikhgKn9ZCqUXP-K2CtSSTiJ_=tXuhF_t7Rbqgdx@mail.gmail.com>

Hi,

<resend, because my stupid mailer added a strange content-type header
preventing the mail to be sent to the cpufreq list (hope it works now)>

On Wednesday, March 02, 2011 06:52:05 AM Daniel J Blueman wrote:
> I failed to find why
> /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq is only readable
> by root; the cost of reading it isn't sufficient to cause memory or
> scheduling denial, but may have been in the past.
> 
> Thus, allow non-root users read permission, consistent with other
> attributes, allowing it to be monitored.
> 
> Signed-off-by: Daniel J Blueman <daniel.blueman@gmail.com>
> 
> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> index 1109f68..0f491fe 100644
> --- a/drivers/cpufreq/cpufreq.c
> +++ b/drivers/cpufreq/cpufreq.c
> @@ -664,7 +664,7 @@ static ssize_t show_bios_limit(struct
> cpufreq_policy *policy, char *buf)
>  	return sprintf(buf, "%u\n", policy->cpuinfo.max_freq);
>  }
> 
> -cpufreq_freq_attr_ro_perm(cpuinfo_cur_freq, 0400);
> +cpufreq_freq_attr_ro(cpuinfo_cur_freq);
>  cpufreq_freq_attr_ro(cpuinfo_min_freq);
Having this read only for root goes back to the beginning
of git history of this file in 2005...
It looks like this is done on purpose, but I do not see why
this should not be readable for others.

Maybe Dominik or Dave have an idea.
Please also remove the definition of cpufreq_freq_attr_ro_perm
in include/linux/cpufreq.h, cpuinfo_cur_freq is the only
instance using it.

Thanks,

   Thomas

  reply	other threads:[~2011-03-02  9:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-02  5:52 [2.6.38-rc7, patch] cpuinfo_cur_freq unreadable by non-root Daniel J Blueman
2011-03-02  9:27 ` Thomas Renninger [this message]
2011-03-02 10:30   ` Dominik Brodowski
     [not found] ` <201103020959.31337.trenn@suse.de>
2011-03-02  9:33   ` [2.6.38-rc7, patch v2] " Daniel J Blueman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201103021027.38810.trenn@suse.de \
    --to=trenn@suse.de \
    --cc=cpufreq@vger.kernel.org \
    --cc=daniel.blueman@gmail.com \
    --cc=davej@redhat.com \
    --cc=linux@dominikbrodowski.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.