Bug 145836 - gnupg has text relocations
gnupg has text relocations
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: gnupg (Show other bugs)
rawhide
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Nalin Dahyabhai
Mike McLean
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-01-21 19:33 EST by Ulrich Drepper
Modified: 2007-11-30 17:10 EST (History)
2 users (show)

See Also:
Fixed In Version: 1.4.0-1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-01-24 20:42:10 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Ulrich Drepper 2005-01-21 19:33:53 EST
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-21 19:33:53 EST
Created attachment 110084 [details]
patch to get PID passed to compiler
Comment 2 Nalin Dahyabhai 2005-01-24 20:42:10 EST
Adding to 1.4.0-1, thanks!

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