Linux-Kernel-System-Call | system call named processinfo to the Linux kernel
kandi X-RAY | Linux-Kernel-System-Call Summary
kandi X-RAY | Linux-Kernel-System-Call Summary
This is the implementation of a system call named processinfo to the Linux kernel.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of Linux-Kernel-System-Call
Linux-Kernel-System-Call Key Features
Linux-Kernel-System-Call Examples and Code Snippets
Community Discussions
Trending Discussions on Linux-Kernel-System-Call
QUESTION
Consider the following question on Stack Overflow on system call hooking by modifying the sys_call_table
.
https://stackoverflow.com/questions/2103315/linux-kernel-system-call-hooking-example
Since CR0 "Write Protect" (bit 16) controls whether it's possible for the kernel to write to read-only pages, why does some code then calls set_memory_rw
to set the permissions for the target pages to RW?
ANSWER
Answered 2021-May-12 at 09:53No.
The CR0.WP
method disables write protect support globally, whereas the set_memory_rw
method merely adds the write bit to specific pages. If you have already disabled write protection through the control register, then there is no need to do anything else. All kernel memory will be globally writable from within the kernel until you re-enable write protection through the same register.
Make sure you disable interrupts before writing to CR0
, then re-enable them afterwards.
QUESTION
I am trying to hook a system call from a linux kernel custom module.
The module loads but printk
doesn't seem to print anything to dmesg from the new function.
ANSWER
Answered 2020-Sep-24 at 12:28Turned out I had to replace openat
instead of open
. And the way you do it is:
QUESTION
I was learning about Linux Kernel in one of the course. I got to know that the C library returns -1
on error and sets the errno
variable to actual error. Below is the lecture slide which says the same thing.
My question is, why can't the C library return the return code directly instead of returning -1
?
Note: This question may seem duplicate of this one. But referenced question answers what, my question is more related to the why.
...ANSWER
Answered 2020-Jun-03 at 11:34I think there are some possible reasons.
Firstly, this design is normal in C/C++, we get a return noted successful/fail, and if you want to get detail error message you can get it. This makes the return more uniform, and it becomes a normal use way. What's more, there maybe some time you just need to check whether a function works or not, you don't need to get the answer.
Secondly, this may be a historical design remained. There are many old desgin of C/C++, the reason we still remain them is because the cost of change it is too heavy and we don't get anything wrong if we don't change it.
I'm not sure my answer is totaly right, they're just some possible reasons and may help you.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install Linux-Kernel-System-Call
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page