Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 194276 - hardened-sources-2.6.22 fails to boot (Bad EIP value)
Summary: hardened-sources-2.6.22 fails to boot (Bad EIP value)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Hardened (show other bugs)
Hardware: x86 Linux
: High major
Assignee: The Gentoo Linux Hardened Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-30 13:12 UTC by Davide Pesavento (RETIRED)
Modified: 2007-10-30 19:42 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Davide Pesavento (RETIRED) gentoo-dev 2007-09-30 13:12:39 UTC
[...]
MODPOST vmlinux
WARNING: kernel/built-in.o(.text+0x142fd): Section mismatch: reference to .init.text: (between 'kthreadd' and 'init_waitqueue_head')
Kernel: arch/i386/boot/bzImage is ready  (#1)
[...]

The resulting kernel does not boot. I tried both -r5 and -r6.


Portage 2.1.3.9 (selinux/2007.0/x86/hardened, gcc-3.4.6, glibc-2.5-r4, 2.6.20-hardened-r6 i686)
=================================================================
System uname: 2.6.20-hardened-r6 i686 Intel(R) Pentium(R) 4 CPU 2.20GHz
Timestamp of tree: Sat, 29 Sep 2007 17:20:01 +0000
app-shells/bash:     3.2_p17
dev-lang/python:     2.4.4-r5
dev-python/pycrypto: 2.0.1-r6
sys-apps/baselayout: 2.0.0_rc4-r1
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.61-r1
sys-devel/automake:  1.7.9-r1, 1.9.6-r2, 1.10
sys-devel/binutils:  2.17-r1
sys-devel/gcc-config: 1.3.16
sys-devel/libtool:   1.5.24
virtual/os-headers:  2.6.22-r2
ACCEPT_KEYWORDS="x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=pentium4 -msse2 -mfpmath=sse -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /var/bind"
CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-O2 -march=pentium4 -msse2 -mfpmath=sse -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="collision-protect distlocks loadpolicy metadata-transfer nodoc noinfo parallel-fetch sandbox selinux sesandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://mirror.ing.unibo.it/gentoo/"
LANG="en_US.UTF-8"
LC_ALL="en_US.UTF-8"
LINGUAS="en en_US"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_EXTRA_OPTS="--prune-empty-dirs"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="bash-completion berkdb bitmap-fonts bzip2 caps cli cracklib crypt dbus dri fam gnutls hardened iconv idn isdnlog kerberos ldap mailwrapper mbox midi mmx mudflap ncurses nls nptl nptlonly openmp pam pcre pic pppd python radius readline reflection samba sasl selinux session snmp socks5 spl sqlite sse sse2 ssl tcpd threads truetype-fonts type1-fonts unicode x86 xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en en_US" USERLAND="GNU" VIDEO_CARDS="apm ark chips cirrus cyrix dummy fbdev glint i128 i740 i810 imstt mach64 mga neomagic nsc nv r128 radeon rendition s3 s3virge savage siliconmotion sis sisusb tdfx tga trident tseng v4l vesa vga via vmware voodoo"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LDFLAGS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTDIR_OVERLAY
Comment 1 impulze 2007-09-30 13:16:24 UTC
i second that...
not sure if it's related to the section mismatch but the kernel refuses to boot and gives a "Bad EIP value" and "General Protectecion Fault".
Comment 2 Davide Pesavento (RETIRED) gentoo-dev 2007-09-30 13:40:01 UTC
I found the following commit log message in ChangeLog-2.6.23-rc2:

commit e804a4a4dd596d853f6d6f814fbdcf97b8efcdea
Author: Satyam Sharma <ssatyam@cse.iitk.ac.in>
Date:   Tue Jul 31 00:39:16 2007 -0700

    kthread: silence bogus section mismatch warning
    
    WARNING: kernel/built-in.o(.text+0x16910): Section mismatch:
    reference to .init.text: (between 'kthreadd' and 'init_waitqueue_head')
    
    comes because kernel/kthread.c:kthreadd() is not __init but calls
    kthreadd_setup() which is __init. But this is ok, because kthreadd_setup()
    is only ever called at init time, and then kthreadd() proceeds into its
    "for (;;)" loop. We could mark kthreadd __init_refok, but kthreadd_setup()
    with just one callsite and 4 lines in it (it's been that small since
    10ab825bdef8df51) doesn't need to be a separate function at all -- so let's
    just move those four lines at beginning of kthreadd() itself.
    
    Signed-off-by: Satyam Sharma <ssatyam@cse.iitk.ac.in>
    Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Seems that the section mismatch is not the cause of my boot failure according to that. Since the panic is happening very early in the boot stages, consoles and netconsole haven't been initialized yet so I can't see any error message.
Comment 3 Davide Pesavento (RETIRED) gentoo-dev 2007-09-30 14:16:01 UTC
Ok. I tried the patch to fix the section mismatch (http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=e804a4a4dd596d853f6d6f814fbdcf97b8efcdea) and I can confirm that it is a bogus warning, i.e. it is not the cause of the boot failure.
Comment 4 Davide Pesavento (RETIRED) gentoo-dev 2007-09-30 14:43:12 UTC
http://forums.grsecurity.net/viewtopic.php?t=1808
Comment 5 Christian Heim (RETIRED) gentoo-dev 2007-10-01 16:58:29 UTC
OK, both of you try the current hardened-sources-2.6.22 (that's -r7). It contains the newest patch from spender's devspace, and should hopefully fix your issues from what I gathered in the grsecurity forums.
Comment 6 Davide Pesavento (RETIRED) gentoo-dev 2007-10-04 16:52:33 UTC
Bug hasn't been fixed. :(
Comment 7 Christian Heim (RETIRED) gentoo-dev 2007-10-13 17:38:52 UTC
OK, could you please attach your .config or at least tell me what a zgrep PCI_GO /proc/config.gz returns for you.
Comment 8 Davide Pesavento (RETIRED) gentoo-dev 2007-10-13 18:02:07 UTC
(In reply to comment #7)
> OK, could you please attach your .config or at least tell me what a zgrep
> PCI_GO /proc/config.gz returns for you.
> 

# zgrep PCI_GO /proc/config.gz
# CONFIG_PCI_GOBIOS is not set
# CONFIG_PCI_GOMMCONFIG is not set
# CONFIG_PCI_GODIRECT is not set
CONFIG_PCI_GOANY=y
Comment 9 Christian Heim (RETIRED) gentoo-dev 2007-10-14 08:38:07 UTC
(In reply to comment #8)
> (In reply to comment #7)
> > OK, could you please attach your .config or at least tell me what a zgrep
> > PCI_GO /proc/config.gz returns for you.
> > 
> 
> # zgrep PCI_GO /proc/config.gz
> # CONFIG_PCI_GOBIOS is not set
> # CONFIG_PCI_GOMMCONFIG is not set
> # CONFIG_PCI_GODIRECT is not set
> CONFIG_PCI_GOANY=y

Please try setting it to CONFIG_PCI_GODIRECT, that's usually fixing it.
Comment 10 Davide Pesavento (RETIRED) gentoo-dev 2007-10-16 21:55:43 UTC
I tried hardened-sources-2.6.23 with CONFIG_PCI_GODIRECT and my box boots fine now. What's the correct resolution for this bug then?
Comment 11 Christian Heim (RETIRED) gentoo-dev 2007-10-30 19:42:45 UTC
(In reply to comment #10)
> I tried hardened-sources-2.6.23 with CONFIG_PCI_GODIRECT and my box boots fine
> now. What's the correct resolution for this bug then?

For you to enable it. The kernel can't really try to figure if your BIOS is buggy or not ;)