Linux内核-通过模块动态添加系统调用 [英] Linux kernel - add system call dynamically through module

查看:365
本文介绍了Linux内核-通过模块动态添加系统调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法添加动态系统调用,例如通过模块?我找到了一些地方,可以通过更改sys_call_table[]数组来覆盖模块来覆盖现有的系统调用,以获取覆盖的函数而不是安装模块时的本机函数,但是您可以使用新的系统调用和一个模块?

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?

推荐答案

不,sys_call_table具有固定大小:

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.

这篇关于Linux内核-通过模块动态添加系统调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