Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20180204190411.GA11293@pi3.com.pl>
Date: Sun, 4 Feb 2018 20:04:11 +0100
From: Adam Zabrocki <pi3@....com.pl>
To: lkrg-users@...ts.openwall.com
Subject: Re: How to compile?

Hi,

Thanks for the build log. In your previous emails you didn't include why build
process failed. Please find out some of my comments inline:

On Sun, Feb 04, 2018 at 04:07:02PM +0000, Kamil Kapturkiewicz wrote:
> On 04/02/18 13:09, Solar Designer wrote:
> > On Sun, Feb 04, 2018 at 02:01:10PM +0100, Solar Designer wrote:
> >> On Sat, Feb 03, 2018 at 08:39:08PM +0000, Kamil Kapturkiewicz wrote:
> >>> mkdir -p "output"
> >>> mv /p_lkrg.ko "output"
> >> Makefile uses $(PWD), and the above suggests that it's not defined.
> >>
> >> Try:
> >>
> >> make PWD=.
> > This fails because $(PWD) is then passed into sub-makes, which may
> > change the current directory.
> >
> >> or:
> >>
> >> make PWD=`pwd`
> > This works for me, tested with:
> >
> > unset PWD # to invoke the problem reported by Kamil
> > make clean PWD=`pwd` && make -j8 PWD=`pwd`
> >
> >> Adam will probably want to fix the Makefile to remove the dependency on
> >> PWD being previously defined.
> > Alexander
> 
> Still no luck:
> 
> As root:
> 
> 15:57 root@...esktop: /home/horizn/Downloads/lkrg-main # make clean 
> PWD=`pwd` && make -j8 PWD=`pwd`
> make -C /lib/modules/4.4.111/build M=/home/horizn/Downloads/lkrg-main clean
> make[1]: Entering directory '/usr/src/linux-4.4.111'
> make[1]: Leaving directory '/usr/src/linux-4.4.111'
> rm -f Module.markers modules.order
> rm -f 
> /home/horizn/Downloads/lkrg-main/src/modules/kmod/client/kmod/Module.markers
> rm -f 
> /home/horizn/Downloads/lkrg-main/src/modules/kmod/client/kmod/modules.order
> rm -f -rf "output"
> make -C /lib/modules/4.4.111/build M=/home/horizn/Downloads/lkrg-main 
> modules
> make[1]: Entering directory '/usr/src/linux-4.4.111'
>    CC [M] 
> /home/horizn/Downloads/lkrg-main/src/modules/ksyms/p_resolve_ksym.o
>    CC [M] 
> /home/horizn/Downloads/lkrg-main/src/modules/hashing/p_lkrg_fast_hash.o
>    CC [M] /home/horizn/Downloads/lkrg-main/src/modules/wrap/p_struct_wrap.o
>    CC [M] 
> /home/horizn/Downloads/lkrg-main/src/modules/comm_channel/p_comm_channel.o
>    CC [M] 
> /home/horizn/Downloads/lkrg-main/src/modules/integrity_timer/p_integrity_timer.o
>    CC [M] /home/horizn/Downloads/lkrg-main/src/modules/kmod/p_kmod.o
>    CC [M] 
> /home/horizn/Downloads/lkrg-main/src/modules/database/arch/x86/IDT_MSR_CRx.o
>    CC [M] /home/horizn/Downloads/lkrg-main/src/modules/database/CPU.o
> In file included from 
> /home/horizn/Downloads/lkrg-main/src/modules/integrity_timer/p_integrity_timer.c:23:0:
> /home/horizn/Downloads/lkrg-main/src/modules/integrity_timer/p_stext_diff.c:82:18: 
> error: 'JUMP_LABEL_NOP_SIZE' undeclared here (not in a function)
>   char p_white_nop[JUMP_LABEL_NOP_SIZE] = { STATIC_KEY_INIT_NOP };
>                    ^

If you version of kernel doesn't define JUMP_LABEL_NOP_SIZE (it looks like
4.4.11 vanilla kernel defined it correctly) please manually define it as:

#define JUMP_LABEL_NOP_SIZE 5

The problem I can see, if during compilation process JUMP_LABEL_NOP_SIZE is not 
visible, it is very likely that STATIC_KEY_INIT_NOP won't be too. But let's 
check it later.

