Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 126294 - hardened-sources-2.4.32-r2 fails with undefined reference to `pax_handle_fetch_fault'
Summary: hardened-sources-2.4.32-r2 fails with undefined reference to `pax_handle_fetc...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Hardened (show other bugs)
Hardware: x86 Linux
: High normal
Assignee: The Gentoo Linux Hardened Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-15 05:06 UTC by schaedpq
Modified: 2007-01-09 19:03 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
kernel configuration which triggers the linking failure (config,21.61 KB, text/plain)
2006-03-15 05:07 UTC, schaedpq
Details
linux-2.4.32-pax_handle_fetch_fault.patch (linux-2.4.32-pax_handle_fetch_fault.patch,504 bytes, patch)
2006-03-15 08:26 UTC, solar (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description schaedpq 2006-03-15 05:06:35 UTC
If I try to compile a new kernel with hardened-sources-2.4.32-r2, the linking fails with:
arch/i386/mm/mm.o: In function `do_page_fault':
: undefined reference to `pax_handle_fetch_fault'
make: *** [vmlinux] Error 1

The same .config file works for hardened-sources-2.4.32-r1 without any problem, therefore I hope, it is not a configuration error on my side.
I will attach the used .config to the bug.

steps to reproduce (at least on my system. ;-)):
# emerge \=sys-kernel/hardened-sources-2.4.32-r2
# cd /usr/src/
# ln -s linux-2.4.32-hardened-r2 linux
# cd linux
# cp ../linux-2.4.32-hardened-r1/.config .
# make oldconfig
# make dep
# make bzImage

# emerge --info
Portage 2.0.54 (default-linux/x86/no-nptl/2.4, gcc-3.3.6, glibc-2.3.5-r2, 2.4.32-hardened-r1 i686)
=================================================================
System uname: 2.4.32-hardened-r1 i686 AMD Athlon(tm) XP 1800+
Gentoo Base System version 1.6.14
dev-lang/python:     2.3.5-r2, 2.4.2
sys-apps/sandbox:    1.2.12
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.4.26-r1
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-mcpu=athlon-xp -O2 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-mcpu=athlon-xp -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://linux.rz.rub.de/download/gentoo-mirror"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://linux.rz.rub.de/gentoo-portage"
USE="x86 3dnow alsa apache2 apm berkdb bitmap-fonts bzip2 cli crypt ctype dba dri eds emboss expat fastbuild fbcon force-cgi-redirect fortran ftp gd gdbm gif gmp gstreamer gtk2 idn imap innodb ipv6 jpeg libg++ libwww logrotate mad mbox md5sum memlimit mhash mp3 mpm-prefork mysql ncurses nls odbc ogg pam pcre pdflib perl png posix python readline sasl session sftplogging simplexml skey slang soap sockets spell spl ssl tcpd tetex tokenizer truetype-fonts type1-fonts vchroot vhosts vorbis xml xml2 xsl zlib userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, MAKEOPTS
Comment 1 schaedpq 2006-03-15 05:07:52 UTC
Created attachment 82208 [details]
kernel configuration which triggers the linking failure
Comment 2 solar (RETIRED) gentoo-dev 2006-03-15 07:18:06 UTC
testing now with those .config options.
Comment 3 solar (RETIRED) gentoo-dev 2006-03-15 07:31:46 UTC
Ok I'm able to reproduce the problem.
Will test a vanilla-grsec and see how it differs.
Comment 4 solar (RETIRED) gentoo-dev 2006-03-15 08:25:17 UTC
vanilla kernel 2.3.32 kernel + grsecurity-2.1.8-2.4.32-200601211647.patch
using the same config gives the same error.

arch/i386/mm/mm.o: In function `do_page_fault':
: undefined reference to `pax_handle_fetch_fault'
make: *** [vmlinux] Error 1

The problem seems to be in fault.c

#if defined(CONFIG_GRKERNSEC_PAX_EMUTRAMP) || defined(CONFIG_GRKERNSEC_PAX_RANDEXEC)
                        switch (pax_handle_fetch_fault(regs)) {

Yet the function/symbol pax_handle_fetch_fault() only exists when 
CONFIG_GRKERNSEC_PAX_PAGEEXEC is defined.

You have EMUTRAMP defined but not PAGEEXEC so..
Comment 5 solar (RETIRED) gentoo-dev 2006-03-15 08:26:25 UTC
Created attachment 82218 [details, diff]
linux-2.4.32-pax_handle_fetch_fault.patch

patch which allows the kernel to link.
Comment 6 PaX Team 2006-03-15 08:34:39 UTC
FYI: http://forums.grsecurity.net./viewtopic.php?t=1427
Comment 7 schaedpq 2006-03-15 10:00:00 UTC
I applied the patch on my system, works as expected. The kernel boots and runs smoothly.
Thank you (PaX Team as well) for the quick response and your work being done for PaX, Grsec and hardened gentoo. :-)
Comment 8 Alexander Gabert (RETIRED) gentoo-dev 2007-01-09 19:03:11 UTC
seems to be fixed, new versions work just right.

Alex