Page 1 of 1

Kernel build problem - 2.6.27.10

PostPosted: Tue Dec 23, 2008 11:08 am
by urbiusz
Hi,
I'm trying to update my kernel from 2.6.26.6-grsec to 2.6.27.10 with grsec. Every time i have the same error message:

[....]
CC [M] net/xfrm/xfrm_ipcomp.o
LD net/xfrm/built-in.o
LD net/built-in.o
LD vmlinux.o
MODPOST vmlinux.o
WARNING: modpost: Found 1 section mismatch(es).
To see full details build your kernel with:
'make CONFIG_DEBUG_SECTION_MISMATCH=y'
GEN .version
CHK include/linux/compile.h
UPD include/linux/compile.h
CC init/version.o
LD init/built-in.o
LD vmlinux
SYSMAP System.map
make[2]: *** [vmlinux] Error 1
error: /var/tmp/rpm-tmp.25026 (%build)

make[1]: *** [rpm-pkg] Error 1
make: *** [rpm-pkg] Error 2



--------------------------------------------------------------------------
make with CONFIG_DEBUG_SECTION_MISMATCH=y



LD arch/x86/lib/built-in.o
AR arch/x86/lib/lib.a
LD vmlinux.o
MODPOST vmlinux.o
WARNING: vmlinux.o(.cpuinit.data+0x0): Section mismatch in reference from the variable initial_code to the function .init.text:i386_start_kernel()
The variable __cpuinitdata initial_code references
a function __init i386_start_kernel().
If i386_start_kernel is only used by initial_code then
annotate i386_start_kernel with a matching annotation.

GEN .version
CHK include/linux/compile.h
UPD include/linux/compile.h
CC init/version.o
LD init/built-in.o
LD vmlinux
SYSMAP System.map
make[2]: *** [vmlinux] Error 1


Any suggestions or ideas?

Re: Kernel build problem - 2.6.27.10

