User:Lkurusa/Drafts/VDSO

vDSO (virtual dynamic shared object) is a mechanism employed by the Linux kernel for exporting a carefully selected set of kernel space routines to user space applications so that applications can call these routines in-process, without incurring the performance penalty of a context switch that is inherent when calling these same routines in kernel space by means of the system call interface.

History
vDSO has been developed to replace the vsyscall interface while offering similar features and overcoming its limitations: small amount of allocated memory allowing only 4 system calls located at the same memory location in each process, compromising security. This security issue has been fixed by emulating a virtual system call, so applications still using the vsyscall interface are incurring a small performance hit.

Implementation details
vDSO uses existing standard mechanisms for linking and loading with userspace applications, via the Executable and Linkable Format (ELF) format.

In principle, vDSO is a simple ELF shared object allocated in every user space application's address space which exposes some kernel functionalities. vDSO is dynamically allocated (vsyscall was statically allocated) offering support for address space layout randomization, thus increasing defense against certain types of attacks. The use of dynamic allocation and the ELF format also allows for more than 4 virtual calls. vDSO links seamlessly into user-space application via the dynamic linker and glibc automatically uses vDSO functions if the currently running kernel supports them. Otherwise, a traditional system call is made.

Advantages
It helps to reduce the calling overhead on simple kernel routines, and also can work as a way to select the best system call method on some architectures.

An advantage over other methods is that such exported routines can provide proper DWARF (Debug With Attributed Record Format) debugging information.

Implementation generally implies hooks in the dynamic linker to find the vDSOs.