A user can link a module into the running kernel by executing the insmod external program. This program performs the following operations:
Reads from the command line the name of the module to be linked.
Locates the file containing the module's object code in the system directory tree. The file is usually placed in some subdirectory below /lib/modules.
Reads from disk the file containing the module's object code.
system call, passing to it the address of the User Mode buffer
containing the module's object code, the length of the object code,
and the User Mode memory area containing the parameters of the
sys_init_module( ) service
routine does all the real work; it performs the following main
Checks whether the user is allowed to link the module (the
current process must have the
CAP_SYS_MODULE capability). In every
situation where one is adding functionality to a kernel, which has
access to all data and processes on the system, security is a
Allocates a temporary memory area for the module's object code; then, copies into this memory area the data in the User Mode buffer passed as first parameter of the system call.
Checks that the data in the memory area effectively represents a module's ELF object; otherwise, returns an error code.
Allocates a memory area for the parameters passed to the insmod program, and fills it with the data in the User Mode buffer whose address ...