credentials link

This commit is contained in:
Andriy Petrov 2024-04-25 22:05:17 +02:00
parent 29faf5bb06
commit fe03298689
2 changed files with 10 additions and 10 deletions

View File

@ -11,7 +11,7 @@ sudo insmod sumo.ko # install
# How it works
In it's `init()` function, *sumo* kernel module creates `/proc/sumo` file and waits for PID to be written. Afterwards, it fetches instance of a `task_struct` [kernel structure](https://medium.com/@boutnaru/linux-kernel-task-struct-829f51d97275) associated with the given PID and modifies its values accordingly.
In it's `init()` function, *sumo* kernel module creates `/proc/sumo` file and waits for PID to be written. Afterwards, it fetches instance of a `task_struct` [kernel structure](https://medium.com/@boutnaru/linux-kernel-task-struct-829f51d97275) associated with the given PID and modifies its values accordingly. The main point of interest is the data stored in [credentials structure](https://docs.kernel.org/security/credentials.html).
```text
sumo __ SUdo

8
sumo.c
View File

@ -4,10 +4,10 @@
#include <linux/proc_fs.h>
#include <linux/fs.h>
#include <linux/uaccess.h>
#include <linux/seq_file.h>
#include <linux/sched.h>
#include <linux/capability.h>
// #include <linux/uaccess.h>
// #include <linux/seq_file.h>
// #include <linux/sched.h>
// #include <linux/capability.h>
#include <linux/cred.h>