在C程序中复制和执行SYSCALL
我知道我的问题听起来可能很奇怪,但是我想知道如果我尝试在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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它根本不起作用。阻止其阻止的安全机制属于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.