Skip to content

Commit 4cca52b

Browse files
committed
proc_trav for 2.6.30
1 parent 9d599ef commit 4cca52b

File tree

2 files changed

+24
-12
lines changed

2 files changed

+24
-12
lines changed

process/Makefile

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
TARGET=proc_trav
2+
obj-m +=$(TARGET).o
3+
4+
all:
5+
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
6+
7+
clean:
8+
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
9+
10+
check-syntax:
11+
LANG=C make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
12+
13+
install:
14+
sudo insmod $(TARGET).ko
15+
16+
uninstall:
17+
sudo rmmod $(TARGET)

process/proc_trav.c

+7-12
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#include <linux/unistd.h> /* The list of system calls */
1919

2020
#include <linux/mm.h> /* VM_READ etc */
21-
#include <asm-x86/cacheflush.h> /* change_page_attr */
2221

2322
/*
2423
* For the current (process) structure, we need
@@ -35,21 +34,17 @@ MODULE_LICENSE("GPL");
3534
*/
3635
int init_module()
3736
{
38-
int i;
3937
struct task_struct *task = &init_task;
4038

4139
do {
42-
if (task->uid == initial_uid) {
43-
printk(KERN_INFO "*** %s [%d] parent %s\n",
44-
task->comm, task->trace_nid, task->parent->comm);
45-
task->trace_nid != ;
46-
} else {
47-
48-
}
49-
50-
if (task->trace_nid != 123) {
40+
printk(KERN_INFO "*** %s [%d] parent %s\n",
41+
task->comm, task->pid, task->parent->comm);
42+
// task->trace_nid != ;
43+
/*
44+
if (task->trace_nid != 123) {
5145
printk(KERN_INFO "Fucking trace_nid %d\n", task->trace_nid);
52-
}
46+
}
47+
*/
5348
} while ((task = next_task(task)) != &init_task);
5449
return 0;
5550
}

0 commit comments

Comments
 (0)