Error when make kernel 2.6.24.-4

Discuss usability issues, general maintenance, and general support issues for a grsecurity-enabled system.

Error when make kernel 2.6.24.-4

Postby JensSthlm » Wed May 07, 2008 10:49 am

Hi,

I get this error:

CC mm/mmap.o
mm/mmap.c: In function "expand_downwards":
mm/mmap.c:1877: warning: passing argument 1 of "find_vma_prev" makes pointer from integer without a cast
mm/mmap.c:1877: warning: passing argument 2 of "find_vma_prev" makes integer from pointer without a cast
mm/mmap.c:1877: error: too few arguments to function "find_vma_prev"
make[1]: *** [mm/mmap.o] Error 1
make: *** [mm] Error 2

#

I can not see any problem.

I runing IA64 hardware rx2660 server, OS RedHat ES 5.

Find a bug in the patch file (grsecurity-2.1.11-2.6.24.5-200804211829.patch):
Get a error wide make.
Line 391:396
static inline int
in_core (const struct module *mod, uint64_t addr)
{
- return addr - (uint64_t) mod->module_core < mod->core_size;
+ return in_core_rx(mod, value) || in_core_rw(mod, value;)
}

Shall be:
static inline int
in_core (const struct module *mod, uint64_t addr)
{
- return addr - (uint64_t) mod->module_core < mod->core_size;
+ return in_core_rx(mod, addr) || in_core_rw(mod, addr);
}

Jens Skoglund
JS Data / IT Service
Stockholm, Sweden
JensSthlm
 
Posts: 12
Joined: Tue Feb 05, 2008 3:42 am

Re: Error when make kernel 2.6.24.-4

Postby PaX Team » Wed May 07, 2008 5:12 pm

JensSthlm wrote:CC mm/mmap.o
mm/mmap.c: In function "expand_downwards":
mm/mmap.c:1877: warning: passing argument 1 of "find_vma_prev" makes pointer from integer without a cast
mm/mmap.c:1877: warning: passing argument 2 of "find_vma_prev" makes integer from pointer without a cast
mm/mmap.c:1877: error: too few arguments to function "find_vma_prev"
make[1]: *** [mm/mmap.o] Error 1
make: *** [mm] Error 2

#

I can not see any problem.
the mm arg was missing, fixed.
Shall be:
static inline int
in_core (const struct module *mod, uint64_t addr)
{
- return addr - (uint64_t) mod->module_core < mod->core_size;
+ return in_core_rx(mod, addr) || in_core_rw(mod, addr);
}
thanks, it's also fixed now.
PaX Team
 
Posts: 2310
Joined: Mon Mar 18, 2002 4:35 pm

Re: Error when make kernel 2.6.24.-4

Postby JensSthlm » Thu May 08, 2008 1:37 am

Are that a patch available for the mm/mmap?
I can not make the kernel. And can not go round this problem.

/ Jens
JensSthlm
 
Posts: 12
Joined: Tue Feb 05, 2008 3:42 am

Re: Error when make kernel 2.6.24.-4

Postby JensSthlm » Thu May 08, 2008 3:18 pm

I find the fix under test patch.

I have a new problem.

Get this error

