IS NETLINK Socket be used to enter the kernel mode from the user mode.How can we implement the system call functionality using the NETLINK Socket as both jumps from the user mode to kernel mode?IMHO if at all it is possible?. RGds, Softy
Asked
Active
Viewed 1,593 times
1 Answers
2
There are two ways for user application to enter the [Unix] kernel (meaning have the kernel code execute directly on behalf of the user-mode process):
- Make a system call, i.e. explicitly request service from the kernel
- trap into the kernel because of either:
- an error (segmentation violation, invalid instruction, etc.) - this is fatal,
- or a page fault - accessing mapped, but not resident memory page.
netlink(7)
, on the other hand, is a Linux-specific notification and configuration mechanism, which you access via regular system calls like socket(2)
, sendmsg(2)
, etc. It allows you to receive and send information from and to the kernel.
Thus strictly speaking, no, netlink(7)
does not allow you to enter kernel mode.

Nikolai Fetissov
- 82,306
- 11
- 110
- 171
-
just came across this link. http://stackoverflow.com/questions/4440584/kernel-space-user-space-communication-with-netlink – Raulp May 18 '12 at 19:38
-
this as well http://www.linuxjournal.com/node/7356/print and this http://1984.lsi.us.es/~pablo/docs/spae.pdf ....imho i thing i must read this first .You still believe netlink are not used to communicate from user to kernel space(mode) – Raulp May 18 '12 at 19:40
-
Read the answer again - the actual entry to the kernel when interacting with a netlink socket is accomplished by ordinary syscalls such as socket and sendmsg. – Chris Stratton May 18 '12 at 23:32
-
Though one could go a step further and observe that while a netlink sendmsg is really just data identifying a particular socket to sendmsg(), on most architectures, a syscall itself is just data (syscall number) to a type of trap instruction. Conditional code in the kernel braches out from this narrow entry point to the kernel code appropriate to handle it. – Chris Stratton May 18 '12 at 23:33