[Debian-med-packaging] Bug#665637: volview: CPPFLAGS hardening flags missing
Simon Ruderich
simon at ruderich.org
Sat Mar 24 20:08:29 UTC 2012
Package: volview
Version: 3.4-2
Severity: important
Tags: patch
Dear Maintainer,
The CPPFLAGS hardening flags are missing because CMake ignores
them by default.
The following patch fixes the issue by adding them to
CFLAGS/CXXFLAGS. For more hardening information please have a
look at [1], [2] and [3].
diff -Nru volview-3.4/debian/rules volview-3.4/debian/rules
--- volview-3.4/debian/rules 2012-02-01 21:10:53.000000000 +0100
+++ volview-3.4/debian/rules 2012-03-24 17:11:15.000000000 +0100
@@ -9,6 +9,10 @@
DPKG_EXPORT_BUILDFLAGS = 1
-include /usr/share/dpkg/buildflags.mk
+# CMake doesn't use CPPFLAGS, pass them to CFLAGS/CXXFLAGS to enable the
+# missing (hardening) flags.
+CFLAGS += $(CPPFLAGS)
+CXXFLAGS += $(CPPFLAGS)
%:
dh $@ --parallel --sourcedirectory=VolViewPlatformComplete
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/VolView/Plugins/vvITKMergePaintbrushLabelImages.so /usr/lib/VolView/Plugins/vvITKPaintbrushCrop.so /usr/lib/VolView/Plugins/vvITKThresholdImageToPaintbrush.so ...
/usr/lib/VolView/Plugins/vvITKMergePaintbrushLabelImages.so:
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!
/usr/lib/VolView/Plugins/vvITKPaintbrushCrop.so:
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!
/usr/lib/VolView/Plugins/vvITKThresholdImageToPaintbrush.so:
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/debian-med-packaging/attachments/20120324/dabc323e/attachment.pgp>
More information about the Debian-med-packaging
mailing list