reopen 655891
thanks

Dear Maintainer,

Sorry to bother you again, but there are still some hardening
flags missing. The CPPFLAGS ("Fortify Source") are not used. The
following patch fixes this:

diff -Nru dmidecode-2.11/debian/rules dmidecode-2.11/debian/rules
--- dmidecode-2.11/debian/rules 2012-04-16 11:23:23.000000000 +0200
+++ dmidecode-2.11/debian/rules 2012-04-16 22:33:05.000000000 +0200
@@ -6,7 +6,7 @@
        dh ${@}
 
 override_dh_auto_build:
-       dh_auto_build -- CFLAGS="$(CFLAGS) -Os -ansi" LDFLAGS="$(LDFLAGS)"
+       dh_auto_build -- CFLAGS="$(CPPFLAGS) $(CFLAGS) -Os -ansi" 
LDFLAGS="$(LDFLAGS)"
 
 override_dh_auto_install:
        dh_auto_install -- prefix=/usr

(The patch from Moritz fixed the missing LDFLAGS: "Read-only
relocations", "Immediate binding").

To check if all flags were correctly enabled you can use
`hardening-check` from the hardening-includes package and check
the build log with `blhc` [1] (hardening-check doesn't catch
everything):

    $ hardening-check /usr/sbin/ownership /usr/sbin/biosdecode 
/usr/sbin/dmidecode /usr/sbin/vpddecode
    /usr/sbin/ownership:
     Position Independent Executable: yes
     Stack protected: no, not found!
     Fortify Source functions: yes (some protected functions found)
     Read-only relocations: yes
     Immediate binding: yes
    /usr/sbin/biosdecode:
     Position Independent Executable: yes
     Stack protected: no, not found!
     Fortify Source functions: yes (some protected functions found)
     Read-only relocations: yes
     Immediate binding: yes
    /usr/sbin/dmidecode:
     Position Independent Executable: yes
     Stack protected: yes
     Fortify Source functions: yes (some protected functions found)
     Read-only relocations: yes
     Immediate binding: yes
    /usr/sbin/vpddecode:
     Position Independent Executable: yes
     Stack protected: no, not found!
     Fortify Source functions: yes (some protected functions found)
     Read-only relocations: yes
     Immediate binding: yes

Use find -type f \( -executable -o -name \*.so\* \) -exec
hardening-check {} + on the build result to check all files.

Regards,
Simon

[1]: http://ruderich.org/simon/blhc/
-- 
+ privacy is necessary
+ using gnupg http://gnupg.org
+ public key id: 0x92FEFDB7E44C32F9

Attachment: signature.asc
Description: Digital signature

Reply via email to