#30 gcc 4.5 : cpufreqd buffer overflow and fail to start at boo

open
nobody
None
5
2010-05-06
2010-05-06
fk hp
No

Discussion

  • Nathan Phillip Brink

    ohnobinki@binkidesky ~/cpufreqd/sources2 $ gcc --version
    gcc (Gentoo 4.5.2 p1.1, pie-0.4.5) 4.5.2
    Copyright (C) 2010 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions. There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

    gcc -DHAVE_CONFIG_H -I. -I.. -DBINKI_TRACER_CPPFLAG -W -Wall -Wshadow -W -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline -Wundef -Wbad-function-cast -Waggregate-return -std=c99 -D_POSIX_SOURCE -D_GNU_SOURCE -I.. -O2 -march=pentium4 -pipe -ggdb -MT main.o -MD -MP -MF .deps/main.Tpo -c -o main.o main.c
    gcc -DHAVE_CONFIG_H -I. -I.. -DBINKI_TRACER_CPPFLAG -W -Wall -Wshadow -W -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline -Wundef -Wbad-function-cast -Waggregate-return -std=c99 -D_POSIX_SOURCE -D_GNU_SOURCE -I.. -O2 -march=pentium4 -pipe -ggdb -MT config_parser.o -MD -MP -MF .deps/config_parser.Tpo -c -o config_parser.o config_parser.c
    gcc -DHAVE_CONFIG_H -I. -I.. -DBINKI_TRACER_CPPFLAG -W -Wall -Wshadow -W -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline -Wundef -Wbad-function-cast -Waggregate-return -std=c99 -D_POSIX_SOURCE -D_GNU_SOURCE -I.. -O2 -march=pentium4 -pipe -ggdb -MT cpufreqd_log.o -MD -MP -MF .deps/cpufreqd_log.Tpo -c -o cpufreqd_log.o cpufreqd_log.c
    gcc -DHAVE_CONFIG_H -I. -I.. -DBINKI_TRACER_CPPFLAG -W -Wall -Wshadow -W -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline -Wundef -Wbad-function-cast -Waggregate-return -std=c99 -D_POSIX_SOURCE -D_GNU_SOURCE -I.. -O2 -march=pentium4 -pipe -ggdb -MT daemon_utils.o -MD -MP -MF .deps/daemon_utils.Tpo -c -o daemon_utils.o daemon_utils.c
    libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -DBINKI_TRACER_CPPFLAG -W -Wall -Wshadow -W -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline -Wundef -Wbad-function-cast -Waggregate-return -std=c99 -D_POSIX_SOURCE -D_GNU_SOURCE -I.. -O2 -march=pentium4 -pipe -ggdb -MT cpufreqd_programs.lo -MD -MP -MF .deps/cpufreqd_programs.Tpo -c cpufreqd_programs.c -fPIC -DPIC -o .libs/cpufreqd_programs.o
    libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -DBINKI_TRACER_CPPFLAG -W -Wall -Wshadow -W -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline -Wundef -Wbad-function-cast -Waggregate-return -std=c99 -D_POSIX_SOURCE -D_GNU_SOURCE -I.. -O2 -march=pentium4 -pipe -ggdb -MT cpufreqd_cpu.lo -MD -MP -MF .deps/cpufreqd_cpu.Tpo -c cpufreqd_cpu.c -fPIC -DPIC -o .libs/cpufreqd_cpu.o
    libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -DBINKI_TRACER_CPPFLAG -W -Wall -Wshadow -W -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline -Wundef -Wbad-function-cast -Waggregate-return -std=c99 -D_POSIX_SOURCE -D_GNU_SOURCE -I.. -O2 -march=pentium4 -pipe -ggdb -MT cpufreqd_nforce2.lo -MD -MP -MF .deps/cpufreqd_nforce2.Tpo -c cpufreqd_nforce2.c -fPIC -DPIC -o .libs/cpufreqd_nforce2.o
    libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -DBINKI_TRACER_CPPFLAG -W -Wall -Wshadow -W -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline -Wundef -Wbad-function-cast -Waggregate-return -std=c99 -D_POSIX_SOURCE -D_GNU_SOURCE -I.. -I//usr/include -I/usr/include/sysfs -O2 -march=pentium4 -pipe -ggdb -MT cpufreqd_acpi_la-cpufreqd_acpi.lo -MD -MP -MF .deps/cpufreqd_acpi_la-cpufreqd_acpi.Tpo -c cpufreqd_acpi.c -fPIC -DPIC -o .libs/cpufreqd_acpi_la-cpufreqd_acpi.o
    libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -DBINKI_TRACER_CPPFLAG -W -Wall -Wshadow -W -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline -Wundef -Wbad-function-cast -Waggregate-return -std=c99 -D_POSIX_SOURCE -D_GNU_SOURCE -I.. -I//usr/include -I/usr/include/sysfs -O2 -march=pentium4 -pipe -ggdb -MT cpufreqd_acpi_la-cpufreqd_acpi_ac.lo -MD -MP -MF .deps/cpufreqd_acpi_la-cpufreqd_acpi_ac.Tpo -c cpufreqd_acpi_ac.c -fPIC -DPIC -o .libs/cpufreqd_acpi_la-cpufreqd_acpi_ac.o
    libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -DBINKI_TRACER_CPPFLAG -W -Wall -Wshadow -W -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline -Wundef -Wbad-function-cast -Waggregate-return -std=c99 -D_POSIX_SOURCE -D_GNU_SOURCE -I.. -O2 -march=pentium4 -pipe -ggdb -MT cpufreqd_apm.lo -MD -MP -MF .deps/cpufreqd_apm.Tpo -c cpufreqd_apm.c -fPIC -DPIC -o .libs/cpufreqd_apm.o
    libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -DBINKI_TRACER_CPPFLAG -W -Wall -Wshadow -W -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline -Wundef -Wbad-function-cast -Waggregate-return -std=c99 -D_POSIX_SOURCE -D_GNU_SOURCE -I.. -I//usr/include -I/usr/include/sysfs -O2 -march=pentium4 -pipe -ggdb -MT cpufreqd_acpi_la-cpufreqd_acpi_battery.lo -MD -MP -MF .deps/cpufreqd_acpi_la-cpufreqd_acpi_battery.Tpo -c cpufreqd_acpi_battery.c -fPIC -DPIC -o .libs/cpufreqd_acpi_la-cpufreqd_acpi_battery.o
    libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -DBINKI_TRACER_CPPFLAG -W -Wall -Wshadow -W -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline -Wundef -Wbad-function-cast -Waggregate-return -std=c99 -D_POSIX_SOURCE -D_GNU_SOURCE -I.. -I//usr/include -I/usr/include/sysfs -O2 -march=pentium4 -pipe -ggdb -MT cpufreqd_acpi_la-cpufreqd_acpi_event.lo -MD -MP -MF .deps/cpufreqd_acpi_la-cpufreqd_acpi_event.Tpo -c cpufreqd_acpi_event.c -fPIC -DPIC -o .libs/cpufreqd_acpi_la-cpufreqd_acpi_event.o
    libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -DBINKI_TRACER_CPPFLAG -W -Wall -Wshadow -W -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline -Wundef -Wbad-function-cast -Waggregate-return -std=c99 -D_POSIX_SOURCE -D_GNU_SOURCE -I.. -O2 -march=pentium4 -pipe -ggdb -MT cpufreqd_pmu.lo -MD -MP -MF .deps/cpufreqd_pmu.Tpo -c cpufreqd_pmu.c -fPIC -DPIC -o .libs/cpufreqd_pmu.o
    libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -DBINKI_TRACER_CPPFLAG -W -Wall -Wshadow -W -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline -Wundef -Wbad-function-cast -Waggregate-return -std=c99 -D_POSIX_SOURCE -D_GNU_SOURCE -I.. -O2 -march=pentium4 -pipe -ggdb -MT cpufreqd_tau.lo -MD -MP -MF .deps/cpufreqd_tau.Tpo -c cpufreqd_tau.c -fPIC -DPIC -o .libs/cpufreqd_tau.o
    libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -DBINKI_TRACER_CPPFLAG -W -Wall -Wshadow -W -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline -Wundef -Wbad-function-cast -Waggregate-return -std=c99 -D_POSIX_SOURCE -D_GNU_SOURCE -I.. -I//usr/include -I/usr/include/sysfs -O2 -march=pentium4 -pipe -ggdb -MT cpufreqd_acpi_la-cpufreqd_acpi_temperature.lo -MD -MP -MF .deps/cpufreqd_acpi_la-cpufreqd_acpi_temperature.Tpo -c cpufreqd_acpi_temperature.c -fPIC -DPIC -o .libs/cpufreqd_acpi_la-cpufreqd_acpi_temperature.o
    libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -DBINKI_TRACER_CPPFLAG -W -Wall -Wshadow -W -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline -Wundef -Wbad-function-cast -Waggregate-return -std=c99 -D_POSIX_SOURCE -D_GNU_SOURCE -I.. -I//usr/include -O2 -march=pentium4 -pipe -ggdb -MT cpufreqd_exec_la-cpufreqd_exec.lo -MD -MP -MF .deps/cpufreqd_exec_la-cpufreqd_exec.Tpo -c cpufreqd_exec.c -fPIC -DPIC -o .libs/cpufreqd_exec_la-cpufreqd_exec.o
    libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -DBINKI_TRACER_CPPFLAG -W -Wall -Wshadow -W -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline -Wundef -Wbad-function-cast -Waggregate-return -std=c99 -D_POSIX_SOURCE -D_GNU_SOURCE -I.. -I/usr/include/sysfs -O2 -march=pentium4 -pipe -ggdb -MT cpufreqd_governor_parameters_la-cpufreqd_governor_parameters.lo -MD -MP -MF .deps/cpufreqd_governor_parameters_la-cpufreqd_governor_parameters.Tpo -c cpufreqd_governor_parameters.c -fPIC -DPIC -o .libs/cpufreqd_governor_parameters_la-cpufreqd_governor_parameters.o
    config_parser.c: In function 'clean_config_line':
    daemon_utils.c: In function 'daemonize':
    main.c: In function 'execute_command':
    cpufreqd_cpu.c: In function 'calculate_cpu_usage':
    cpufreqd_cpu.c:201:2: warning: conversion to 'long unsigned int' from 'double' may alter its value
    cpufreqd_cpu.c:202:2: warning: conversion to 'long unsigned int' from 'double' may alter its value
    cpufreqd_cpu.c:211:3: warning: conversion to 'int' from 'long unsigned int' may change the sign of the result
    cpufreqd_pmu.c: In function 'pmu_update':
    cpufreqd_pmu.c:147:4: warning: conversion to 'unsigned int' from 'int' may change the sign of the result
    cpufreqd_acpi_battery.c: In function 'acpi_battery_update':
    cpufreqd_acpi_battery.c:342:5: warning: conversion to 'int' from 'double' may alter its value
    cpufreqd_acpi_battery.c:346:5: warning: conversion to 'int' from 'double' may alter its value
    cpufreqd_acpi_battery.c:355:3: warning: conversion to 'int' from 'double' may alter its value
    cpufreqd_acpi_battery.c:370:3: warning: conversion to 'int' from 'double' may alter its value
    mv -f .deps/cpufreqd_log.Tpo .deps/cpufreqd_log.Po
    config_parser.c:58:2: warning: conversion to 'int' from 'size_t' may change the sign of the result
    mv -f .deps/cpufreqd_programs.Tpo .deps/cpufreqd_programs.Plo
    mv -f .deps/cpufreqd_acpi_la-cpufreqd_acpi.Tpo .deps/cpufreqd_acpi_la-cpufreqd_acpi.Plo
    mv -f .deps/cpufreqd_acpi_la-cpufreqd_acpi_ac.Tpo .deps/cpufreqd_acpi_la-cpufreqd_acpi_ac.Plo
    mv -f .deps/cpufreqd_acpi_la-cpufreqd_acpi_event.Tpo .deps/cpufreqd_acpi_la-cpufreqd_acpi_event.Plo
    mv -f .deps/cpufreqd_nforce2.Tpo .deps/cpufreqd_nforce2.Plo
    daemon_utils.c:149:8: warning: ignoring return value of 'chdir', declared with attribute warn_unused_result
    mv -f .deps/cpufreqd_apm.Tpo .deps/cpufreqd_apm.Plo
    main.c:530:8: warning: conversion to 'unsigned int' from 'int' may change the sign of the result
    main.c:543:8: warning: conversion to 'unsigned int' from 'int' may change the sign of the result
    main.c:567:8: warning: conversion to 'unsigned int' from 'int' may change the sign of the result
    cpufreqd_pmu.c:150:4: warning: conversion to 'unsigned int' from 'int' may change the sign of the result
    cpufreqd_pmu.c:164:4: warning: conversion to 'float' from 'double' may alter its value
    cpufreqd_pmu.c:167:4: warning: conversion to 'float' from 'double' may alter its value
    cpufreqd_pmu.c:172:2: warning: conversion to 'int' from 'float' may alter its value
    gcc -DHAVE_CONFIG_H -I. -I.. -DBINKI_TRACER_CPPFLAG -W -Wall -Wshadow -W -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline -Wundef -Wbad-function-cast -Waggregate-return -std=c99 -D_POSIX_SOURCE -D_GNU_SOURCE -I.. -O2 -march=pentium4 -pipe -ggdb -MT cpufreq_utils.o -MD -MP -MF .deps/cpufreq_utils.Tpo -c -o cpufreq_utils.o cpufreq_utils.c
    gcc -DHAVE_CONFIG_H -I. -I.. -DBINKI_TRACER_CPPFLAG -W -Wall -Wshadow -W -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline -Wundef -Wbad-function-cast -Waggregate-return -std=c99 -D_POSIX_SOURCE -D_GNU_SOURCE -I.. -O2 -march=pentium4 -pipe -ggdb -MT sock_utils.o -MD -MP -MF .deps/sock_utils.Tpo -c -o sock_utils.o sock_utils.c
    gcc -DHAVE_CONFIG_H -I. -I.. -DBINKI_TRACER_CPPFLAG -W -Wall -Wshadow -W -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline -Wundef -Wbad-function-cast -Waggregate-return -std=c99 -D_POSIX_SOURCE -D_GNU_SOURCE -I.. -O2 -march=pentium4 -pipe -ggdb -MT plugin_utils.o -MD -MP -MF .deps/plugin_utils.Tpo -c -o plugin_utils.o plugin_utils.c
    /bin/sh ../libtool --tag=CC --mode=link gcc -W -Wall -Wshadow -W -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline -Wundef -Wbad-function-cast -Waggregate-return -std=c99 -D_POSIX_SOURCE -D_GNU_SOURCE -I.. -O2 -march=pentium4 -pipe -ggdb -module -avoid-version -Wl,-O1 -Wl,--as-needed -o cpufreqd_programs.la -rpath /home/ohnobinki/cpufreqd-prefix/lib cpufreqd_programs.lo
    /bin/sh ../libtool --tag=CC --mode=link gcc -W -Wall -Wshadow -W -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline -Wundef -Wbad-function-cast -Waggregate-return -std=c99 -D_POSIX_SOURCE -D_GNU_SOURCE -I.. -O2 -march=pentium4 -pipe -ggdb -module -avoid-version -Wl,-O1 -Wl,--as-needed -o cpufreqd_nforce2.la -rpath /home/ohnobinki/cpufreqd-prefix/lib cpufreqd_nforce2.lo
    /bin/sh ../libtool --tag=CC --mode=link gcc -W -Wall -Wshadow -W -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline -Wundef -Wbad-function-cast -Waggregate-return -std=c99 -D_POSIX_SOURCE -D_GNU_SOURCE -I.. -O2 -march=pentium4 -pipe -ggdb -module -avoid-version -Wl,-O1 -Wl,--as-needed -o cpufreqd_apm.la -rpath /home/ohnobinki/cpufreqd-prefix/lib cpufreqd_apm.lo
    main.c: In function 'main':
    main.c:721:2: warning: conversion to 'unsigned int' from 'int' may change the sign of the result
    main.c:726:2: warning: conversion to 'unsigned int' from 'int' may change the sign of the result
    config_parser.c: In function 'parse_config_general':
    config_parser.c:145:5: warning: conversion to 'float' from 'int' may alter its value
    config_parser.c:145:5: warning: conversion to '__suseconds_t' from 'float' may alter its value
    config_parser.c:146:5: warning: conversion to '__time_t' from 'float' may alter its value
    cpufreqd_cpu.c: In function 'get_cpu':
    cpufreqd_cpu.c:286:8: warning: ignoring return value of 'fgets', declared with attribute warn_unused_result
    main.c: In function 'execute_command':
    main.c:544:11: warning: ignoring return value of 'write', declared with attribute warn_unused_result
    main.c:568:11: warning: ignoring return value of 'write', declared with attribute warn_unused_result
    mv -f .deps/cpufreqd_acpi_la-cpufreqd_acpi_battery.Tpo .deps/cpufreqd_acpi_la-cpufreqd_acpi_battery.Plo
    config_parser.c:213:5: warning: conversion to 'unsigned int' from 'int' may change the sign of the result
    config_parser.c:221:5: warning: conversion to 'unsigned int' from 'int' may change the sign of the result
    config_parser.c: In function 'parse_config_profile':
    config_parser.c:331:5: warning: conversion to 'long unsigned int' from 'int' may change the sign of the result
    config_parser.c:349:5: warning: conversion to 'long unsigned int' from 'int' may change the sign of the result
    cpufreq_utils.c: In function 'percent_to_absolute':
    cpufreq_utils.c:64:2: warning: conversion to 'float' from 'long unsigned int' may alter its value
    cpufreq_utils.c:64:2: warning: conversion to 'long unsigned int' from 'float' may alter its value
    mv -f .deps/daemon_utils.Tpo .deps/daemon_utils.Po
    cpufreq_utils.c: In function 'get_cpu_num':
    cpufreq_utils.c:111:8: warning: ignoring return value of 'fgets', declared with attribute warn_unused_result
    cpufreqd_governor_parameters.c: In function 'parameter_parse':
    cpufreqd_governor_parameters.c:216:2: warning: conversion to 'unsigned int' from 'int' may change the sign of the result
    config_parser.c: In function 'init_configuration':
    config_parser.c:836:5: warning: conversion to 'unsigned int' from 'int' may change the sign of the result
    config_parser.c:861:7: warning: conversion to 'long unsigned int' from 'int' may change the sign of the resultcpufreqd_acpi_temperature.c: In function 'acpi_temperature_update':
    cpufreqd_acpi_temperature.c:202:3: warning: conversion to 'long int' from 'float' may alter its value

    libtool: link: rm -fr .libs/cpufreqd_programs.la .libs/cpufreqd_programs.lai .libs/cpufreqd_programs.so
    libtool: link: gcc -shared -fPIC -DPIC .libs/cpufreqd_programs.o -O2 -march=pentium4 -Wl,-O1 -Wl,--as-needed -Wl,-soname -Wl,cpufreqd_programs.so -o .libs/cpufreqd_programs.so
    libtool: link: rm -fr .libs/cpufreqd_apm.la .libs/cpufreqd_apm.lai .libs/cpufreqd_apm.so
    libtool: link: gcc -shared -fPIC -DPIC .libs/cpufreqd_apm.o -O2 -march=pentium4 -Wl,-O1 -Wl,--as-needed -Wl,-soname -Wl,cpufreqd_apm.so -o .libs/cpufreqd_apm.so
    libtool: link: rm -fr .libs/cpufreqd_nforce2.la .libs/cpufreqd_nforce2.lai .libs/cpufreqd_nforce2.so
    libtool: link: gcc -shared -fPIC -DPIC .libs/cpufreqd_nforce2.o -O2 -march=pentium4 -Wl,-O1 -Wl,--as-needed -Wl,-soname -Wl,cpufreqd_nforce2.so -o .libs/cpufreqd_nforce2.so
    mv -f .deps/cpufreq_utils.Tpo .deps/cpufreq_utils.Po
    mv -f .deps/sock_utils.Tpo .deps/sock_utils.Po
    mv -f .deps/cpufreqd_pmu.Tpo .deps/cpufreqd_pmu.Plo
    /bin/sh ../libtool --tag=CC --mode=link gcc -W -Wall -Wshadow -W -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline -Wundef -Wbad-function-cast -Waggregate-return -std=c99 -D_POSIX_SOURCE -D_GNU_SOURCE -I.. -O2 -march=pentium4 -pipe -ggdb -module -avoid-version -Wl,-O1 -Wl,--as-needed -o cpufreqd_pmu.la -rpath /home/ohnobinki/cpufreqd-prefix/lib cpufreqd_pmu.lo
    libtool: link: ( cd ".libs" && rm -f "cpufreqd_programs.la" && ln -s "../cpufreqd_programs.la" "cpufreqd_programs.la" )
    libtool: link: ( cd ".libs" && rm -f "cpufreqd_apm.la" && ln -s "../cpufreqd_apm.la" "cpufreqd_apm.la" )
    libtool: link: ( cd ".libs" && rm -f "cpufreqd_nforce2.la" && ln -s "../cpufreqd_nforce2.la" "cpufreqd_nforce2.la" )
    mv -f .deps/cpufreqd_tau.Tpo .deps/cpufreqd_tau.Plo
    mv -f .deps/cpufreqd_acpi_la-cpufreqd_acpi_temperature.Tpo .deps/cpufreqd_acpi_la-cpufreqd_acpi_temperature.Plo
    mv -f .deps/cpufreqd_exec_la-cpufreqd_exec.Tpo .deps/cpufreqd_exec_la-cpufreqd_exec.Plo
    mv -f .deps/plugin_utils.Tpo .deps/plugin_utils.Po
    /bin/sh ../libtool --tag=CC --mode=link gcc -W -Wall -Wshadow -W -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline -Wundef -Wbad-function-cast -Waggregate-return -std=c99 -D_POSIX_SOURCE -D_GNU_SOURCE -I.. -I//usr/include -I/usr/include/sysfs -O2 -march=pentium4 -pipe -ggdb -module -avoid-version -L//usr/lib -lpthread -lsysfs -Wl,-O1 -Wl,--as-needed -o cpufreqd_acpi.la -rpath /home/ohnobinki/cpufreqd-prefix/lib cpufreqd_acpi_la-cpufreqd_acpi.lo cpufreqd_acpi_la-cpufreqd_acpi_ac.lo cpufreqd_acpi_la-cpufreqd_acpi_battery.lo cpufreqd_acpi_la-cpufreqd_acpi_event.lo cpufreqd_acpi_la-cpufreqd_acpi_temperature.lo
    /bin/sh ../libtool --tag=CC --mode=link gcc -W -Wall -Wshadow -W -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline -Wundef -Wbad-function-cast -Waggregate-return -std=c99 -D_POSIX_SOURCE -D_GNU_SOURCE -I.. -I//usr/include -O2 -march=pentium4 -pipe -ggdb -module -avoid-version -L//usr/lib -lpthread -Wl,-O1 -Wl,--as-needed -o cpufreqd_exec.la -rpath /home/ohnobinki/cpufreqd-prefix/lib cpufreqd_exec_la-cpufreqd_exec.lo
    /bin/sh ../libtool --tag=CC --mode=link gcc -W -Wall -Wshadow -W -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline -Wundef -Wbad-function-cast -Waggregate-return -std=c99 -D_POSIX_SOURCE -D_GNU_SOURCE -I.. -O2 -march=pentium4 -pipe -ggdb -module -avoid-version -Wl,-O1 -Wl,--as-needed -o cpufreqd_tau.la -rpath /home/ohnobinki/cpufreqd-prefix/lib cpufreqd_tau.lo
    In file included from /usr/include/stdlib.h:955:0,
    from main.c:27:
    In function 'realpath',
    inlined from 'read_args' at main.c:316:16,
    inlined from 'main' at main.c:682:15:
    /usr/include/bits/stdlib.h:44:2: warning: call to '__realpath_chk_warn' declared with attribute warning: second argument of realpath must be either NULL or at least PATH_MAX bytes long buffer

    ohnobinki@binkidesky ~/cpufreqd/sources2 $ src/cpufreqd -f /etc/cpufreqd.conf
    src/cpufreqd: must be run as root.
    ohnobinki@binkidesky ~/cpufreqd/sources2 $ su -c 'src/cpufreqd -f /etc/cpufreqd.conf'
    Password:
    *** buffer overflow detected ***: src/cpufreqd terminated
    ======= Backtrace: =========
    /lib/libc.so.6(__fortify_fail+0x4b)[0xb78393fb]
    /lib/libc.so.6(+0xda672)[0xb7837672]
    /lib/libc.so.6(__ptsname_r_chk+0x0)[0xb7837d14]
    src/cpufreqd(main+0x828)[0x804b25a]
    /lib/libc.so.6(__libc_start_main+0xe6)[0xb7773de2]
    src/cpufreqd[0x804a411]
    ======= Memory map: ========
    08048000-08052000 r-xp 00000000 08:03 2626332 /home/ohnobinki/cpufreqd/sources2/src/cpufreqd
    08052000-08053000 r--p 00009000 08:03 2626332 /home/ohnobinki/cpufreqd/sources2/src/cpufreqd
    08053000-08054000 rw-p 0000a000 08:03 2626332 /home/ohnobinki/cpufreqd/sources2/src/cpufreqd
    08c0e000-08c2f000 rw-p 00000000 00:00 0 [heap]
    b7741000-b7759000 r-xp 00000000 08:03 518334 /usr/lib/gcc/i686-pc-linux-gnu/4.5.2/libgcc_s.so.1
    b7759000-b775a000 r--p 00017000 08:03 518334 /usr/lib/gcc/i686-pc-linux-gnu/4.5.2/libgcc_s.so.1
    b775a000-b775b000 rw-p 00018000 08:03 518334 /usr/lib/gcc/i686-pc-linux-gnu/4.5.2/libgcc_s.so.1
    b775b000-b775d000 rw-p 00000000 00:00 0
    b775d000-b78a6000 r-xp 00000000 08:03 1275874 /lib/libc-2.13.so
    b78a6000-b78a8000 r--p 00149000 08:03 1275874 /lib/libc-2.13.so
    b78a8000-b78a9000 rw-p 0014b000 08:03 1275874 /lib/libc-2.13.so
    b78a9000-b78ac000 rw-p 00000000 00:00 0
    b78ac000-b78b0000 r-xp 00000000 08:03 2626304 /usr/lib/libcpufreq.so.0.0.0
    b78b0000-b78b1000 r--p 00003000 08:03 2626304 /usr/lib/libcpufreq.so.0.0.0
    b78b1000-b78b2000 rw-p 00004000 08:03 2626304 /usr/lib/libcpufreq.so.0.0.0
    b78b2000-b78b4000 r-xp 00000000 08:03 710901 /lib/libdl-2.13.so
    b78b4000-b78b5000 r--p 00001000 08:03 710901 /lib/libdl-2.13.so
    b78b5000-b78b6000 rw-p 00002000 08:03 710901 /lib/libdl-2.13.so
    b78d8000-b78d9000 rw-p 00000000 00:00 0
    b78d9000-b78f5000 r-xp 00000000 08:03 1276166 /lib/ld-2.13.so
    b78f5000-b78f6000 r--p 0001b000 08:03 1276166 /lib/ld-2.13.so
    b78f6000-b78f7000 rw-p 0001c000 08:03 1276166 /lib/ld-2.13.so
    bf861000-bf882000 rw-p 00000000 00:00 0 [stack]
    ffffe000-fffff000 r-xp 00000000 00:00 0 [vdso]

     
  • Nathan Phillip Brink

    ohnobinki@binkidesky ~/cpufreqd/sources2 $ patch -p0 -i ~/cpufreqd-PATH_MAX.patch
    patching file src/cpufreqd.h
    patching file src/plugin_utils.c
    ohnobinki@binkidesky ~/cpufreqd/sources2 $ make -j -l4
    make all-recursive
    make[1]: Entering directory `/home/ohnobinki/cpufreqd/sources2'
    Making all in src

    ...

    make[2]: Leaving directory `/home/ohnobinki/cpufreqd/sources2'
    make[1]: Leaving directory `/home/ohnobinki/cpufreqd/sources2'
    ohnobinki@binkidesky ~/cpufreqd/sources2 $
    ohnobinki@binkidesky ~/cpufreqd/sources2 $ su -c 'src/cpufreqd -f /etc/cpufreqd.conf'
    Password:
    read_args : Error reading command line argument (/etc/cpufreqd.conf: No such file or directory).
    Unable parse command line parameters, exiting.

    See patch which will be attached in a minute...

     
  • Nathan Phillip Brink

    OK, sf won't let me upload the patch. But just paste the following into `$ openssl base64 -d | gzip -d -c > cpufreqd-PATH_MAX.patch' to get the patch back:

    H4sIAGxsrE4AA71T/U/aUBT9uf0rbmpMlH7RCiJsGlBQuyC4gsvcXF5qP+CZ+sre
    a4nL/vndAmKLuGRZYgOv7b3vnnPevacOC8KnFvgJi+jEmBqUycf/f8nu2QgiGoct
    MP254EmSmv4si3j4MzBFknE/FLZZINXmMg9TTsM5ZRPgeBM0YWAZlhzQKAI9A53j
    W0mos9QuuL8GN6bvJ7/M+/YJmuUjNKEgVtf1Df2SbcGnLAa7Wj2CaqNVPWwd2KBX
    8ZIWYKqqvippwtBPscSycGnVa61aY1kit9ug2zXtEFRcj6DdlmGHRti4CAg5u745
    d3ufu+SSEIxjkLLwVVxWdyjz4ywI4WNMH2kqjOmJrG4t+NJzR85wQIi0etq666rj
    DMb477m4UXn0Yi9NqdeOKcueDJoqyJnrri901w9xXeheAXV7552b/jjnOh2OnPGt
    dIAF6/RV5ysZjV1ncEH6vYEk2fW6rBeT153x5TJVt2w83NbU4glDC+SQ4QTBrGy0
    Bipm0YOzOJtQRrKUxsLw39eHZe43vWjbJS/aNmyIfvZjOSzZjZIna/h78SSCPnty
    s+zvvrQaltYEdXnLJwwVgOEsZCCmHg8DiOk99/AYIk+ZMlCWQpx4AVny7ImUZ4i/
    Yk3uH6Diz/bht6xLPiLk9cx7DL/jnH98kNVysDhvzAIWCTbjyBHtrfZogJUarGfe
    d067jqs8j4DsCkMkioYftH6S79/PSV6DFJn+DQ3NJ/lxMtnrDy+IMzgfaqD0sQH5
    WO+UXXGnQJTwVQNWEeOOIciavIgm5S/Lpv6CYwjiBJv9otMd91FV59st7v0D3iHz
    NRgGAAA=

    Simplified plaintext version:
    --- src/cpufreqd.h 21 Jul 2008 07:06:32 -0000 1.19
    +++ src/cpufreqd.h 29 Oct 2011 20:54:47 -0000
    @@ -26,2 +26,4 @@

    +#include <limits.h>
    +
    #define __CPUFREQD_VERSION__ VERSION
    @@ -56,3 +58,3 @@
    #define MAX_STRING_LEN 255
    -#define MAX_PATH_LEN 512
    +#define MAX_PATH_LEN PATH_MAX

    --- src/plugin_utils.c 27 Jul 2008 07:47:42 -0000 1.22
    +++ src/plugin_utils.c 29 Oct 2011 20:54:47 -0000
    @@ -173,5 +173,5 @@
    int load_plugin(struct plugin_obj *cp) {
    - char libname[512];
    + char libname[MAX_PATH_LEN];

    - snprintf(libname, 512, CPUFREQD_LIBDIR"cpufreqd_%s.so", cp->name);
    + snprintf(libname, MAX_PATH_LEN, CPUFREQD_LIBDIR"cpufreqd_%s.so", cp->name);

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks