Dear progremmer:
when i compile it ,there are some errors ,can you help me
/home/wanglongjiang/aosp/kernel/prebuilts/5.10/arm64/hello-rootkit/hide_pid.c:23:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
struct hide_node hide_n=kmalloc(sizeof(struct hide_node),GFP_KERNEL);//申请空间存储hide node
^~
In file included from /home/wanglongjiang/aosp/kernel/prebuilts/5.10/arm64/hello-rootkit/rootkit.c:6:0:
/home/wanglongjiang/aosp/kernel/prebuilts/5.10/arm64/hello-rootkit/functions.c: In function ‘mywrite_cr0’:
/home/wanglongjiang/aosp/kernel/prebuilts/5.10/arm64/hello-rootkit/functions.c:102:36: error: ‘__force_order’ undeclared (first use in this function); did you mean ‘sgl_free_order’?
: "+r"(cr0), "+m"(__force_order));
^~~~~
sgl_free_order
/home/wanglongjiang/aosp/kernel/prebuilts/5.10/arm64/hello-rootkit/functions.c:102:36: note: each undeclared identifier is reported only once for each function it appears in
/home/wanglongjiang/aosp/kernel/prebuilts/5.10/arm64/hello-rootkit/functions.c: In function ‘exec_cmd’:
/home/wanglongjiang/aosp/kernel/prebuilts/5.10/arm64/hello-rootkit/functions.c:211:5: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
char cmd_argv[] = {cmd_path, "-c", tmp, NULL};
^~~~
/home/wanglongjiang/aosp/kernel/prebuilts/5.10/arm64/hello-rootkit/functions.c: In function ‘mywrite_cr0’:
/home/wanglongjiang/aosp/kernel/prebuilts/5.10/arm64/hello-rootkit/functions.c:101:5: error: invalid lvalue in asm output 1
asm volatile("mov %0,%%cr0"
^~~
/home/wanglongjiang/aosp/kernel/prebuilts/5.10/arm64/hello-rootkit/functions.c:101:5: error: memory input 3 is not directly addressable
In file included from /home/wanglongjiang/aosp/kernel/prebuilts/5.10/arm64/hello-rootkit/functions.c:7:0,
from /home/wanglongjiang/aosp/kernel/prebuilts/5.10/arm64/hello-rootkit/rootkit.c:6:
At top level:
/home/wanglongjiang/aosp/kernel/prebuilts/5.10/arm64/hello-rootkit/rootkit.h:42:20: warning: ‘real_sys_bind’ defined but not used [-Wunused-variable]
static syscall_fun real_sys_bind;
^~~~~
scripts/Makefile.build:270: recipe for target '/home/wanglongjiang/aosp/kernel/prebuilts/5.10/arm64/hello-rootkit/rootkit.o' failed
make[2]: [/home/wanglongjiang/aosp/kernel/prebuilts/5.10/arm64/hello-rootkit/rootkit.o] Error 1
Makefile:1767: recipe for target '/home/wanglongjiang/aosp/kernel/prebuilts/5.10/arm64/hello-rootkit' failed
make[1]: [/home/wanglongjiang/aosp/kernel/prebuilts/5.10/arm64/hello-rootkit] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.4.0-146-generic'
Makefile:15: recipe for target 'rootkit' failed
make: *** [rootkit] Error 2
Dear progremmer: when i compile it ,there are some errors ,can you help me /home/wanglongjiang/aosp/kernel/prebuilts/5.10/arm64/hello-rootkit/hide_pid.c:23:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] struct hide_node hide_n=kmalloc(sizeof(struct hide_node),GFP_KERNEL);//申请空间存储hide node ^
~In file included from /home/wanglongjiang/aosp/kernel/prebuilts/5.10/arm64/hello-rootkit/rootkit.c:6:0: /home/wanglongjiang/aosp/kernel/prebuilts/5.10/arm64/hello-rootkit/functions.c: In function ‘mywrite_cr0’: /home/wanglongjiang/aosp/kernel/prebuilts/5.10/arm64/hello-rootkit/functions.c:102:36: error: ‘__force_order’ undeclared (first use in this function); did you mean ‘sgl_free_order’? : "+r"(cr0), "+m"(__force_order)); ^~~~~ sgl_free_order /home/wanglongjiang/aosp/kernel/prebuilts/5.10/arm64/hello-rootkit/functions.c:102:36: note: each undeclared identifier is reported only once for each function it appears in /home/wanglongjiang/aosp/kernel/prebuilts/5.10/arm64/hello-rootkit/functions.c: In function ‘exec_cmd’: /home/wanglongjiang/aosp/kernel/prebuilts/5.10/arm64/hello-rootkit/functions.c:211:5: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] char cmd_argv[] = {cmd_path, "-c", tmp, NULL}; ^~~~ /home/wanglongjiang/aosp/kernel/prebuilts/5.10/arm64/hello-rootkit/functions.c: In function ‘mywrite_cr0’: /home/wanglongjiang/aosp/kernel/prebuilts/5.10/arm64/hello-rootkit/functions.c:101:5: error: invalid lvalue in asm output 1 asm volatile("mov %0,%%cr0" ^~~ /home/wanglongjiang/aosp/kernel/prebuilts/5.10/arm64/hello-rootkit/functions.c:101:5: error: memory input 3 is not directly addressable In file included from /home/wanglongjiang/aosp/kernel/prebuilts/5.10/arm64/hello-rootkit/functions.c:7:0, from /home/wanglongjiang/aosp/kernel/prebuilts/5.10/arm64/hello-rootkit/rootkit.c:6: At top level: /home/wanglongjiang/aosp/kernel/prebuilts/5.10/arm64/hello-rootkit/rootkit.h:42:20: warning: ‘real_sys_bind’ defined but not used [-Wunused-variable] static syscall_fun real_sys_bind; ^~~~~ scripts/Makefile.build:270: recipe for target '/home/wanglongjiang/aosp/kernel/prebuilts/5.10/arm64/hello-rootkit/rootkit.o' failed make[2]: [/home/wanglongjiang/aosp/kernel/prebuilts/5.10/arm64/hello-rootkit/rootkit.o] Error 1 Makefile:1767: recipe for target '/home/wanglongjiang/aosp/kernel/prebuilts/5.10/arm64/hello-rootkit' failed make[1]: [/home/wanglongjiang/aosp/kernel/prebuilts/5.10/arm64/hello-rootkit] Error 2 make[1]: Leaving directory '/usr/src/linux-headers-5.4.0-146-generic' Makefile:15: recipe for target 'rootkit' failed make: *** [rootkit] Error 2