error: missing syscalls when compiling kernel module
Hi all. This is the error that I am getting when I try to compile a loadable module(it tries to intercept a system call by directly editing the sys_call_table in the memory):- make -C /lib/modules/2.6.32-504.1.3.el6.x86_64/build M= modules make[1]: Entering directory `/usr/src/kernels/2.6.32-504.1.3.el6.x86_64' make[2]: Nothing to be done for `all'. CHK include/linux/version.h CHK include/linux/utsrelease.h SYMLINK include/asm -> include/asm-x86 make[2]: *** No rule to make target `missing-syscalls'. Stop. make[1]: *** [prepare0] Error 2 make[1]: Leaving directory `/usr/src/kernels/2.6.32-504.1.3.el6.x86_64' make: *** [all] Error 2 The Makefile is:- obj-m +:= hijack.o PWD := $(pwd) all: make -C /lib/modules/2.6.32-504.1.3.el6.x86_64/build M=$(PWD) modules clean: make -C /lib/modules/2.6.32-504.1.3.el6.x86_64/build M=$(PWD) clean I have googled the error but most links are unresolved. I am trying to install this against the currently running kernel and not the complete source.
On Mon, 2015-02-16 at 12:14 +0530, noyb noybee wrote:
Hi all. This is the error that I am getting when I try to compile a loadable module(it tries to intercept a system call by directly editing the sys_call_table in the memory):-
make -C /lib/modules/2.6.32-504.1.3.el6.x86_64/build M= modules make[1]: Entering directory `/usr/src/kernels/2.6.32-504.1.3.el6.x86_64' make[2]: Nothing to be done for `all'. CHK include/linux/version.h CHK include/linux/utsrelease.h SYMLINK include/asm -> include/asm-x86 make[2]: *** No rule to make target `missing-syscalls'. Stop. make[1]: *** [prepare0] Error 2 make[1]: Leaving directory `/usr/src/kernels/2.6.32-504.1.3.el6.x86_64' make: *** [all] Error 2
The Makefile is:-
obj-m +:= hijack.o
You want ":=" here. "+:=" gives Makefile:1: *** empty variable name. Stop. when I try it.
PWD := $(pwd)
I think this line sets the value of variable PWD to the value of the variable pwd, which is probably empty. Look at "M=" in the output you quoted above.
all: make -C /lib/modules/2.6.32-504.1.3.el6.x86_64/build M=$(PWD) modules clean: make -C /lib/modules/2.6.32-504.1.3.el6.x86_64/build M=$(PWD) clean
I have googled the error but most links are unresolved. I am trying to install this against the currently running kernel and not the complete source.
I'm not sure what you're trying to do here, and I'm not really comfortable reading Makefiles. But the examples in "3. Creating a Kbuild File for an External Module" in Documentation/kbuild/modules.txt suggest you could also drop the assignment to PWD and use 'M=$$PWD' in those two lines. Hope this helps, Paul Bolle
Replace PWD=$(pwd) with PWD=$(shell pwd) On Mon, Feb 16, 2015 at 1:53 PM, Paul Bolle <pebolle@tiscali.nl> wrote:
On Mon, 2015-02-16 at 12:14 +0530, noyb noybee wrote:
Hi all. This is the error that I am getting when I try to compile a loadable module(it tries to intercept a system call by directly editing the sys_call_table in the memory):-
make -C /lib/modules/2.6.32-504.1.3.el6.x86_64/build M= modules make[1]: Entering directory `/usr/src/kernels/2.6.32-504.1.3.el6.x86_64' make[2]: Nothing to be done for `all'. CHK include/linux/version.h CHK include/linux/utsrelease.h SYMLINK include/asm -> include/asm-x86 make[2]: *** No rule to make target `missing-syscalls'. Stop. make[1]: *** [prepare0] Error 2 make[1]: Leaving directory `/usr/src/kernels/2.6.32-504.1.3.el6.x86_64' make: *** [all] Error 2
The Makefile is:-
obj-m +:= hijack.o
You want ":=" here. "+:=" gives Makefile:1: *** empty variable name. Stop.
when I try it.
PWD := $(pwd)
I think this line sets the value of variable PWD to the value of the variable pwd, which is probably empty. Look at "M=" in the output you quoted above.
all: make -C /lib/modules/2.6.32-504.1.3.el6.x86_64/build M=$(PWD) modules clean: make -C /lib/modules/2.6.32-504.1.3.el6.x86_64/build M=$(PWD) clean
I have googled the error but most links are unresolved. I am trying to install this against the currently running kernel and not the complete source.
I'm not sure what you're trying to do here, and I'm not really comfortable reading Makefiles. But the examples in "3. Creating a Kbuild File for an External Module" in Documentation/kbuild/modules.txt suggest you could also drop the assignment to PWD and use 'M=$$PWD' in those two lines.
Hope this helps,
Paul Bolle
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
On Mon, 16 Feb 2015 12:14:59 +0530, noyb noybee said:
Hi all. This is the error that I am getting when I try to compile a loadable module(it tries to intercept a system call by directly editing the sys_call_table in the memory):-
In general, that's a *really* bad idea, for numerous reasons. What problem are you trying to solve by intercepting a system call?
On Tue, Feb 17, 2015 at 12:21 AM, <Valdis.Kletnieks@vt.edu> wrote:
On Mon, 16 Feb 2015 12:14:59 +0530, noyb noybee said:
Hi all. This is the error that I am getting when I try to compile a loadable module(it tries to intercept a system call by directly editing the sys_call_table in the memory):-
In general, that's a *really* bad idea, for numerous reasons. What problem are you trying to solve by intercepting a system call?
by any chance - is this related to Eudyptula Challenge? it looks similar to one of the tasks which involves modifying the system call table...... regards sudip
participants (5)
-
Kapil Mathur -
noyb noybee -
Paul Bolle -
Sudip Mukherjee -
Valdis.Kletnieks@vt.edu