Adding a “useful” syscall, usually inaccessible to a non-root user

I implemented a simple Hello World script with limited capabilities that simply switches from user mode to kernel mode, prints a message that is logged with kernel messages, and goes into user mode.

The next step for additional credit is to add a useful (new) syscall, which is usually not available to a non-root user.

Syscall may be as simple as we like, but I'm struggling to come up with any ideas ... can someone point me in the right direction or something that will be easy to implement? (The hint we were given is to use your new syscall for debugging purposes!)

+4
source share
5 answers

The kernel structures contain a lot of information about processes: page layout, memory statistics, I / O statistics and information about file files, information about processor planning, etc. Although most of them can be accessed by the user through things like the proc file system, getting this information programmatically may require parsing the output of proc , etc. Providing a way to get this type of process information (perhaps paying less attention to the security issues that may arise at the moment) may be helpful.

+2
source

A user usually cannot file ownership of a file owned by another user (of course, there are reasons for this!). You can implement syscall for this. Remember to clear the setuid bit!

+1
source

How easy is it to set the current uid process to 0, essentially a back door that gives root access to any user that calls it?

0
source

Perhaps a new call to specifically update the system date and time from a trusted NTP server? I believe that the average user cannot do this on their own.

How to change network settings? Release / renew DHCP lease or implement simple network locations, which are predefined batches of settings stored in the configuration file with administrator rights.

-1
source

The simplest task — for debugging — is to create a system call that would give you direct access to the printk kernel call!

-1
source

All Articles