Package: mgen
Version: 5.02+dfsg2-2
Severity: important
Tags: patch

Dear Maintainer,

The hardening flags for protolib/ are missing because the build
system ignores them.

The following patch for debian/patches/hardening fixes the issue.

diff -Nru mgen-5.02+dfsg2/debian/patches/hardening 
mgen-5.02+dfsg2/debian/patches/hardening
--- mgen-5.02+dfsg2/debian/patches/hardening    2012-02-22 11:52:20.000000000 
+0100
+++ mgen-5.02+dfsg2/debian/patches/hardening    2012-03-23 01:14:52.000000000 
+0100
@@ -59,3 +59,13 @@
  SYSTEM_LIBS = -ldl -lrt
  
  # 6) System specific capabilities
+--- a/mgen/protolib/makefiles/Makefile.common
++++ b/mgen/protolib/makefiles/Makefile.common
+@@ -16,6 +16,7 @@
+ INCLUDES = $(TCL_INCL_PATH) $(SYSTEM_INCLUDES) -I../include
+ 
+ CFLAGS = -g -DPROTO_DEBUG -DUNIX -D_FILE_OFFSET_BITS=64 -O $(SYSTEM_CFLAGS) 
-fPIC $(SYSTEM_HAVES) $(INCLUDES)
++CFLAGS += $(shell dpkg-buildflags --get CFLAGS) $(shell dpkg-buildflags --get 
CPPFLAGS)
+ 
+ LDFLAGS = $(SYSTEM_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/bin/mgen
    /usr/bin/mgen:
     Position Independent Executable: yes
     Stack protected: yes
     Fortify Source functions: yes (some protected functions found)
     Read-only relocations: yes
     Immediate binding: yes

(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