Runtime environment program safety




















They'll go back and debug, and in that way they'll learn more about what the runtime environment is like and what it can support. It's helpful to talk about certain types of runtime errors. Some of these are independent of the runtime environment — logical errors or out of bounds errors have more to do with how the program is written.

Another good example of how this works involves certain kinds of key dependencies that were very common in the last couple of decades of computer science. As programs were linked to DLLs and shared these libraries, it became common for one or more applications to fail because of lack of access. DLL hell was also an excellent lesson in dependencies, something that had informed computer science ever since. Remember, in a very basic sense, that the runtime environment is composed of resources like the CPU and the operating system that's involved.

With that in mind, today's runtime environment have changed quite a bit. In the traditional computer science world, a runtime environment was based on a specific hardware setup.

Now, with virtualization, a runtime environment can be a virtual machine instead of a physical machine. In the past 6 months, around 68, new infections have been discovered.

The latest variant is known as JSocket. The malware is believed to have first appeared in the summer of and is still being extensively used. The RAT is most commonly spread by phishing campaigns with users fooled into running the Java file, installing the Trojan. While the RAT is primarily distributed by large-scale email spam campaigns, some evidence has been uncovered to suggest it is being used as part of targeted attacks on individuals and organizations. Additional benefits include the ability to gracefully handle arbitrary pointer usage, aliasing, and typecasting.

Documents: Advanced Search Include Citations. The overheads imposed are reported in Table 3. The overheads incurred by pointer checks alone are in the range of 1. Additional checks on integer arithmetic causes an overall slowdown of 1. The composite score of this benchmark suite gives an average slowdown of 2.

The overhead is noticeable but not excessive. CCuring the Scimark2 benchmarks caused them to run 1. Our technique is also only 1X more expensive than CCured. We noticed a peculiarity in our results that running the source code through some of these techniques seemed to improve the performance. MFlops: original vs. We have seen a source code bloat in the order of 1.

Increase in the runtime image can be attributed to the statically linked library and the in-memory housekeeping information regarding address ranges. Our empirical results show that the overall impact on the runtime image is nomimal 1. This is due to the following reasons. The Archerr library code is partly written in assembly and partly in C, and the resulting library image is small.

Address ranges are implemented as very small data structures. Furthermore, our coarse-grained approach allows multiple address ranges to be collapsed to a single address range when memory on heap or new stack frames are allocated. Although addition or deletion of address ranges could potentially result in O n behavior in the worst case, the memory consumption is not significant in the general case.

We briefly describe these ap- proaches and compare them with the techniques proposed in this paper. Jones et al. Safety is addressed through source code annotations by ascertaining that pointer operations are only permitted to take place within an object and not across objects.

However, there are some drawbacks that we improve upon. Most markedly, our technique is significantly more efficient than their technique. Also, their technique only addresses pointer usage, while we present a more holistic approach.

By inserting dead space around each object, they can detect violations at runtime. This rigid check structure results in inability to handle complex data structures such as multi-dimensional arrays, arrays within arrays, arbitrary typecasting, and finally, excessive runtime overhead. We are able to address these aspects effectively in our approach, mainly due to the fact that we relax the strict object-centric view.

Finally, they have implemented their technique as a GNU C compiler extension, while we make no modifications to the C compiler. Purify [20] is a widely-used tool, which processes binary code to insert run- time memory access checks. However, Purify is used mainly for debugging pur- poses because of its inefficiency. Also, it will some times permit stack corruption by allowing a program to access past stack-allocated arrays. Archerr clearly guards against this misuse by maintaining maps of delimited stack frames.

Wag- ner et al. Since it is a compile- time technique that actively pursues violations, it can detect many of them even before compilation. In contrast, our technique is a runtime detection technique; hence, it is passive and violations are detected only when the corresponding ex- ecution path is active. However, [1] handles pointer typecasting and aliasing in an ad-hoc manner and this approximation raises several false positives.

