First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 30359
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: The Gentoo Linux Hardened Team <hardened@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Nick Fish <ennui@alcatraz.triton.net>
Add CC:
CC:
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
proftpd-etdyn.patch patch patch Nick Fish 2003-10-04 19:37 0000 614 bytes Details | Diff
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 30359 depends on: Show dependency tree
Bug 30359 blocks:
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.






View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2003-10-04 19:37 0000
Compiling proftpd with hardened-gcc yields:

gcc -march=pentium4 -O3 -pipe -fforce-addr -foptimize-sibling-calls -fno-inline -finline-limit=1000 -Wall -c cap_sys.c -o cap_sys.o
cap_sys.c: In function `capget':
cap_sys.c:14: error: can't find a register in class `BREG' while reloading `asm'
make[1]: *** [cap_sys.o] Error 1
make[1]: Leaving directory `/var/tmp/portage/proftpd-1.2.9_rc2/work/proftpd-1.2.9rc2/lib/libcap'
make: *** [dirs] Error 2


attached is a patch to avoid using -yet_exec to compile proftpd.  Thanks to the guys in #gentoo-hardened for helping me figure this out.

------- Comment #1 From Nick Fish 2003-10-04 19:37:32 0000 -------
Created an attachment (id=18767) [details]
patch

------- Comment #2 From Alexander Gabert (RETIRED) 2003-10-05 06:21:48 0000 -------
fixed in cvs, added -yet_exec to fix configure and later sed it out again

Alex

------- Comment #3 From solar 2003-10-05 07:54:30 0000 -------
Reeversing the previous commit.

The reason this happens with proftpd is it includes its own bundled libcap
which is not a position independent safe version. pic code uses reserves
the ebx register and the ebx gets munched by the glibc version of _syscall2()
so the two are not really compatible. 

More info on the bundled version of libcap with proftpd can be found in proftpd's
bugzilla. http://bugs.proftpd.org/show_bug.cgi?id=2000

Using modern glibc with we can get the true desired result with.

has_version sys-devel/hardened-gcc && echo > lib/libcap/cap_sys.c

solar@simple proftpd $ file `which proftpd`
/usr/sbin/proftpd: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV),
stripped

------- Comment #4 From solar 2003-10-05 08:32:04 0000 -------
merged second fix in cvs. 
This fix also allows users that have -fPIC in C[XX]FLAGS to also compile
proftpd without getting the exact same BREG errors (such as prelink users)

First Last Prev Next    No search results available      Search page      Enter new bug