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虚拟机内部内存的破译者的不可告人的阴谋。

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值