Quarantine: a framework to mitigate memory errors in JNI applications

  • Authors:
  • Du Li;Witawas Srisa-an

  • Affiliations:
  • University of Nebraska-Lincoln, Lincoln, NE;University of Nebraska-Lincoln, Lincoln, NE

  • Venue:
  • Proceedings of the 9th International Conference on Principles and Practice of Programming in Java
  • Year:
  • 2011

Quantified Score

Hi-index 0.00

Visualization

Abstract

By using Java Native Interface (JNI), programmers can integrate Java programs with legacy applications or third-party libraries written in other languages (e.g., C, C++, and Pascal). However, the use of JNI can bypass the Java boundary checking and exception-handling mechanisms. Furthermore, its use can violate Java's type-safety feature because of the type-mismatches between native programs and Java programs. As a result, such integration can cause various security issues including heap errors that can be dangerous and difficult to detect. In this paper, we introduce Quarantine, a runtime system that can identify objects accessible by native methods and then migrate these objects to a quarantine area, which is used specifically to host this type of object. The goal of Quarantine is to create a runtime platform that allows programmers to apply existing heap protection techniques that have been designed for native languages but do not work well in the Java domain. We implemented Quarantine in Jikes RVM and evaluated its performance using the optimizing compiler. Our results using nine benchmark programs indicate that Quarantine, on average, incurs execution overhead of 14% and 13% when the heap is two and five times larger than the minimum heap requirement for an application, respectively.