内核安全模块:struct inode 中的 i_security
我的问题可能又很简单,但我没有找到任何东西。我正在编写一个 Linux 安全模块。您可能知道,内核中的 struct inode 包含一个字段 i_security 来保存 LSM 的安全相关信息。现在只是为了确保:假设没有用户(甚至 root)无法读取或写入该值是否安全,即该值真的只能从内核空间访问吗?
我的问题的原因是,很明显,可以从用户空间访问一些 inode 数据(我猜是通过系统调用,但仍然使用 chmod 等。您可以更改 inode 中的某些值),现在我想知道这是否不这并不意味着所有 inode 数据(还有 i_security)都可以以某种方式从用户空间访问。
干杯
my question is probably again pretty simple, but I did not find anything. I am writing a Linux Security Module. As you might know the struct inode in the kernel contains one field i_security to save security relevant information for the LSM. Now just to make sure: Is it safe to assume that no user (not even root) will be able to read or write this value, i.e. can this value really be accessed only from kernel space?
The reason for my question is, that it is obvious that some inode data can be accessed from userspace (through systemcalls I guess, but still using chmod etc. you are able to change some values in an inode) and now I wonder if that doesn't mean, that all inode data (also the i_security) can be accessed from user space somehow.
Cheers
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的。可以使用grep或ack扫描
i_security
的内核代码,可以发现它只能被security/
目录下的文件修改,而不能被用户应用程序修改,因为他们无法直接访问i_security
字段。Yes. You can use grep or ack to scan kernel code for
i_security
, and you can find it is modified only by files undersecurity/
directory, and cannot be modified by user applications, since they have no direct access to thei_security
field.