Page 1 of 2

grsecurity-2.1.14-2.6.31-200909112301 wont compile

PostPosted: Sat Sep 12, 2009 3:40 am
by coderx
LD vmlinux
ld: vmlinux: section .text lma 0x40001100 overlaps previous sections
ld: vmlinux: section `.text' can't be allocated in segment 0
ld: final link failed: Bad value
make[2]: *** [vmlinux] Error 1
make[1]: *** [deb-pkg] Error 2
make: *** [deb-pkg] Error 2

grsecurity-2.1.14-2.6.31-200909112301 wont compile

PostPosted: Sat Sep 12, 2009 5:32 am
by adren
here is another error on the latest available grsec patch :

[...]
CC arch/x86/kernel/paravirt.o
arch/x86/kernel/paravirt.c:410: error: expected expression before 'struct'
make[3]: *** [arch/x86/kernel/paravirt.o] Error 1

Re: grsecurity-2.1.14-2.6.31-200909112301 wont compile

PostPosted: Sat Sep 12, 2009 9:21 am
by PaX Team
coderx wrote:LD vmlinux
ld: vmlinux: section .text lma 0x40001100 overlaps previous sections
ld: vmlinux: section `.text' can't be allocated in segment 0
can you post your .config and your ld version?

Re: grsecurity-2.1.14-2.6.31-200909112301 wont compile

PostPosted: Sat Sep 12, 2009 9:22 am
by PaX Team
adren wrote:arch/x86/kernel/paravirt.c:410: error: expected expression before 'struct'
thanks, will be fixed in the next patch.

Re: grsecurity-2.1.14-2.6.31-200909112301 wont compile

PostPosted: Sat Sep 12, 2009 9:51 am
by coderx
PaX Team wrote:
coderx wrote:LD vmlinux
ld: vmlinux: section .text lma 0x40001100 overlaps previous sections
ld: vmlinux: section `.text' can't be allocated in segment 0
can you post your .config and your ld version?


root@ssh:/usr/src# ld --version
GNU ld (GNU Binutils for Debian) 2.18.0.20080103
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) a later version.
This program has absolutely no warranty.
root@ssh:/usr/src# cat /etc/issue
Debian GNU/Linux 5.0 \n \l

http://pastebin.ca/1563157

Re: grsecurity-2.1.14-2.6.31-200909112301 wont compile

PostPosted: Sun Sep 13, 2009 1:49 am
by coderx
its the same with grsecurity-2.1.14-2.6.31-200909121839
any idea ?

Re: grsecurity-2.1.14-2.6.31-200909112301 wont compile

PostPosted: Wed Sep 16, 2009 12:03 pm
by radegand
I seem to be affected by the same issue:
CC init/version.o
LD init/built-in.o
LD vmlinux
ld: vmlinux: section .text lma 0x40001140 overlaps previous sections
ld: vmlinux: section `.text' can't be allocated in segment 0
ld: final link failed: Bad value
make: *** [vmlinux] Error 1

That's an x86 box - I've successfully compiled the kernel on two amd64 boxes and it seems to be running fine so far. All systems in questions are running hardened gentoo with glibc-2.10.1
ld version below:
# ld --version
GNU ld (GNU Binutils for Debian) 2.18.0.20080103

Thanks

Re: grsecurity-2.1.14-2.6.31-200909112301 wont compile

PostPosted: Wed Sep 16, 2009 5:25 pm
by spender
Could you try the latest patch? Some changes were made to the linker script. If that still doesn't work, could you confirm for us that you can build a vanilla 2.6.31 kernel? It seems that the problem may be dependent upon the binutils version you're using, as I wasn't able to reproduce the problem here with binutils 2.18.50 or 2.19

-Brad

Re: grsecurity-2.1.14-2.6.31-200909112301 wont compile

