Page 1 of 1

GRADM will not compile

PostPosted: Fri Aug 03, 2012 7:37 pm
by heellolls
I have successfully patched kernel 3.2.24 with the grs security patch and have it installed and running. /dev/grsec exists. When I compile it exits with error 1. I am running Ubuntu 12.04.
Code: Select all
$ uname -a
Linux c 3.2.24-grs-grsec #1 SMP PREEMPT Wed Aug 1 18:08:14 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux
c@c:~$ cd /home/c/Desktop/gdm
c@c:~/Desktop/gdm$ tar xzf gradm-2.9.1-201207201554.tar.gz
c@c:~/Desktop/gdm$ cd gradm2/
c@c:~/Desktop/gdm/gradm2$ make nopam
/usr/bin/bison -b gradm -p gradm -d ./gradm.y
/usr/bin/gcc -O2 -m64 -Wcast-qual -DGRSEC_DIR=\"/etc/grsec\" -D_LARGEFILE64_SOURCE   -c -o gradm.tab.o gradm.tab.c
/usr/bin/flex -B -Pgradm ./gradm.l
/usr/bin/gcc -O2 -m64 -Wcast-qual -DGRSEC_DIR=\"/etc/grsec\" -D_LARGEFILE64_SOURCE   -c -o lex.gradm.o lex.gradm.c
/usr/bin/bison -b learn_pass1 -p learn_pass1 -d ./gradm_learn_pass1.y
/usr/bin/gcc -O2 -m64 -Wcast-qual -DGRSEC_DIR=\"/etc/grsec\" -D_LARGEFILE64_SOURCE   -c -o learn_pass1.tab.o learn_pass1.tab.c
/usr/bin/bison -b learn_pass2 -p learn_pass2 -d ./gradm_learn_pass2.y
/usr/bin/gcc -O2 -m64 -Wcast-qual -DGRSEC_DIR=\"/etc/grsec\" -D_LARGEFILE64_SOURCE   -c -o learn_pass2.tab.o learn_pass2.tab.c
/usr/bin/bison -b fulllearn_pass1 -p fulllearn_pass1 -d ./gradm_fulllearn_pass1.y
/usr/bin/gcc -O2 -m64 -Wcast-qual -DGRSEC_DIR=\"/etc/grsec\" -D_LARGEFILE64_SOURCE   -c -o fulllearn_pass1.tab.o fulllearn_pass1.tab.c
/usr/bin/bison -b fulllearn_pass2 -p fulllearn_pass2 -d ./gradm_fulllearn_pass2.y
/usr/bin/gcc -O2 -m64 -Wcast-qual -DGRSEC_DIR=\"/etc/grsec\" -D_LARGEFILE64_SOURCE   -c -o fulllearn_pass2.tab.o fulllearn_pass2.tab.c
/usr/bin/bison -b fulllearn_pass3 -p fulllearn_pass3 -d ./gradm_fulllearn_pass3.y
/usr/bin/gcc -O2 -m64 -Wcast-qual -DGRSEC_DIR=\"/etc/grsec\" -D_LARGEFILE64_SOURCE   -c -o fulllearn_pass3.tab.o fulllearn_pass3.tab.c
/usr/bin/gcc -O2 -m64 -Wcast-qual -DGRSEC_DIR=\"/etc/grsec\" -D_LARGEFILE64_SOURCE   -c -o gradm_misc.o gradm_misc.c
/usr/bin/gcc -O2 -m64 -Wcast-qual -DGRSEC_DIR=\"/etc/grsec\" -D_LARGEFILE64_SOURCE   -c -o gradm_parse.o gradm_parse.c
/usr/bin/gcc -O2 -m64 -Wcast-qual -DGRSEC_DIR=\"/etc/grsec\" -D_LARGEFILE64_SOURCE   -c -o gradm_arg.o gradm_arg.c
/usr/bin/gcc -O2 -m64 -Wcast-qual -DGRSEC_DIR=\"/etc/grsec\" -D_LARGEFILE64_SOURCE   -c -o gradm_pw.o gradm_pw.c
/usr/bin/gcc -O2 -m64 -Wcast-qual -DGRSEC_DIR=\"/etc/grsec\" -D_LARGEFILE64_SOURCE   -c -o gradm_opt.o gradm_opt.c
gradm_opt.c: In function ‘expand_acls’:
gradm_opt.c:53:14: warning: ignoring return value of ‘readlink’, declared with attribute warn_unused_result [-Wunused-result]
/usr/bin/gcc -O2 -m64 -Wcast-qual -DGRSEC_DIR=\"/etc/grsec\" -D_LARGEFILE64_SOURCE   -c -o gradm_cap.o gradm_cap.c
/usr/bin/gcc -O2 -m64 -Wcast-qual -DGRSEC_DIR=\"/etc/grsec\" -D_LARGEFILE64_SOURCE   -c -o gradm_sha256.o gradm_sha256.c
/usr/bin/gcc -O2 -m64 -Wcast-qual -DGRSEC_DIR=\"/etc/grsec\" -D_LARGEFILE64_SOURCE   -c -o gradm_adm.o gradm_adm.c
gradm_adm.c: In function ‘start_grlearn’:
gradm_adm.c:366:3: warning: ignoring return value of ‘read’, declared with attribute warn_unused_result [-Wunused-result]
/usr/bin/gcc -O2 -m64 -Wcast-qual -DGRSEC_DIR=\"/etc/grsec\" -D_LARGEFILE64_SOURCE   -c -o gradm_analyze.o gradm_analyze.c
/usr/bin/gcc -O2 -m64 -Wcast-qual -DGRSEC_DIR=\"/etc/grsec\" -D_LARGEFILE64_SOURCE   -c -o gradm_res.o gradm_res.c
/usr/bin/gcc -O2 -m64 -Wcast-qual -DGRSEC_DIR=\"/etc/grsec\" -D_LARGEFILE64_SOURCE   -c -o gradm_human.o gradm_human.c
/usr/bin/gcc -O2 -m64 -Wcast-qual -DGRSEC_DIR=\"/etc/grsec\" -D_LARGEFILE64_SOURCE   -c -o gradm_learn.o gradm_learn.c
/usr/bin/gcc -O2 -m64 -Wcast-qual -DGRSEC_DIR=\"/etc/grsec\" -D_LARGEFILE64_SOURCE   -c -o gradm_net.o gradm_net.c
/usr/bin/gcc -O2 -m64 -Wcast-qual -DGRSEC_DIR=\"/etc/grsec\" -D_LARGEFILE64_SOURCE   -c -o gradm_nest.o gradm_nest.c
/usr/bin/gcc -O2 -m64 -Wcast-qual -DGRSEC_DIR=\"/etc/grsec\" -D_LARGEFILE64_SOURCE   -c -o gradm_pax.o gradm_pax.c
/usr/bin/gcc -O2 -m64 -Wcast-qual -DGRSEC_DIR=\"/etc/grsec\" -D_LARGEFILE64_SOURCE   -c -o gradm_sym.o gradm_sym.c
/usr/bin/gcc -O2 -m64 -Wcast-qual -DGRSEC_DIR=\"/etc/grsec\" -D_LARGEFILE64_SOURCE   -c -o gradm_newlearn.o gradm_newlearn.c
/usr/bin/gcc -O2 -m64 -Wcast-qual -DGRSEC_DIR=\"/etc/grsec\" -D_LARGEFILE64_SOURCE   -c -o gradm_fulllearn.o gradm_fulllearn.c
gradm_fulllearn.c: In function ‘output_learn_header’:
gradm_fulllearn.c:485:2: warning: format not a string literal and no format arguments [-Wformat-security]
/usr/bin/gcc -O2 -m64 -Wcast-qual -DGRSEC_DIR=\"/etc/grsec\" -D_LARGEFILE64_SOURCE   -c -o gradm_lib.o gradm_lib.c
/usr/bin/flex -B -Pfulllearn_pass1 ./gradm_fulllearn_pass1.l
/usr/bin/gcc -O2 -m64 -Wcast-qual -DGRSEC_DIR=\"/etc/grsec\" -D_LARGEFILE64_SOURCE   -c -o lex.fulllearn_pass1.o lex.fulllearn_pass1.c
/usr/bin/flex -B -Pfulllearn_pass2 ./gradm_fulllearn_pass2.l
/usr/bin/gcc -O2 -m64 -Wcast-qual -DGRSEC_DIR=\"/etc/grsec\" -D_LARGEFILE64_SOURCE   -c -o lex.fulllearn_pass2.o lex.fulllearn_pass2.c
/usr/bin/flex -B -Pfulllearn_pass3 ./gradm_fulllearn_pass3.l
/usr/bin/gcc -O2 -m64 -Wcast-qual -DGRSEC_DIR=\"/etc/grsec\" -D_LARGEFILE64_SOURCE   -c -o lex.fulllearn_pass3.o lex.fulllearn_pass3.c
/usr/bin/flex -B -Plearn_pass1 ./gradm_learn_pass1.l
/usr/bin/gcc -O2 -m64 -Wcast-qual -DGRSEC_DIR=\"/etc/grsec\" -D_LARGEFILE64_SOURCE   -c -o lex.learn_pass1.o lex.learn_pass1.c
/usr/bin/flex -B -Plearn_pass2 ./gradm_learn_pass2.l
/usr/bin/gcc -O2 -m64 -Wcast-qual -DGRSEC_DIR=\"/etc/grsec\" -D_LARGEFILE64_SOURCE   -c -o lex.learn_pass2.o lex.learn_pass2.c
/usr/bin/bison -b grlearn_config -p grlearn_config -d ./grlearn_config.y
/usr/bin/gcc -O2 -m64 -Wcast-qual -DGRSEC_DIR=\"/etc/grsec\" -D_LARGEFILE64_SOURCE   -c -o grlearn_config.tab.o grlearn_config.tab.c
/usr/bin/flex -B -Pgrlearn_config ./grlearn_config.l
/usr/bin/gcc -O2 -m64 -Wcast-qual -DGRSEC_DIR=\"/etc/grsec\" -D_LARGEFILE64_SOURCE   -c -o lex.grlearn_config.o lex.grlearn_config.c
/usr/bin/gcc -O2 -m64 -Wcast-qual -DGRSEC_DIR=\"/etc/grsec\" -D_LARGEFILE64_SOURCE   -c -o gradm_globals.o gradm_globals.c
/usr/bin/gcc -O2 -m64 -Wcast-qual -DGRSEC_DIR=\"/etc/grsec\" -D_LARGEFILE64_SOURCE   -c -o gradm_replace.o gradm_replace.c
/usr/bin/gcc -O2 -m64 -Wcast-qual -DGRSEC_DIR=\"/etc/grsec\" -D_LARGEFILE64_SOURCE -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 gradm_globals.o gradm_replace.o 
/usr/bin/bison -b grlearn2_config -p grlearn2_config -d ./grlearn2_config.y
/usr/bin/gcc -O2 -m64 -Wcast-qual -DGRSEC_DIR=\"/etc/grsec\" -D_LARGEFILE64_SOURCE -DIS_GRLEARN -o grlearn grlearn.c gradm_lib.c gradm_globals.c grlearn2_config.tab.c lex.grlearn_config.c

and
Code: Select all
gradm2$ sudo make install
[sudo] password for c:
Installing gradm...
Installing grlearn...
Installing gradm manpage...
Could not open /dev/grsec.
open: No such device or address

make: *** [install] Error 1

Re: GRADM will not compile

PostPosted: Sun Aug 05, 2012 5:01 pm
by spender
The install runs gradm -P which can only be run on a kernel with grsecurity active. It's the last stage of the install, so it's fine to just reboot into the new kernel then either run make install again or gradm -P manually.

-Brad