android_kernel_google_msm/tools/power/cpupower
Josh Boyer 40fe79abb0 cpupower: Fix segfault due to incorrect getopt_long arugments
commit f447ef4a56 upstream.

If a user calls 'cpupower set --perf-bias 15', the process will end with
a SIGSEGV in libc because cpupower-set passes a NULL optarg to the atoi
call.  This is because the getopt_long structure currently has all of
the options as having an optional_argument when they really have a
required argument.  We change the structure to use required_argument to
match the short options and it resolves the issue.

This fixes https://bugzilla.redhat.com/show_bug.cgi?id=1000439

Signed-off-by: Josh Boyer <jwboyer@fedoraproject.org>
Cc: Dominik Brodowski <linux@dominikbrodowski.net>
Cc: Thomas Renninger <trenn@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-08 09:42:11 -08:00
..
bench cpupower tool: allow to build in a separate directory 2012-03-03 14:40:10 +01:00
debug cpupower tools: add install target to the debug tools' makefiles 2012-03-03 14:40:11 +01:00
lib cpupowerutils: increase MAX_LINE_LEN 2011-07-29 18:35:40 +02:00
man cpupower: Unify cpupower-frequency-* manpages 2012-03-03 14:40:09 +01:00
po
utils cpupower: Fix segfault due to incorrect getopt_long arugments 2014-01-08 09:42:11 -08:00
.gitignore cpupowerutils: Rename: libcpufreq->libcpupower 2011-07-29 18:35:40 +02:00
Makefile kbuild: Fix gcc -x syntax 2012-10-13 05:38:37 +09:00
README
ToDo

README

The cpufrequtils package (homepage: 
http://www.kernel.org/pub/linux/utils/kernel/cpufreq/cpufrequtils.html ) 
consists of the following elements:

requirements
------------

On x86 pciutils is needed at runtime (-lpci).
For compilation pciutils-devel (pci/pci.h) and a gcc version
providing cpuid.h is needed.
For both it's not explicitly checked for (yet).


libcpufreq
----------

"libcpufreq" is a library which offers a unified access method for userspace
tools and programs to the cpufreq core and drivers in the Linux kernel. This
allows for code reduction in userspace tools, a clean implementation of
the interaction to the cpufreq core, and support for both the sysfs and proc
interfaces [depending on configuration, see below].


compilation and installation
----------------------------

make
su
make install

should suffice on most systems. It builds default libcpufreq,
cpufreq-set and cpufreq-info files and installs them in /usr/lib and
/usr/bin, respectively. If you want to set up the paths differently and/or
want to configure the package to your specific needs, you need to open
"Makefile" with an editor of your choice and edit the block marked
CONFIGURATION.


THANKS
------
Many thanks to Mattia Dongili who wrote the autotoolization and
libtoolization, the manpages and the italian language file for cpufrequtils;
to Dave Jones for his feedback and his dump_psb tool; to Bruno Ducrot for his
powernow-k8-decode and intel_gsic tools as well as the french language file;
and to various others commenting on the previous (pre-)releases of 
cpufrequtils.


        Dominik Brodowski