> /home/horizn/Downloads/lkrg-main/src/modules/wrap/p_struct_wrap.c: In 
> function 'p_module_core':
> /home/horizn/Downloads/lkrg-main/src/modules/wrap/p_struct_wrap.c:88:16: 
> error: 'struct module' has no member named 'core_layout'
>      return p_mod->core_layout.base;
>                  ^

This and further errors are the results of the patch:

http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/diff/include/linux/module.h?id=7523e4dc5057

It looks like you still didn't modify following file "lkrg-main/src/modules/kmod/p_kmod_wrapper.c"
Please make sure to change this line:

#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 6)

to be e.g.:

#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0)

or in the worst case please completely delete definition of the functions under 
#if LINUX_VERSION_CODE... and just leave the one under #else block.

Thanks,
Adam


> /home/horizn/Downloads/lkrg-main/src/modules/wrap/p_struct_wrap.c: In 
> function 'p_core_size':
> /home/horizn/Downloads/lkrg-main/src/modules/wrap/p_struct_wrap.c:92:16: 
> error: 'struct module' has no member named 'core_layout'
>      return p_mod->core_layout.size;
>                  ^
> /home/horizn/Downloads/lkrg-main/src/modules/wrap/p_struct_wrap.c: In 
> function 'p_core_text_size':
> /home/horizn/Downloads/lkrg-main/src/modules/wrap/p_struct_wrap.c:96:16: 
> error: 'struct module' has no member named 'core_layout'
>      return p_mod->core_layout.text_size;
>                  ^
> /home/horizn/Downloads/lkrg-main/src/modules/wrap/p_struct_wrap.c: In 
> function 'p_init_text_size':
> /home/horizn/Downloads/lkrg-main/src/modules/wrap/p_struct_wrap.c:100:16: 
> error: 'struct module' has no member named 'init_layout'
>      return p_mod->init_layout.text_size;
>                  ^
> /home/horizn/Downloads/lkrg-main/src/modules/wrap/p_struct_wrap.c: In 
> function 'p_module_core':
> /home/horizn/Downloads/lkrg-main/src/modules/wrap/p_struct_wrap.c:89:1: 
> warning: control reaches end of non-void function [-Wreturn-type]
>   }
>   ^
> /home/horizn/Downloads/lkrg-main/src/modules/wrap/p_struct_wrap.c: In 
> function 'p_core_size':
> /home/horizn/Downloads/lkrg-main/src/modules/wrap/p_struct_wrap.c:93:1: 
> warning: control reaches end of non-void function [-Wreturn-type]
>   }
>   ^
> /home/horizn/Downloads/lkrg-main/src/modules/wrap/p_struct_wrap.c: In 
> function 'p_core_text_size':
> /home/horizn/Downloads/lkrg-main/src/modules/wrap/p_struct_wrap.c:97:1: 
> warning: control reaches end of non-void function [-Wreturn-type]
>   }
>   ^
> /home/horizn/Downloads/lkrg-main/src/modules/wrap/p_struct_wrap.c: In 
> function 'p_init_text_size':
> /home/horizn/Downloads/lkrg-main/src/modules/wrap/p_struct_wrap.c:101:1: 
> warning: control reaches end of non-void function [-Wreturn-type]
>   }
>   ^
> scripts/Makefile.build:258: recipe for target 
> '/home/horizn/Downloads/lkrg-main/src/modules/wrap/p_struct_wrap.o' failed
> make[2]: *** 
> [/home/horizn/Downloads/lkrg-main/src/modules/wrap/p_struct_wrap.o] Error 1
> make[2]: *** Waiting for unfinished jobs....
> scripts/Makefile.build:258: recipe for target 
> '/home/horizn/Downloads/lkrg-main/src/modules/integrity_timer/p_integrity_timer.o' 
> failed
> make[2]: *** 
> [/home/horizn/Downloads/lkrg-main/src/modules/integrity_timer/p_integrity_timer.o] 
> Error 1
> Makefile:1408: recipe for target 
> '_module_/home/horizn/Downloads/lkrg-main' failed
> make[1]: *** [_module_/home/horizn/Downloads/lkrg-main] Error 2
> make[1]: Leaving directory '/usr/src/linux-4.4.111'
> Makefile:66: recipe for target 'all' failed
> make: *** [all] Error 2
> 
> As normal user:
> 
> 16:01 horizn@...esktop: ~/Downloads/lkrg-main $ unset PWD
> 
> 16:01 horizn@...esktop: ~/Downloads/lkrg-main $ make clean PWD=`pwd` && 
> make -j8 PWD=`pwd`
> make -C /lib/modules/4.4.111/build M=/home/horizn/Downloads/lkrg-main clean
> make[1]: Entering directory '/usr/src/linux-4.4.111'
>    CLEAN   /home/horizn/Downloads/lkrg-main/.tmp_versions
> make[1]: Leaving directory '/usr/src/linux-4.4.111'
> rm -f Module.markers modules.order
> rm -f 
> /home/horizn/Downloads/lkrg-main/src/modules/kmod/client/kmod/Module.markers
> rm -f 
> /home/horizn/Downloads/lkrg-main/src/modules/kmod/client/kmod/modules.order
> rm -f -rf "output"
> make -C /lib/modules/4.4.111/build M=/home/horizn/Downloads/lkrg-main 
> modules
> make[1]: Entering directory '/usr/src/linux-4.4.111'
>    CC [M] 
> /home/horizn/Downloads/lkrg-main/src/modules/ksyms/p_resolve_ksym.o
>    CC [M] /home/horizn/Downloads/lkrg-main/src/modules/wrap/p_struct_wrap.o
>    CC [M] 
> /home/horizn/Downloads/lkrg-main/src/modules/comm_channel/p_comm_channel.o
>    CC [M] 
> /home/horizn/Downloads/lkrg-main/src/modules/hashing/p_lkrg_fast_hash.o
>    CC [M] 
> /home/horizn/Downloads/lkrg-main/src/modules/integrity_timer/p_integrity_timer.o
>    CC [M] /home/horizn/Downloads/lkrg-main/src/modules/kmod/p_kmod.o
>    CC [M] /home/horizn/Downloads/lkrg-main/src/modules/database/CPU.o
>    CC [M] 
> /home/horizn/Downloads/lkrg-main/src/modules/database/arch/x86/IDT_MSR_CRx.o
> In file included from 
> /home/horizn/Downloads/lkrg-main/src/modules/integrity_timer/p_integrity_timer.c:23:0:
> /home/horizn/Downloads/lkrg-main/src/modules/integrity_timer/p_stext_diff.c:82:18: 
> error: 'JUMP_LABEL_NOP_SIZE' undeclared here (not in a function)
>   char p_white_nop[JUMP_LABEL_NOP_SIZE] = { STATIC_KEY_INIT_NOP };
>                    ^
>    CC [M] /home/horizn/Downloads/lkrg-main/src/modules/database/p_database.o
>    CC [M] 
> /home/horizn/Downloads/lkrg-main/src/modules/notifiers/p_notifiers.o
> scripts/Makefile.build:258: recipe for target 
> '/home/horizn/Downloads/lkrg-main/src/modules/integrity_timer/p_integrity_timer.o' 
> failed
> make[2]: *** 
> [/home/horizn/Downloads/lkrg-main/src/modules/integrity_timer/p_integrity_timer.o] 
> Error 1
> make[2]: *** Waiting for unfinished jobs....
> /home/horizn/Downloads/lkrg-main/src/modules/wrap/p_struct_wrap.c: In 
> function 'p_module_core':
> /home/horizn/Downloads/lkrg-main/src/modules/wrap/p_struct_wrap.c:88:16: 
> error: 'struct module' has no member named 'core_layout'
>      return p_mod->core_layout.base;
>                  ^
> /home/horizn/Downloads/lkrg-main/src/modules/wrap/p_struct_wrap.c: In 
> function 'p_core_size':
> /home/horizn/Downloads/lkrg-main/src/modules/wrap/p_struct_wrap.c:92:16: 
> error: 'struct module' has no member named 'core_layout'
>      return p_mod->core_layout.size;
>                  ^
> /home/horizn/Downloads/lkrg-main/src/modules/wrap/p_struct_wrap.c: In 
> function 'p_core_text_size':
> /home/horizn/Downloads/lkrg-main/src/modules/wrap/p_struct_wrap.c:96:16: 
> error: 'struct module' has no member named 'core_layout'
>      return p_mod->core_layout.text_size;
>                  ^
> /home/horizn/Downloads/lkrg-main/src/modules/wrap/p_struct_wrap.c: In 
> function 'p_init_text_size':
> /home/horizn/Downloads/lkrg-main/src/modules/wrap/p_struct_wrap.c:100:16: 
> error: 'struct module' has no member named 'init_layout'
>      return p_mod->init_layout.text_size;
>                  ^
> /home/horizn/Downloads/lkrg-main/src/modules/wrap/p_struct_wrap.c: In 
> function 'p_module_core':
> /home/horizn/Downloads/lkrg-main/src/modules/wrap/p_struct_wrap.c:89:1: 
> warning: control reaches end of non-void function [-Wreturn-type]
>   }
>   ^
> /home/horizn/Downloads/lkrg-main/src/modules/wrap/p_struct_wrap.c: In 
> function 'p_core_size':
> /home/horizn/Downloads/lkrg-main/src/modules/wrap/p_struct_wrap.c:93:1: 
> warning: control reaches end of non-void function [-Wreturn-type]
>   }
>   ^
> /home/horizn/Downloads/lkrg-main/src/modules/wrap/p_struct_wrap.c: In 
> function 'p_core_text_size':
> /home/horizn/Downloads/lkrg-main/src/modules/wrap/p_struct_wrap.c:97:1: 
> warning: control reaches end of non-void function [-Wreturn-type]
>   }
>   ^
> /home/horizn/Downloads/lkrg-main/src/modules/wrap/p_struct_wrap.c: In 
> function 'p_init_text_size':
> /home/horizn/Downloads/lkrg-main/src/modules/wrap/p_struct_wrap.c:101:1: 
> warning: control reaches end of non-void function [-Wreturn-type]
>   }
>   ^
> scripts/Makefile.build:258: recipe for target 
> '/home/horizn/Downloads/lkrg-main/src/modules/wrap/p_struct_wrap.o' failed
> make[2]: *** 
> [/home/horizn/Downloads/lkrg-main/src/modules/wrap/p_struct_wrap.o] Error 1
> Makefile:1408: recipe for target 
> '_module_/home/horizn/Downloads/lkrg-main' failed
> make[1]: *** [_module_/home/horizn/Downloads/lkrg-main] Error 2
> make[1]: Leaving directory '/usr/src/linux-4.4.111'
> Makefile:66: recipe for target 'all' failed
> make: *** [all] Error 2
> 
> With sudo:
> 
> 16:05 horizn@...esktop: ~/Downloads/lkrg-main $ sudo make clean 
> PWD=`pwd` && make -j8 PWD=`pwd`
> make -C /lib/modules/4.4.111/build M=/home/horizn/Downloads/lkrg-main clean
> make[1]: Entering directory '/usr/src/linux-4.4.111'
>    CLEAN   /home/horizn/Downloads/lkrg-main/.tmp_versions
> make[1]: Leaving directory '/usr/src/linux-4.4.111'
> rm -f Module.markers modules.order
> rm -f 
> /home/horizn/Downloads/lkrg-main/src/modules/kmod/client/kmod/Module.markers
> rm -f 
> /home/horizn/Downloads/lkrg-main/src/modules/kmod/client/kmod/modules.order
> rm -f -rf "output"
> make -C /lib/modules/4.4.111/build M=/home/horizn/Downloads/lkrg-main 
> modules
> make[1]: Entering directory '/usr/src/linux-4.4.111'
>    CC [M] 
> /home/horizn/Downloads/lkrg-main/src/modules/ksyms/p_resolve_ksym.o
>    CC [M] 
> /home/horizn/Downloads/lkrg-main/src/modules/hashing/p_lkrg_fast_hash.o
>    CC [M] 
> /home/horizn/Downloads/lkrg-main/src/modules/comm_channel/p_comm_channel.o
>    CC [M] /home/horizn/Downloads/lkrg-main/src/modules/wrap/p_struct_wrap.o
>    CC [M] /home/horizn/Downloads/lkrg-main/src/modules/kmod/p_kmod.o
>    CC [M] 
> /home/horizn/Downloads/lkrg-main/src/modules/integrity_timer/p_integrity_timer.o
>    CC [M] /home/horizn/Downloads/lkrg-main/src/modules/database/CPU.o
>    CC [M] 
> /home/horizn/Downloads/lkrg-main/src/modules/database/arch/x86/IDT_MSR_CRx.o
> /home/horizn/Downloads/lkrg-main/src/modules/wrap/p_struct_wrap.c: In 
> function 'p_module_core':
> /home/horizn/Downloads/lkrg-main/src/modules/wrap/p_struct_wrap.c:88:16: 
> error: 'struct module' has no member named 'core_layout'
>      return p_mod->core_layout.base;
>                  ^
> /home/horizn/Downloads/lkrg-main/src/modules/wrap/p_struct_wrap.c: In 
> function 'p_core_size':
> /home/horizn/Downloads/lkrg-main/src/modules/wrap/p_struct_wrap.c:92:16: 
> error: 'struct module' has no member named 'core_layout'
>      return p_mod->core_layout.size;
>                  ^
> /home/horizn/Downloads/lkrg-main/src/modules/wrap/p_struct_wrap.c: In 
> function 'p_core_text_size':
> /home/horizn/Downloads/lkrg-main/src/modules/wrap/p_struct_wrap.c:96:16: 
> error: 'struct module' has no member named 'core_layout'
>      return p_mod->core_layout.text_size;
>                  ^
> /home/horizn/Downloads/lkrg-main/src/modules/wrap/p_struct_wrap.c: In 
> function 'p_init_text_size':
> /home/horizn/Downloads/lkrg-main/src/modules/wrap/p_struct_wrap.c:100:16: 
> error: 'struct module' has no member named 'init_layout'
>      return p_mod->init_layout.text_size;
>                  ^
> /home/horizn/Downloads/lkrg-main/src/modules/wrap/p_struct_wrap.c: In 
> function 'p_module_core':
> /home/horizn/Downloads/lkrg-main/src/modules/wrap/p_struct_wrap.c:89:1: 
> warning: control reaches end of non-void function [-Wreturn-type]
>   }
>   ^
> /home/horizn/Downloads/lkrg-main/src/modules/wrap/p_struct_wrap.c: In 
> function 'p_core_size':
> /home/horizn/Downloads/lkrg-main/src/modules/wrap/p_struct_wrap.c:93:1: 
> warning: control reaches end of non-void function [-Wreturn-type]
>   }
>   ^
> /home/horizn/Downloads/lkrg-main/src/modules/wrap/p_struct_wrap.c: In 
> function 'p_core_text_size':
> /home/horizn/Downloads/lkrg-main/src/modules/wrap/p_struct_wrap.c:97:1: 
> warning: control reaches end of non-void function [-Wreturn-type]
>   }
>   ^
> /home/horizn/Downloads/lkrg-main/src/modules/wrap/p_struct_wrap.c: In 
> function 'p_init_text_size':
> /home/horizn/Downloads/lkrg-main/src/modules/wrap/p_struct_wrap.c:101:1: 
> warning: control reaches end of non-void function [-Wreturn-type]
>   }
>   ^
> scripts/Makefile.build:258: recipe for target 
> '/home/horizn/Downloads/lkrg-main/src/modules/wrap/p_struct_wrap.o' failed
> make[2]: *** 
> [/home/horizn/Downloads/lkrg-main/src/modules/wrap/p_struct_wrap.o] Error 1
> make[2]: *** Waiting for unfinished jobs....
> In file included from 
> /home/horizn/Downloads/lkrg-main/src/modules/integrity_timer/p_integrity_timer.c:23:0:
> /home/horizn/Downloads/lkrg-main/src/modules/integrity_timer/p_stext_diff.c:82:18: 
> error: 'JUMP_LABEL_NOP_SIZE' undeclared here (not in a function)
>   char p_white_nop[JUMP_LABEL_NOP_SIZE] = { STATIC_KEY_INIT_NOP };
>                    ^
> scripts/Makefile.build:258: recipe for target 
> '/home/horizn/Downloads/lkrg-main/src/modules/integrity_timer/p_integrity_timer.o' 
> failed
> make[2]: *** 
> [/home/horizn/Downloads/lkrg-main/src/modules/integrity_timer/p_integrity_timer.o] 
> Error 1
> Makefile:1408: recipe for target 
> '_module_/home/horizn/Downloads/lkrg-main' failed
> make[1]: *** [_module_/home/horizn/Downloads/lkrg-main] Error 2
> make[1]: Leaving directory '/usr/src/linux-4.4.111'
> Makefile:66: recipe for target 'all' failed
> make: *** [all] Error 2
> 
> 16:05 horizn@...esktop: ~/Downloads/lkrg-main $ env | grep PWD
> OLDPWD=/home/horizn
> PWD=/home/horizn/Downloads/lkrg-main
> 
> -- 
> skype. kamil.kapturkiewicz
> tel/signal. +44 758 306 8467
> 

-- 
pi3 (pi3ki31ny) - pi3 (at) itsec pl
http://pi3.com.pl

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.