CC arch/ia64/kernel/init_task.o
GEN .version
CHK include/linux/compile.h
UPD include/linux/compile.h
CC init/version.o
LD init/built-in.o
LD .tmp_vmlinux1
arch/ia64/kernel/init_task.o:(.data.init_task+0x8): undefined reference to `init_thread_union'
make: *** [.tmp_vmlinux1] Error 1


I have make linux-2.6.24.4 whith out grsec-patch, it's work just find.
With grsecurity-2.1.11-2.6.24.5-200804211829.patch then I get this error.

// Jens Skoglund
JS Data / IT Service
Stockholm, Sweden
JensSthlm
 
Posts: 12
Joined: Tue Feb 05, 2008 3:42 am

Re: Error when make kernel 2.6.24.-4

Postby JensSthlm » Fri May 09, 2008 12:22 pm

Patch fix for me error.

Wish a fast answer, if any see a problem with this.
I can now make me kernel with grsec. patch.

// Jens

Code: Select all
diff -urNp linux-2.6.24.6/arch/ia64/kernel/init_task.c linux-2.6.24.6/arch/ia64/kernel/init_task.c
--- linux-2.6.24.6/arch/ia64/kernel/init_task.c 2008-05-01 17:50:00.000000000 -0400
+++ linux-2.6.24.6/arch/ia64/kernel/init_task.c 2008-05-06 17:49:05.000000000 -0400
@@ -27,0 +27,11 @@ EXPORT_SYMBOL(init_mm);
+/*
+ * Initial thread structure.
+ *
+ * We need to make sure that this is THREAD_SIZE aligned due to the
+ * way process stacks are handled. This is done by having a special
+ * "init_task" linker map entry..
+ */
+union thread_union init_thread_union
+        __attribute__((__section__(".data.init_task"))) =
+                { INIT_THREAD_INFO(init_task) };
+
/*
JensSthlm
 
Posts: 12
Joined: Tue Feb 05, 2008 3:42 am

Re: Error when make kernel 2.6.24.-4

Postby PaX Team » Tue May 13, 2008 5:12 am

JensSthlm wrote:Patch fix for me error.

Wish a fast answer, if any see a problem with this.
please try the latest test patch, it should fix the problem. your patch makes things compile but at runtime it won't work because the init_task is a special structure on ia64, unlike other archs (there's no init_thread_union in particular).
PaX Team
 
Posts: 2310
Joined: Mon Mar 18, 2002 4:35 pm

Re: Error when make kernel 2.6.24.-4

Postby JensSthlm » Mon May 19, 2008 10:58 am

OK the last patch. I skall try it.

Have can I fix this problem
arch/ia64/kernel/init_task.o:(.data.init_task+0x8): undefined reference to `init_thread_union'
make: *** [.tmp_vmlinux1] Error 1
?

Skall I use the patch I found or not?
I can make the kernel without the gresecuriy path, all work just find.

Please help me. Otherwise I must install the last stable patch of grsecurity.

// Jens
JensSthlm
 
Posts: 12
Joined: Tue Feb 05, 2008 3:42 am

Re: Error when make kernel 2.6.24.-4

Postby PaX Team » Wed May 21, 2008 5:01 am

JensSthlm wrote:OK the last patch. I skall try it.

Have can I fix this problem
arch/ia64/kernel/init_task.o:(.data.init_task+0x8): undefined reference to `init_thread_union'
make: *** [.tmp_vmlinux1] Error 1
?

Skall I use the patch I found or not?
sorry, i meant the patch for 2.6.25.x as 'last' ;-). i updated the 2.6.24.x one as well, try it out.
PaX Team
 
Posts: 2310
Joined: Mon Mar 18, 2002 4:35 pm

Re: Error when make kernel 2.6.24.-4

Postby JensSthlm » Wed May 28, 2008 1:53 pm

Hello,

I have just try patch grsecurity-2.1.11-2.6.24.7-200805121951.patch still same problem,

GEN .version
CHK include/linux/compile.h
UPD include/linux/compile.h
CC init/version.o
LD init/built-in.o
LD vmlinux
arch/ia64/kernel/init_task.o:(.data.init_task+0x8): undefined reference to `init_thread_union'
make: *** [vmlinux] Error 1

I have also try grsecurity-2.1.12-2.6.25.4-200805181334.patch and linux-2.6.25.4 kernel.
Can't get pass

CHK include/linux/compile.h
CC fs/binfmt_elf.o
fs/binfmt_elf.c: In function ‘load_elf_binary’:
fs/binfmt_elf.c:1005: error: ‘STACK_TOP’ undeclared (first use in this function)
fs/binfmt_elf.c:1005: error: (Each undeclared identifier is reported only once
fs/binfmt_elf.c:1005: error: for each function it appears in.)
make[1]: *** [fs/binfmt_elf.o] Error 1
make: *** [fs] Error 2

I hope it's was fix in the grsecurity-2.1.11-2.6.24.7-200805121951.patch

