在C程序中复制和执行SYSCALL

发布于 2025-02-07 17:38:17 字数 93 浏览 1 评论 0原文

我知道我的问题听起来可能很奇怪,但是我想知道如果我尝试在C文件中复制SYSCALL的源代码以及我尝试运行它会发生什么。

操作系统的哪种安全机制将阻止代码执行?

I know my question might sound strange, however I am wondering what would happen if I tried to copy the source code of a syscall in a C file and if I tried to run it.

Which security mechanism of the operating system will stop the code execution?

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

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

发布评论

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

评论(1

赠我空喜 2025-02-14 17:38:17

它根本不起作用。阻止其阻止的安全机制属于CPU,而不是操作系统。 CPU具有代码在AT上运行的不同特权级别,并且您的用户空间代码将以最低的特权级别运行,这不允许执行内核需要执行的操作,因此当您试图尝试执行它们时,处理器会错。

It wouldn't work at all. The security mechanism that would stop it belongs to the CPU, not to the operating system. CPUs have different privilege levels that code runs at, and your userspace code would run at the lowest privilege level, which isn't allowed to do the things that kernels need to do, so the processor would fault when you tried to do them anyway.

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