PostPosted: Wed Dec 24, 2008 4:11 am
by Kurodo
I have a similar problem! :(

Re: Kernel build problem - 2.6.27.10

PostPosted: Mon Dec 29, 2008 12:23 am
by Hinoserm
Same here. The system log shows the following in relation to this,

nm[16974]: segfault at 85b4f75 ip 400484c5 sp bf9bc278 error 4 in libbfd-2.18.50.0.8.20080709.so[40026000+ee000]

This has come up across 13 seperate machines of varying architecture; the only thing in common they all have is they all recently received software updates, putting the build tools all at the same version. I did not have this problem prior to the software update (but unfortunately cannot revert the updates at this time).

All versions newer than the stable grsecurity-2.1.11-2.6.24.5-200804211829 seem to be showing this.

I have two config files I use primarily. No changes to the .config file seem to make a difference. http://ginkosoft.com:8080/grsec-ginko.config http://ginkosoft.com:8080/grsec-ginko-netboot.config

gcc (GCC) 4.3.2
GNU nm (Linux/GNU Binutils) 2.18.50.0.8.20080709

Re: Kernel build problem - 2.6.27.10

PostPosted: Mon Dec 29, 2008 6:05 am
by Oscon
This is my config-file. Based on 2.6.27.10+grsecurity-2.26.27.10 ver 1347.

Code: Select all
Linux osconsfortress 2.6.27-limbo #1 SMP Sun Dec 28 20:10:20 CET 2008 i686 GNU/Linux


gcc version is : 4.1.1-21 (Debian etch)
binutils is: 2.18.1-cvs20080103-7 (from Debian lenny?) + PaXTeam's binutils patch

Distribution is Debian etch.

My tips for your build problems:

- an incompatible kernel_debug* option
- unfriendly gcc or binutils version

Re: Kernel build problem - 2.6.27.10

PostPosted: Mon Dec 29, 2008 8:28 am
by PaX Team
Hinoserm wrote:Same here. The system log shows the following in relation to this,

nm[16974]: segfault at 85b4f75 ip 400484c5 sp bf9bc278 error 4 in libbfd-2.18.50.0.8.20080709.so[40026000+ee000]
would you be able to debug this? try make V=1 to see the full commandline then run it from gdb and post the usual information about the segfault (make sure you have debug info for nm/etc around). also, does binutils 2.19 crash as well?

Re: Kernel build problem - 2.6.27.10

PostPosted: Mon Dec 29, 2008 9:52 pm
by Hinoserm
This seems to only happen (at least for me) if I remove CONFIG_PAX=y from the .config

I'll try to get more info later.

-Hino

Re: Kernel build problem - 2.6.27.10

PostPosted: Mon Dec 29, 2008 10:16 pm
by Hinoserm
Ok, the command that it's trying to run is :
Code: Select all
/bin/sh /root/linux-2.6.27.10/scripts/mksysmap vmlinux System.map


Code: Select all
[root@selenium linux-2.6.27.10]# gdb /usr/bin/nm core.31890
GNU gdb 6.8-2mdv2009.0 (Mandriva Linux release 2009.0)
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i586-mandriva-linux-gnu"...

warning: Can't read pathname for load map: Input/output error.
Reading symbols from /usr/lib/libbfd-2.18.50.0.8.20080709.so...Reading symbols from /usr/lib/debug/usr/lib/libbfd-2.18.50.0.8.20080709.so.debug...done.
done.
Loaded symbols for /usr/lib/libbfd-2.18.50.0.8.20080709.so
Reading symbols from /lib/i686/libc.so.6...Reading symbols from /usr/lib/debug/lib/i686/libc-2.8.so.debug...done.
done.
Loaded symbols for /lib/i686/libc.so.6
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
Core was generated by `nm -n vmlinux'.
Program terminated with signal 11, Segmentation fault.
[New process 31890]
#0  bfd_getl32 (p=0x2638de74) at ../../bfd/libbfd.c:613
613       v |= (unsigned long) addr[1] << 8;
(gdb) bt
#0  bfd_getl32 (p=0x2638de74) at ../../bfd/libbfd.c:613
#1  0xb7f1c038 in elf_parse_notes (abfd=0x8a26038, buf=0xb7cd7008 "", size=658236, offset=-1) at ../../bfd/elf.c:8600
#2  0xb7f1d159 in _bfd_elf_make_section_from_shdr (abfd=0x8a26038, hdr=0x8a2d7a0, name=<value optimized out>, shindex=19)
    at ../../bfd/elf.c:943
#3  0xb7f1d958 in bfd_section_from_shdr (abfd=0x8a26038, shindex=19) at ../../bfd/elf.c:1569
#4  0xb7f0bd2f in bfd_elf32_object_p (abfd=0x8a26038) at ../../bfd/elfcode.h:878
#5  0xb7ee9010 in bfd_check_format_matches (abfd=0x8a26038, format=bfd_object, matching=0xbfbe7798) at ../../bfd/format.c:211
#6  0x0804b778 in display_file (filename=0xbfbe860f "vmlinux") at ../../binutils/nm.c:1188
#7  0x0804bd46 in main (argc=3, argv=0xbfbe7874) at ../../binutils/nm.c:1641


Let me know what else you need.

-Hino

Re: Kernel build problem - 2.6.27.10

PostPosted: Mon Dec 29, 2008 10:27 pm
by Hinoserm
I upgraded binutils on one of my machines.

Code: Select all
[root@selenium linux-2.6.27.10]# nm -V
GNU nm (Linux/GNU Binutils) 2.19.50.0.1.20081007


This fixed the problem.

-Hino

Re: Kernel build problem - 2.6.27.10

PostPosted: Fri Jan 02, 2009 10:00 am
by urbiusz
It's working fine after binutils upgrade to => 2.19.50.0.1.20081007
Thanks!

Re: Kernel build problem - 2.6.27.10

PostPosted: Mon Jan 05, 2009 1:13 pm
by PaX Team
Hinoserm wrote:
Code: Select all
[New process 31890]
#0  bfd_getl32 (p=0x2638de74) at ../../bfd/libbfd.c:613
613       v |= (unsigned long) addr[1] << 8;
can you print 'addr' here? or look at the disasm (x/i $pc) and post the register used to access memory (info reg).
Code: Select all
(gdb) bt
#0  bfd_getl32 (p=0x2638de74) at ../../bfd/libbfd.c:613
#1  0xb7f1c038 in elf_parse_notes (abfd=0x8a26038, buf=0xb7cd7008 "", size=658236, offset=-1) at ../../bfd/elf.c:8600
this offset value looks suspicious, can you post the readelf -e vmlinux output as well? in any case, it looks like a genuine binutils bug and i don't know yet if i can work it around...

Re: Kernel build problem - 2.6.27.10

PostPosted: Fri Jan 16, 2009 7:29 am
by fglinux
Hello

urbiusz wrote:It's working fine after binutils upgrade to => 2.19.50.0.1.20081007
Thanks!


I'm new at the kernel devoloper scene. I've the same problem with an 2.6.28 kernel under a 64 bit machine. I updated my binutils

Code: Select all
# nm -V
GNU nm (GNU Binutils) 2.19
Copyright 2007 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) any later version.
This program has absolutely no warranty.


I actually can't find the patch 2.19.50.0.1.20081007. Where can I get it from?

Thanks for your help

Re: Kernel build problem - 2.6.27.10

PostPosted: Tue Jan 20, 2009 6:14 pm
by PaX Team
fglinux wrote:I'm new at the kernel devoloper scene. I've the same problem with an 2.6.28 kernel under a 64 bit machine. I updated my binutils

Code: Select all
# nm -V
GNU nm (GNU Binutils) 2.19
Copyright 2007 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) any later version.
This program has absolutely no warranty.


I actually can't find the patch 2.19.50.0.1.20081007. Where can I get it from?

Thanks for your help
are you having a problem with binutils 2.19 itself? if yes, can you post the info i asked for somewhere above?