Now I must run the old stable patch for kernel 2.6.9 :(.
JensSthlm
 
Posts: 12
Joined: Tue Feb 05, 2008 3:42 am

Re: Error when make kernel 2.6.24.-4

Postby PaX Team » Thu May 29, 2008 6:51 pm

JensSthlm wrote:I have just try patch grsecurity-2.1.11-2.6.24.7-200805121951.patch still same problem,
given that i fixed it only on 21st, it's unlikely that spender could have put it into grsec on 12th ;). in any case, i was talking about the PaX patch only, pax-linux-2.6.24.7-test50.patch in particular which should fix your problem. you can interdiff it to test49 and apply it to grsec, that should also work.
I have also try grsecurity-2.1.12-2.6.25.4-200805181334.patch and linux-2.6.25.4 kernel.
Can't get pass

CHK include/linux/compile.h
CC fs/binfmt_elf.o
fs/binfmt_elf.c: In function ‘load_elf_binary’:
fs/binfmt_elf.c:1005: error: ‘STACK_TOP’ undeclared (first use in this function)
fs/binfmt_elf.c:1005: error: (Each undeclared identifier is reported only once
fs/binfmt_elf.c:1005: error: for each function it appears in.)
make[1]: *** [fs/binfmt_elf.o] Error 1
make: *** [fs] Error 2
this is also fixed in later PaX patches, you can either interdiff or wait for spender's next patch update.
PaX Team
 
Posts: 2310
Joined: Mon Mar 18, 2002 4:35 pm

Re: Error when make kernel 2.6.24.-4

Postby JensSthlm » Sat May 31, 2008 8:47 am

my mistake :)
I get now pass binfmt_elf.c. But not

LD init/built-in.o
LD vmlinux
arch/ia64/kernel/init_task.o:(.data.init_task+0x8): undefined reference to `init_thread_union'
make: *** [vmlinux] Error 1

I may wait for spender's nest patch update, and hop is be fix in this patch.
Until that I make kernel 2.6.9, I know is working tody.

Thanks for the help
JensSthlm
 
Posts: 12
Joined: Tue Feb 05, 2008 3:42 am

Re: Error when make kernel 2.6.24.-4

Postby PaX Team » Sun Jun 01, 2008 11:26 am

JensSthlm wrote:my mistake :)
I get now pass binfmt_elf.c. But not

LD init/built-in.o
LD vmlinux
arch/ia64/kernel/init_task.o:(.data.init_task+0x8): undefined reference to `init_thread_union'
make: *** [vmlinux] Error 1
which patch did you try? the latest PaX test patches can't cause this.
PaX Team
 
Posts: 2310
Joined: Mon Mar 18, 2002 4:35 pm

Re: Error when make kernel 2.6.24.-4

Postby JensSthlm » Sun Jun 01, 2008 11:42 am

I have test both

grsecurity-2.1.11-2.6.24.7-200805121951.patch and PAX pax-linux-2.6.24.7-test49.patch, pax-linux-2.6.24.7-test50.patch and pax-linux-2.6.24.7-test51.patch

I did a interdiff both test49 and test50, and from test50 and test51.
Check if the output was in grsecurity-2.1.11-2.6.24.7-200805121951.patch or not.

I have also try grsecurity-2.1.12-2.6.25.4-200805291852.patch whith kerlen 2.6.25.4 on both I get too this error.
I make the kernel whitout grsecurity-2.1.12-2.6.25.4-200805291852.patch, and work 100%. No errors only warnings.
JensSthlm
 
Posts: 12
Joined: Tue Feb 05, 2008 3:42 am

Re: Error when make kernel 2.6.24.-4

Postby PaX Team » Sun Jun 01, 2008 8:21 pm

JensSthlm wrote:I have test both

grsecurity-2.1.11-2.6.24.7-200805121951.patch and PAX pax-linux-2.6.24.7-test49.patch, pax-linux-2.6.24.7-test50.patch and pax-linux-2.6.24.7-test51.patch

I did a interdiff both test49 and test50, and from test50 and test51.
Check if the output was in grsecurity-2.1.11-2.6.24.7-200805121951.patch or not.

I have also try grsecurity-2.1.12-2.6.25.4-200805291852.patch whith kerlen 2.6.25.4 on both I get too this error.
I make the kernel whitout grsecurity-2.1.12-2.6.25.4-200805291852.patch, and work 100%. No errors only warnings.
i just cross-compiled an ia64 2.6.24.7 kernel and it linked fine (which is expected as PaX no longer references init_thread_union in INIT_TASK) so i don't know what can possibly go wrong on your end...
PaX Team
 
Posts: 2310
Joined: Mon Mar 18, 2002 4:35 pm

Re: Error when make kernel 2.6.24.-4

Postby JensSthlm » Mon Jun 02, 2008 4:50 am

OK,

I did just now a new try. Is work just find.
I must miss something when I did a interdiff and add to the grsecurity patch.

Thanks for the help PaX Team
JensSthlm
 
Posts: 12
Joined: Tue Feb 05, 2008 3:42 am


Return to grsecurity support

cron