Page 1 of 1

grsecurity+kernel 2.6.14.6+sparc64

PostPosted: Fri Mar 17, 2006 7:38 am
by osa
Hi

I have tray install grsecurity to linux debian on the architecture sparc64
TI UltraSparc II

When I compiled the kernel , I got error

CC arch/sparc64/mm/fault.o
arch/sparc64/mm/fault.c: In function `do_sparc64_fault':
arch/sparc64/mm/fault.c:699: error: label `fault_done' used but not defined
make[2]: *** [arch/sparc64/mm/fault.o] Błąd 1
make[1]: *** [arch/sparc64/mm] Błąd 2

In file fault.c in 699 line is:
goto fault_done;
I can't find this function "fault_done" in all files kernel source.

osa

Re: grsecurity+kernel 2.6.14.6+sparc64

PostPosted: Fri Mar 17, 2006 8:17 am
by PaX Team
osa wrote:In file fault.c in 699 line is:
goto fault_done;
I can't find this function "fault_done" in all files kernel source.
looks like you're the first ever to try 2.6-grsec on sparc64 ;-). the following patch should fix up this bitrot (may apply with some offset on 2.6.14):
Code: Select all
diff -u linux-2.6.16-rc6-pax/arch/sparc64/mm/fault.c linux-2.6.16-rc6-pax/arch/sparc64/mm/fault.c
--- linux-2.6.16-rc6-pax/arch/sparc64/mm/fault.c        2006-03-12 14:07:16.000000000 +0100
+++ linux-2.6.16-rc6-pax/arch/sparc64/mm/fault.c        2006-03-17 13:20:39.000000000 +0100
@@ -694,7 +694,7 @@
 #ifdef CONFIG_PAX_EMUPLT
                case 2:
                case 3:
-                       goto fault_done;
+                       return;
 #endif

                }

Re: grsecurity+kernel 2.6.14.6+sparc64

PostPosted: Sat Mar 18, 2006 5:03 pm
by osa
Thx it's working but now I have new problem, when I run gradm -E
I have get this messages
gradm -E
You are using incompatible versions of gradm and grsecurity.
Please update both versions to the ones available on the website.
Make sure your gradm has been compiled for the kernel you are currently running.


kernel currently runing - 2.6.14.6
patch - grsecurity-2.1.8-2.6.14.6-200601211647.patch
gradm - gradm-2.1.8-200601212342.tar.gz

Maybe it's a problem , when I changed this ?:
--- linux-2.6.16-rc6-pax/arch/sparc64/mm/fault.c 2006-03-12 14:07:16.000000000 +0100
+++ linux-2.6.16-rc6-pax/arch/sparc64/mm/fault.c 2006-03-17 13:20:39.000000000 +0100
@@ -694,7 +694,7 @@
#ifdef CONFIG_PAX_EMUPLT
case 2:
case 3:
- goto fault_done;
+ return;
#endif

PostPosted: Tue Mar 28, 2006 9:48 am
by osa
Hi

I geting , and compiing gradm2 with
Linux 2.4.27-2-sparc64 #1 Mon Aug 22 21:07:44 UTC 2005 sparc64
System is a debian sarge 3.1
cat /proc/version

cpu : TI UltraSparc II (BlackBird)
fpu : UltraSparc II integrated FPU
promlib : Version 3 Revision 16
prom : 3.16.1
type : sun4u
ncpus probed : 1
ncpus active : 1
Cpu0Bogo : 799.53
Cpu0ClkTck : 0000000017d78400
MMU Type : Spitfire

I have this error:

usr/bin/bison -b grlearn_config -p grlearn_config -d ./grlearn_config.y
/usr/bin/gcc -O2 -m64 -DGRSEC_DIR=\"/etc/grsec\" -c -o grlearn_config.tab.o grlearn_config.tab.c
/usr/bin/flex -B -Pgrlearn_config ./grlearn_config.l
/usr/bin/gcc -O2 -m64 -DGRSEC_DIR=\"/etc/grsec\" -c -o lex.grlearn_config.o lex.grlearn_config.c
/usr/bin/gcc -O2 -m64 -DGRSEC_DIR=\"/etc/grsec\" -o gradm gradm.tab.o lex.gradm.o learn_pass1.tab.o learn_pass2.tab.o fulllearn_pass1.tab.o fulllearn_pass2.tab.o fulllearn_pass3.tab.o gradm_misc.o gradm_parse.o gradm_arg.o gradm_pw.o gradm_opt.o gradm_cap.o gradm_sha256.o gradm_adm.o gradm_analyze.o gradm_res.o gradm_human.o gradm_learn.o gradm_net.o gradm_nest.o gradm_pax.o gradm_sym.o gradm_newlearn.o gradm_fulllearn.o gradm_lib.o lex.fulllearn_pass1.o lex.fulllearn_pass2.o lex.fulllearn_pass3.o lex.learn_pass1.o lex.learn_pass2.o grlearn_config.tab.o lex.grlearn_config.o
/usr/bin/ld: skipping incompatible /usr/lib/gcc/sparc-linux/3.4.4/../../../libc.so when searching for -lc
/usr/bin/ld: skipping incompatible /usr/lib/gcc/sparc-linux/3.4.4/../../../libc.a when searching for -lc
/usr/bin/ld: skipping incompatible /usr/bin/../lib/libc.so when searching for -lc
/usr/bin/ld: skipping incompatible /usr/bin/../lib/libc.a when searching for -lc
/usr/bin/ld: skipping incompatible /usr/lib/libc.so when searching for -lc
/usr/bin/ld: skipping incompatible /usr/lib/libc.a when searching for -lc
/usr/bin/ld: cannot find -lc
collect2: ld returned 1 exit status
make: *** [gradm] Błąd 1


Any ideas?

osa

P.S It's working when installing libc6-dev-sparc64 (apt-get install libc6-dev-sparc64)

PostPosted: Thu Mar 30, 2006 2:41 pm
by PaX Team
osa wrote:Any ideas?

osa

P.S It's working when installing libc6-dev-sparc64 (apt-get install libc6-dev-sparc64)
gradm is built as a 64 bit application (vs. a more usual 32 bit one) hence you need the 64 bit libc to link against, as you found it out apparently ;-).