Package: libusb-1.0
Version: 2:1.0.9~rc3-3
Severity: important
Tags: patch

Dear Maintainer,

The CPPFLAGS hardening flags for udeb are missing due to a typo
in debian/rules.

The following patch fixes the issue. It also enables verbose
builds to detect missing hardening flags (like the CPPFLAGS)
automatically.

diff -Nru libusb-1.0-1.0.9~rc3/debian/rules libusb-1.0-1.0.9~rc3/debian/rules
--- libusb-1.0-1.0.9~rc3/debian/rules   2011-12-30 18:18:25.000000000 +0100
+++ libusb-1.0-1.0.9~rc3/debian/rules   2012-03-23 00:09:03.000000000 +0100
@@ -9,6 +9,9 @@
 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
 
+# Enable verbose build to detect missing (hardening) flags.
+export V=1
+
 # This has to be exported to make some magic below work.
 export DH_OPTIONS
 
@@ -27,7 +30,7 @@
 CFLAGS += -Wall
 
 # Flags for udebs
-CPPFLAGS_UDEB          = $(CFLAGS)
+CPPFLAGS_UDEB          = $(CPPFLAGS)
 CFLAGS_UDEB            = $(CFLAGS) -Os
 LDFLAGS_UDEB           = $(LDFLAGS)
 

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

    $ hardening-check /usr/lib/libusb-1.0.so.0.1.0
    /usr/lib/libusb-1.0.so.0.1.0:
     Position Independent Executable: no, regular shared library (ignored)
     Stack protected: yes
     Fortify Source functions: yes (some protected functions found)
     Read-only relocations: yes
     Immediate binding: no not found!

(Position Independent Executable and Immediate binding is not
enabled by default.)

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

Regards,
Simon

[1]: https://wiki.debian.org/ReleaseGoals/SecurityHardeningBuildFlags
[2]: https://wiki.debian.org/HardeningWalkthrough
[3]: https://wiki.debian.org/Hardening
-- 
+ privacy is necessary
+ using gnupg http://gnupg.org
+ public key id: 0x92FEFDB7E44C32F9

Attachment: signature.asc
Description: Digital signature

Reply via email to