Page 1 of 1

kernel compile issue

PostPosted: Mon Jan 24, 2011 1:18 am
by bluemen
While "make" we are getting the below error:

mm/mmap.c: In function 'expand_downwards':
mm/mmap.c:1912: error: 'struct vm_area_struct' has no member named 'vm_prev'
make[1]: *** [mm/mmap.o] Error 1
make: *** [mm] Error 2


Server Details:
Kernel compile version: linux 2.6.32 (CentOS 5)
grsecurity patch applying: grsecurity-2.2.1-2.6.32.28-201101170305.patch

Re: kernel compile issue

PostPosted: Mon Jan 24, 2011 7:02 pm
by spender
You don't seem to have patched a 2.6.32.28 kernel. Download it from:

http://www.kernel.org/pub/linux/kernel/ ... .28.tar.gz

and then apply the grsecurity patch.
It appears you downloaded an earlier kernel, tried to apply a 2.6.32.28 patch on it, and ignored the many rejects (since there is vm_prev in vm_area_struct, and no reference to vm_prev on line 1912 of mmap.c in the patched kernel).

-Brad

Re: kernel compile issue

PostPosted: Tue Sep 20, 2011 12:18 am
by brenojac
Hello guys,

I just found this thread through Google while searching for "error: ‘struct vm_area_struct’ has no member named ‘vm_prev’". This is the error I'm getting on a Ubuntu 11.04 box trying to compile a patched version of the vanilla (from Linus repo) of the 2.6.32 kernel (https://github.com/torvalds/linux/tarball/v2.6.32). While applying the patches, using patch -p1 < http://grsecurity.net/stable/grsecurity ... 0655.patch (latest stable version), I get some errors such as:

Hunk #4 succeeded at 104 (offset -1 lines).
1 out of 4 hunks FAILED -- saving rejects to file arch/x86/include/asm/mmu_context.h.rej
patching file arch/x86/include/asm/mmu.h


and then:

Hunk #1 succeeded at 58 (offset -5 lines).
patching file arch/x86/include/asm/pgtable-2level.h
patching file arch/x86/include/asm/pgtable_32.h
Reversed (or previously applied) patch detected! Assume -R? [n]

(I tested using yes or no and made no difference)


and several others:

Hunk #1 FAILED at 1047.
Hunk #2 succeeded at 1646 (offset -8 lines).
Hunk #3 succeeded at 2047 (offset -16 lines).
Hunk #4 succeeded at 2808 (offset -18 lines).
1 out of 4 hunks FAILED -- saving rejects to file net/core/dev.c.rej
patching file net/core/flow.c
patching file net/core/rtnetlink.c


patching file net/ipv4/inet_hashtables.c
Hunk #1 FAILED at 18.
Hunk #2 succeeded at 490 (offset -1 lines).
1 out of 2 hunks FAILED -- saving rejects to file net/ipv4/inet_hashtables.c.rej
patching file net/ipv4/inetpeer.c

Anyway, if I ignore such errors and move on, I get the "error: ‘struct vm_area_struct’ has no member named ‘vm_prev’" during compilation.

I'm running out of answers and so I ask for some help. Actually I'm working with a student on an article about grsecurity, but we're are not being able to put it to work. Anyone can give us a hint?

thank you.

- Breno

Re: kernel compile issue

PostPosted: Tue Sep 20, 2011 4:34 pm
by PaX Team
brenojac wrote:http://grsecurity.net/stable/grsecurity-2.2.2-2.6.32.46-201109150655.patch (latest stable version)
notice how the patch names the exact kernel version it applies to: 2.6.32.46, and not plain 2.6.32, so you'll have to find that specific -stable tree version (it won't be in the Linus repo i'm afraid).