欢迎访问悦橙教程(wld5.com),关注java教程。悦橙教程  java问答|  每日更新
页面导航 : > > 文章正文

Java沙箱(Java SandBox)[5],

来源: javaer 分享于  点击 25051 次 点评:147

Java沙箱(Java SandBox)[5],


原文:

Safety features and security

Because of the safety features built into the Java virtual machine, running programs can access memory only in safe, structured ways. This helps make Java programs robust, but also makes their execution more secure. Why? There are two reasons.

First, a program that corrupts memory, crashes, and possibly causes other programs to crash represents one kind of security breach. If you are running a mission-critical server process, it is critical that the process doesn't crash. This level of robustness is also important in embedded systems such as a cell phone, which people don't usually expect to have to reboot.

The second reason unrestrained memory access would be a security risk is because a wiley cracker potentially could use the memory to subvert the security system. If, for example, a cracker could learn where in memory a class loader is stored, it could assign a pointer to that memory and manipulate the class loader's data. By enforcing structured access to memory, the Java virtual machine yields programs that are robust -- but also frustrates crackers who dream of harnessing the internal memory of the Java virtual machine for their own devious plots.

       由于安全特性内置于java虚拟机中,所以程序只能以一种安全的,结构化的方式访问内存。这不仅使得java程序健壮,而且让它们的执行更安全。为什么?有两点原因。
        首先:一个乱用内存,可能会死掉的程序很可能会导致其他的程序崩溃,这体现了一种违背安全性情况。如果你正在运行一个临界任务服务进程,很关键的一点是这个进程不能崩溃, 在手机等嵌入式系统中这种级别的健壮性也是很重要的,因为人们不总是希望重启。
        第二:无限制的内存访问可能会是一个安全隐患,因为破译者可以利用内存破坏系统安全。比如,破译者可以得知一个类加载器在内存中的存储位置。此时可以分配一个指针指向那片内存并且篡改类加载器的数据。通过强制性的结构化内存访问,java虚拟机使程序变得健壮,而且挫败了那些梦想着控制java虚拟机内部内存的破译者的不可告人的阴谋。

<望广大同行朋友批评指正,不胜感激>

相关文章

    暂无相关文章
相关栏目:

用户点评