Package: proftpd-dfsg
Version: 1.3.4a-2
Severity: important
Tags: patch

Dear Maintainer,

The hardening flags are missing for contrib/ because they are
ignored by the build system.

The attached patch fixes the issue.

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/proftpd/mod_wrap.so 
/usr/lib/proftpd/mod_wrap2_sql.so /usr/lib/proftpd/mod_wrap2_file.so 
/usr/lib/proftpd/mod_wrap2.so ...
    /usr/lib/proftpd/mod_wrap.so:
     Position Independent Executable: no, regular shared library (ignored)
     Stack protected: yes
     Fortify Source functions: unknown, no protectable libc functions used
     Read-only relocations: yes
     Immediate binding: no not found!
    /usr/lib/proftpd/mod_wrap2_sql.so:
     Position Independent Executable: no, regular shared library (ignored)
     Stack protected: no, not found!
     Fortify Source functions: unknown, no protectable libc functions used
     Read-only relocations: yes
     Immediate binding: no not found!
    /usr/lib/proftpd/mod_wrap2_file.so:
     Position Independent Executable: no, regular shared library (ignored)
     Stack protected: yes
     Fortify Source functions: unknown, no protectable libc functions used
     Read-only relocations: yes
     Immediate binding: no not found!
    /usr/lib/proftpd/mod_wrap2.so:
     Position Independent Executable: no, regular shared library (ignored)
     Stack protected: yes
     Fortify Source functions: yes
     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
Description: Use build flags from environment (dpkg-buildflags).
 Necessary for hardening flags.
Author: Simon Ruderich <[email protected]>
Last-Update: 2012-03-29

Index: proftpd-dfsg-1.3.4a/contrib/mod_wrap2/Makefile.in
===================================================================
--- proftpd-dfsg-1.3.4a.orig/contrib/mod_wrap2/Makefile.in	2012-03-29 21:49:22.056103888 +0200
+++ proftpd-dfsg-1.3.4a/contrib/mod_wrap2/Makefile.in	2012-03-29 21:49:34.304103945 +0200
@@ -17,6 +17,9 @@
 # Necessary redefinitions
 CPPFLAGS= -DHAVE_CONFIG_H $(DEFAULT_PATHS) $(PLATFORM) $(MODULE_INCLUDES)
 LDFLAGS=-L../../lib
+# Add (hardening) flags.
+CPPFLAGS += $(shell dpkg-buildflags --get CPPFLAGS)
+LDFLAGS  += $(shell dpkg-buildflags --get LDFLAGS)
 
 .c.o:
 	$(CC) $(CPPFLAGS) $(CFLAGS) -c $<
Index: proftpd-dfsg-1.3.4a/contrib/mod_sftp/Makefile.in
===================================================================
--- proftpd-dfsg-1.3.4a.orig/contrib/mod_sftp/Makefile.in	2012-03-29 21:49:22.056103888 +0200
+++ proftpd-dfsg-1.3.4a/contrib/mod_sftp/Makefile.in	2012-03-29 21:49:34.304103945 +0200
@@ -25,6 +25,9 @@
 INCLUDES=-I. -I../.. -I../../include @INCLUDES@
 CPPFLAGS= $(ADDL_CPPFLAGS) -DHAVE_CONFIG_H $(DEFAULT_PATHS) $(PLATFORM) $(INCLUDES)
 LDFLAGS=-L../../lib @LIBDIRS@
+# Add (hardening) flags.
+CPPFLAGS += $(shell dpkg-buildflags --get CPPFLAGS)
+LDFLAGS  += $(shell dpkg-buildflags --get LDFLAGS)
 
 .c.o:
 	$(CC) $(CPPFLAGS) $(CFLAGS) -c $<
Index: proftpd-dfsg-1.3.4a/contrib/mod_load/Makefile.in
===================================================================
--- proftpd-dfsg-1.3.4a.orig/contrib/mod_load/Makefile.in	2012-03-29 21:49:22.056103888 +0200
+++ proftpd-dfsg-1.3.4a/contrib/mod_load/Makefile.in	2012-03-29 21:49:34.304103945 +0200
@@ -17,6 +17,9 @@
 # Necessary redefinitions
 CPPFLAGS= -DHAVE_CONFIG_H $(DEFAULT_PATHS) $(PLATFORM) $(MODULE_INCLUDES)
 LDFLAGS=-L../../lib
+# Add (hardening) flags.
+CPPFLAGS += $(shell dpkg-buildflags --get CPPFLAGS)
+LDFLAGS  += $(shell dpkg-buildflags --get LDFLAGS)
 
 .c.o:
 	$(CC) $(CPPFLAGS) $(CFLAGS) -c $<

Attachment: signature.asc
Description: Digital signature

Reply via email to