# [hardened] devkit-power-daemon

## mr.sande

I have been having this bug 291381 problem on my laptop with hardened gentoo.

After fiddling around a little bit I got it working by rebuilding it with -fno-stack-protector in CLFAGS. I can now view my battery and adapter information, use suspend and use hibernate again. Although this worked for me I cant speak for how god a fix it is, but for the time being its good enough for my use.

emerge --info devicekit-power

```
Portage 2.1.8.3 (hardened/linux/amd64/10.0, gcc-4.4.4, glibc-2.11.2-r3, 2.6.34-hardened-r6-s1 x86_64)

=================================================================

                        System Settings

=================================================================

System uname: Linux-2.6.34-hardened-r6-s1-x86_64-Genuine_Intel-R-_CPU_U7300_@_1.30GHz-with-gentoo-2.0.1

Timestamp of tree: Sun, 07 Nov 2010 02:30:20 +0000

ccache version 2.4 [disabled]

app-shells/bash:     4.1_p7

dev-java/java-config: 2.1.11

dev-lang/python:     2.6.5-r3, 3.1.2-r4

dev-util/ccache:     2.4-r7

dev-util/cmake:      2.8.1-r2

sys-apps/baselayout: 2.0.1-r1

sys-apps/openrc:     0.6.3

sys-apps/sandbox:    2.3-r1

sys-devel/autoconf:  2.13, 2.65-r1

sys-devel/automake:  1.9.6-r3, 1.10.3, 1.11.1

sys-devel/binutils:  2.20.1-r1

sys-devel/gcc:       4.4.4-r2

sys-devel/gcc-config: 1.4.1

sys-devel/libtool:   2.2.10

sys-devel/make:      3.81-r2

virtual/os-headers:  2.6.30-r1

ACCEPT_KEYWORDS="amd64"

ACCEPT_LICENSE="* -@EULA skype-eula AdobeFlash-10.1 dlj-1.1"

CBUILD="x86_64-pc-linux-gnu"

CFLAGS="-O2 -pipe -fomit-frame-pointer -march=native"

CHOST="x86_64-pc-linux-gnu"

CONFIG_PROTECT="/etc /usr/share/X11/xkb"

CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"

CXXFLAGS="-O2 -pipe -fomit-frame-pointer -march=native"

DISTDIR="/usr/portage/distfiles"

FEATURES="assume-digests distlocks fixpackages news parallel-fetch protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch"

GENTOO_MIRRORS="http://mirror.gentoo.no"

LANG="en_US.UTF-8"

LDFLAGS="-Wl,-O1 -Wl,--as-needed"

MAKEOPTS="--jobs=2"

PKGDIR="/usr/portage/packages"

PORTAGE_CONFIGROOT="/"

PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

PORTDIR_OVERLAY="/var/lib/layman/akoya /var/lib/layman/smithdanea /var/lib/layman/pentoo"

SYNC="rsync://rsync.gentoo.org/gentoo-portage"

USE="X a52 aac acl acpi alsa amd64 avahi bash-completion berkdb bluetooth bzip2 cairo consolekit cracklib crypt cxx dbus dri dts eds exif extras fam flac gdbm gif gnome gpm gstreamer gtk hal hardened iconv java jpeg justify kdrive laptop lcms libnotify lm_sensors lvm mad mikmod mmx mng modules mp3 mpeg mudflap multilib nautilus ncurses nls nokia nptl nptlonly nsplugin ogg opengl openmp pam pcre pdf pentoo perl pic pmu png policykit pppd python readline samba sdl secure-delete session spell sse sse2 ssh ssl startup-notification svg symlink sysfs syslog tcpd tiff truetype udev unicode urandom usb v4l v4l2 vaapi vorbis wifi x264 xml xorg xulrunner xv xvid zlib zsh-completion" ALSA_CARDS="hda-intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard synaptics mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" PHP_TARGETS="php5-2" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="intel" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" 

Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

=================================================================

                        Package Settings

=================================================================

sys-apps/devicekit-power-014 was built with the following:

USE="(multilib) -debug -doc -test" 

CFLAGS="-O2 -pipe -fomit-frame-pointer -march=native -fno-stack-protector"

CXXFLAGS="-O2 -pipe -fomit-frame-pointer -march=native -fno-stack-protector"
```

----------

## Hu

 *mr.sande wrote:*   

> After fiddling around a little bit I got it working by rebuilding it with -fno-stack-protector in CLFAGS. I can now view my battery and adapter information, use suspend and use hibernate again. Although this worked for me I cant speak for how god a fix it is, but for the time being its good enough for my use.

 This is a bad idea as far as fixes go.  The old gcc 3.x stack protector had some bugs, but I am not aware of any gcc 4.x releases that made it to stable and had a wrong-code bug related to the stack protector.  Barring specific evidence to the contrary, I suspect that the specific program is buggy in some way and the use of hardened exposes that bug.

----------

