Linux kernel - add system call dynamically through module

kernel, kernel-module, linux, linux-kernel

Solution

No, `sys_call_table` is of fixed size:

const sys_call_ptr_t sys_call_table[__NR_syscall_max+1] = { ... 

The best you can do, as you probably already discovered, is to intercept existing system calls.

Problem

Is there any way to add a system call dynamic, such as through a module? I have found places where I can override an existing system call with a module by just changing the `sys_call_table[]` array to get my overridden function instead of the native when my module is installed, but can you do this with a new system call and a module?

Original source