拦截V4L2 IOCTL系统调用

发布于 2025-02-03 16:08:51 字数 263 浏览 3 评论 0原文

我有一个正常工作的参考程序,我正在尝试调试为什么我的程序无法正常工作。该程序对v4l2_ioctl()进行了一系列调用,我想将每个调用的参数打印为v4l2_ioctl()。有没有办法拦截这些电话而不必重新编译内核?

我尝试使用GDB,但是因为我没有讨论符号,所以我无法阅读参数。

有没有一种方法可以创建一个将转发到真实设备的虚拟设备,但在过程中登录?

我正在使用嵌入式设备上工作,因此内核有点……在功能上受到限制。

I have a reference program that's working correctly and I'm trying to debug why my program doesn't work correctly. The program makes a series of calls to v4l2_ioctl() and I'd like to print out the arguments to each call to v4l2_ioctl(). Is there a way to intercept these calls without having to recompile the kernel?

I've tried using gdb, however because I don't have debug symbols I cannot read the arguments.

Is there a way to create a virtual device that forwards to the real device, but logs in the process?

I'm working on an embedded device, so the kernel is a bit... constrained on features.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

娇柔作态 2025-02-10 16:08:52

假设您的内核构建中支持了可加载的内核模块(LKM)。您可以利用LKM作为rootkit来连接特定的 ftracable 内核函数。

检查此链接: linux root 2 part 2:ftrace and function and function hooking

Suppose a loadable kernel module(LKM) is supported in your kernel build. You may leverage an LKM as a rootkit to hook a specific ftraceable kernel function.

Check this link out: Linux Rootkits Part 2: Ftrace and Function Hooking.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文