Bug 145836 - gnupg has text relocations
Summary: gnupg has text relocations
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: gnupg
Version: rawhide
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Nalin Dahyabhai
QA Contact: Mike McLean
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-01-22 00:33 UTC by Ulrich Drepper
Modified: 2007-11-30 22:10 UTC (History)
2 users (show)

Fixed In Version: 1.4.0-1
Clone Of:
Environment:
Last Closed: 2005-01-25 01:42:10 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
patch to get PID passed to compiler (862 bytes, patch)
2005-01-22 00:33 UTC, Ulrich Drepper
no flags Details | Diff

Description Ulrich Drepper 2005-01-22 00:33:53 UTC
Description of problem:
The i386 gpg binaries has text relocations.  This is in fact a security problem
now that the SELinux policy needs to be relaxed if this isn't fixed.  The
problem is the stupid way asm files are compiled.  This might be necessary for
other compilers, but not for gcc.  We need the compiler, at preprocess time, see
the symbol PIC defined (the asm code already handles this).  So the proposed
change consists of two parts:

1. add -DPIC to the compier command line.  This should happen along with adding
   -fPIE in the .spec file
2. a patch to mpi/Makefile.{am,in} to use a simple rule to compile .S files

Version-Release number of selected component (if applicable):
gnupg-1.2.6-2

How reproducible:
always

Steps to Reproduce:
1. eu-readelf -d /usr/bin/gpg|grep TEXTREL
2.
3.
  
Actual results:
  TEXTREL


Expected results:
No output

Additional info:
In the spec file change this

@@ -31,7 +33,7 @@
 %ifarch ppc64
 configure_flags=--disable-asm
 %endif
-CFLAGS="$RPM_OPT_FLAGS -fPIE" ; export CFLAGS
+CFLAGS="$RPM_OPT_FLAGS -fPIE -DPIC" ; export CFLAGS
 LDFLAGS="$RPM_OPT_FLAGS -pie" ; export LDFLAGS

 %configure --disable-rpath --libexecdir=%{_libdir} --with-zlib $configure_flags

and add the attached patch.

Comment 1 Ulrich Drepper 2005-01-22 00:33:53 UTC
Created attachment 110084 [details]
patch to get PID passed to compiler

Comment 2 Nalin Dahyabhai 2005-01-25 01:42:10 UTC
Adding to 1.4.0-1, thanks!


Note You need to log in before you can comment on or make changes to this bug.