我希望有人可以帮助我解决以下问题:
我对 java 堆栈自省(introspection)的理解(这里可能有点过于简单化)是一个进程生成一个堆栈帧,然后将其添加到堆栈中。现在,当进程需要进行系统调用时,堆栈自省(introspection)算法会检查是否允许委托(delegate)人(即尝试访问资源的进程)使用特定资源,然后相应地注释框架(授予或禁止访问权限) ).
我的问题是:
- 以上是正确的还是我遗漏了什么?
- JVM 如何决定是授予还是限制访问权限?用户是否参与了这个决定?
- 在this study有一个示例(图 2),其中一个框架继承/被告知前一个框架的“信念集”!在此示例中,是什么阻止了恶意代码的执行(即访问不应访问的资源)?
最佳答案
How does the JVM decide whether to grant or restrict access? Is the user involved in this decision?
它委托(delegate)给当前安装的 SecurityManager
。
Is the above correct or am I missing something?
SecurityManager
可以在堆栈上自省(introspection),也可以使用其他一些标准。与在浏览器中运行的小程序关联的 SecurityManager
会进行内省(introspection),因此这至少在一个域中是正确的。
In this study theres an example (figure 2) in which a frame inherits/is being told the "belief set" of the previous frame! What stops malicious code from being executed in this example (i.e. get access to a resource that shouldnt have accesss to)?
真的没什么。 Java 安全性一团糟,许多人建议在浏览器中关闭 Java,因为如今很少有合法网站使用它。
关于Java 堆栈自省(introspection),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9650737/