Package: attr
Version: 1:2.4.46-8
Severity: normal
Tags: patch

Dear Maintainer,

The LDFLAGS hardening flags are missing for libmisc because they
are overwritten in the Makefile. For more hardening information
please have a look at [1], [2] and [3].

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 with `blhc` (hardening-check doesn't catch
everything):

    $ hardening-check /lib/x86_64-linux-gnu/libattr.so.1.1.0 /usr/bin/setfattr 
...
    /lib/x86_64-linux-gnu/libattr.so.1.1.0:
     Position Independent Executable: no, regular shared library (ignored)
     Stack protected: yes
     Fortify Source functions: no, only unprotected functions found!
     Read-only relocations: yes
     Immediate binding: no not found!
    /usr/bin/setfattr:
     Position Independent Executable: no, normal executable!
     Stack protected: no, not found!
     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
Description: Use build flags from environment (dpkg-buildflags).
 Necessary for hardening flags.
Author: Simon Ruderich <[email protected]>
Last-Update: 2012-09-13

Index: attr-2.4.46/libmisc/Makefile
===================================================================
--- attr-2.4.46.orig/libmisc/Makefile	2012-09-13 16:35:05.512275587 +0200
+++ attr-2.4.46/libmisc/Makefile	2012-09-13 16:37:48.780281804 +0200
@@ -20,7 +20,9 @@
 include $(TOPDIR)/include/builddefs
 
 LTLIBRARY = libmisc.la
-LTLDFLAGS =
+# We must drop the default $(LTLDFLAGS), but still include $(LDFLAGS) for
+# default (hardening) build flags.
+LTLDFLAGS = $(LDFLAGS)
 
 CFILES = quote.c unquote.c high_water_alloc.c next_line.c walk_tree.c
 

Attachment: signature.asc
Description: Digital signature

Reply via email to