PostPosted: Thu Sep 17, 2009 3:19 pm
by radegand
Hi,
The latest patch did not work :(

It bailed out here:

CC arch/x86/kernel/pcspeaker.o
kernel/futex.c: In function 'exit_robust_list':
kernel/futex.c:2434: warning: 'next_pi' may be used uninitialized in this function
AS arch/x86/kernel/head_32.o
arch/x86/kernel/head_32.S: Assembler messages:
arch/x86/kernel/head_32.S:838: Error: local label `"6" (instance number 1 of a fb label)' is not defined
make[2]: *** [arch/x86/kernel/head_32.o] Error 1
make[1]: *** [arch/x86/kernel] Error 2
make: *** [arch/x86] Error 2

However - upgrading binutils to 2.19.1 did the trick and so far my x86 is running 2.6.31-grsec fine...thanks! :)

Re: grsecurity-2.1.14-2.6.31-200909112301 wont compile

PostPosted: Thu Sep 17, 2009 6:05 pm
by spender
I've fixed two compile errors with the patch and uploaded updated versions. Is there anyone still using binutils 2.18 that can confirm they're still unable to build a working kernel?

-Brad

Re: grsecurity-2.1.14-2.6.31-200909112301 wont compile

PostPosted: Thu Sep 17, 2009 7:09 pm
by final_inode
Although with 2.19.1 it compiles,I'm getting a Kernel panic - not syncing: Out of memory and no killable processes...
on 2.6.31-grsec

I'm using the hardened profile "hardened/linux/x86/10.0"

sys-libs/glibc-2.9_p20081201-r2 hardened debug
dev-libs/klibc-1.5.12-r1 debug

Some toolchain info
zakaqere@ThunderFox ~ $ gcc-config -l && binutils-config -l
[1] i686-pc-linux-gnu-3.4.6
[2] i686-pc-linux-gnu-3.4.6-hardenednopie
[3] i686-pc-linux-gnu-3.4.6-hardenednopiessp
[4] i686-pc-linux-gnu-3.4.6-hardenednossp
[5] i686-pc-linux-gnu-3.4.6-vanilla
[6] i686-pc-linux-gnu-4.3.4 *
[7] i686-pc-linux-gnu-4.3.4-hardenednopie
[8] i686-pc-linux-gnu-4.3.4-vanilla
[1] i686-pc-linux-gnu-2.18 *
[2] i686-pc-linux-gnu-2.19.1
zakaqere@ThunderFox ~ $

[quote="spender"]I've fixed two compile errors with the patch and uploaded updated versions. Is there anyone still using binutils 2.18 that can confirm they're still unable to build a working kernel?

-Brad[/quote]
No, the 2.6.31-grsec still fails to build against ld version 2.18
---
bzImage + vmlinux + config http://www.sendspace.com/file/si27me

Re: grsecurity-2.1.14-2.6.31-200909112301 wont compile

PostPosted: Sat Sep 19, 2009 12:36 am
by ngsupb
I have the same problem, can't compile.
the patch version grsecurity-2.1.14-2.6.31-200909171758.patch
binutils 2.18.50
kernel 2.6.31

here is the error:
CC init/version.o
LD init/built-in.o
LD vmlinux
ld: section .init.data [0000000001843860 -> 0000000001876c46] overlaps section .exit.text [0000000001841ee0 -> 0000000001843861]
make: *** [vmlinux] Error 1

Re: grsecurity-2.1.14-2.6.31-200909112301 wont compile

PostPosted: Sat Sep 19, 2009 1:23 am
by spender
Can you post your config?

-Brad

Re: grsecurity-2.1.14-2.6.31-200909112301 wont compile

PostPosted: Sat Sep 19, 2009 1:49 am
by ngsupb
sure it is: http://vetala.org.ua/config

it is on 64 if it makes any difference.

Re: grsecurity-2.1.14-2.6.31-200909112301 wont compile

PostPosted: Sat Sep 19, 2009 6:40 am
by PaX Team
ngsupb wrote:sure it is: http://vetala.org.ua/config
2.19 linked this fine but that can be due to other reasons as well. in any case, could you stick a
Code: Select all
. = ALIGN(16);
just before the .init.data section in arch/x86/kernel/vmlinux.lds.S (similar to how .init.setup has one already) and see if it helps?