StackGuard [22] is a compiler extension that adds a random padding called the canary around the return address on the stack. These bytes are checked at each function entry and exit. StackShield [23] moves the return address to a location that cannot be overflowed. Manipulating the stack frame affects compatibility and can break applications such as debuggers, which probe the stack frame for function call information. Protection in ProPo- lice [24] is accomplished by inserting checks during compilation and reordering variables to prevent pointer corruption.

All these techniques use architecture- specific information about stack layout in a clever manner. Focussing mainly on stack protection, although very efficient, can allow attacks [25] to bypass these techniques. Statically analyzing programs based on type correctness can detect many common programmer errors. Some of these correct- ness notions have been extended to express safety properties.

Cyclone [26] intro- duces a notion of region based type theory into C. All variables apart from their type, have an additional attribute called a region, which is determined based on where the variable resides, i. Analysis with the help of this concept allows the detection of invalid region based memory accesses in pro- grams. CCured [4] describes an augmented type system for C to prevent invalid memory accesses due to pointers. Based on their usage, pointers are segregated as safe and unsafe.

Programs can be statically analyzed and while most pointer usage can be checked statically, some of them require runtime checks. There are cases where a program will stop even when it is safe and manual intervention is necessary. We have observed similar slowdown on our benchmarks and our technique is comparable to CCured in terms of overhead.

The caveat to these approaches is that safety is not achieved transparently and the programmer is burdened by a possibly steep learning curve in both cases. Some of the concepts in this paper, such as static analysis of basic types, region and pointer-based analysis are similar. One advantage to our approach as well as to some of the other techniques described in Section 5.

Again, we cover pointers and more. Based on this premise, pointers and location of objects can be randomized in order to render attacks ineffective. Unlike the bounds-checking techniques, the following [19, 27] incur much less overhead but possibly may be bypassable by attackers as discussed in [19].

ASLR randomizes the location of key memory spaces, such as the stack and the heap. Sekar et al. Cowan et al. Orchestrating a buffer-overflow attack in this scenario requires knowledge of the secret key. Similar to many of the above tools, these approaches are focused solely on ensuring safe pointer manipulation. We address the problem of unsafe functions by inserting sanity checks on the arguments in the source code prior to compilation.

Access checks that are placed in the code ascertain that the code is performing numerical computations and accessing memory in a safe manner. Since there is no notion of well-defined and immutable objects per se, memory within the valid address ranges can be typecast arbitrarily. This largely retains the flexibility of the language.

If code annotations are performed in an exhaustive way, then the slowdown is not negligible but very useful for debugging purposes. On the other hand, production systems require efficient execution and in such a scenario, optimizations can reduce the number of annotations.

By making the runtime environment specification as a separate parameter, it is possible to gen- erate annotated versions of the same source code that is safe for each instance of the specified runtime environment, subsequently, providing tighter security. Although our technique provides coverage against a wide variety of vulnera- bilities, the coverage is limited to the source code that our technique processes.

Therefore, vulnerabilities in external libraries cannot be handled unless the li- braries are also annotated. Like other code annotation techniques, there is little protection against runtime process image tampering and manipulation using programs such as gdb.

This implies that protection against exploits is limited to those which do not require direct access to the process image. Although this technique is practical with small impacts on performance, it does not solve all the problems by itself. Therefore, our recommendation is to use this tool in tandem with more proactive approaches. This paper lays the basic groundwork for a useful and efficient runtime de- tection technique to prevent exploits.

We are investigating further improvements to the technique. In its present form, this technique is reactive and can only be used to prevent exploits.

But there is scope to provide detection capabilities at the preprocessing stage itself. For example, pseudo interval ranges can be cre- ated even during compilation stage to represent the data segment and the stack frames, and then program execution can be simulated partially to detect possible violations. At this point, it is only a speculation and we are looking at issues regarding this possibility.

The runtime environment specified in Section 2 has been the focus of this work.



0コメント

  • 1000 / 1000