skip to main content
article
Open access

The KaffeOS Java runtime system

Published: 01 July 2005 Publication History

Abstract

Single-language runtime systems, in the form of Java virtual machines, are widely deployed platforms for executing untrusted mobile code. These runtimes provide some of the features that operating systems provide: interapplication memory protection and basic system services. They do not, however, provide the ability to isolate applications from each other. Neither do they provide the ability to limit the resource consumption of applications. Consequently, the performance of current systems degrades severely in the presence of malicious or buggy code that exhibits ill-behaved resource usage. We show that Java runtime systems can be extended to support processes, and that processes can provide robust and efficient support for untrusted applications.We have designed and built KaffeOS, a Java runtime system that provides support for processes. KaffeOS isolates processes and manages the physical resources available to them: CPU and memory. Unlike existing Java virtual machines, KaffeOS can safely terminate processes without adversely affecting the integrity of the system, and it can fully reclaim a terminated process's resources. Finally, KaffeOS requires no changes to the Java language. The novel aspects of the KaffeOS architecture include the application of a user/kernel boundary as a structuring principle for runtime systems, the employment of garbage collection techniques for resource management and isolation, and a model for direct sharing of objects between untrusted applications. The difficulty in designing KaffeOS lay in balancing the goals of isolation and resource management against the goal of allowing direct sharing of objects.For the SpecJVM benchmarks, the overhead that our KaffeOS prototype incurs ranges from 0% to 25%, when compared to the open-source JVM on which it is based. We consider this overhead acceptable for the safety that KaffeOS provides. In addition, our KaffeOS prototype can scale to run more applications than running multiple JVMs. Finally, in the presence of malicious or buggy code that engages in a denial-of-service attack, KaffeOS can contain the attack, remove resources from the attacked applications, and continue to provide robust service to other clients.

References

[1]
Back, G. 2002. Isolation, resource management, and sharing in the KaffeOS Java runtime system. Ph.D. dissertation. University of Utah School of Computing.]]
[2]
Bacon, D. F., Konuru, R., Murthy, C., and Serrano, M. 1998. Thin locks: Featherweight synchronization for Java. In Proceedings of the SIGPLAN '98 Conference on Programming Language Design and Implementation (Montreal, Ont., Canada). ACM, New York, 258--268.]]
[3]
Balfanz, D. and Gong, L. 1998. Experience with secure multi-processing in Java. In Proceedings of the 18th International Conference on Distributed Computing Systems (Amsterdam, The Netherlands). 398--405.]]
[4]
Berger, E. D., McKinley, K. S., Blumofe, R. D., and Wilson, P. R. 2000. Hoard: A scalable memory allocator for multithreaded applications. In Proceedings of the 9th International Conference on Architectural Support for Programming Languages and Operating Systems (Cambridge, Mass.). ACM, New York, 117--128.]]
[5]
Bergsten, H. 2000. JavaServer Pages, First ed. O'Reilly & Associates, Inc., Sebastopol, Calif.]]
[6]
Bernadat, P., Lambright, D., and Travostino, F. 1998. Towards a resource-safe Java for service guarantees in uncooperative environments. In Proceedings of the IEEE Workshop on Programming Languages for Real-Time Industrial Applications (Madrid, Spain). IEEE Computer Society Press, Los Alamitos, Calif., 101--111.]]
[7]
Bershad, B., Savage, S., Pardyak, P., Becker, D., Fiuczynski, M., and Sirer, E. 1995a. Protection is a software issue. In Proceedings of the 5th Workshop on Hot Topics in Operating Systems (Orcas Island, Wash.). 62--65.]]
[8]
Bershad, B., Savage, S., Pardyak, P., Sirer, E., Fiuczynski, M., Becker, D., Eggers, S., and Chambers, C. 1995b. Extensibility, safety and performance in the spin operating system. In Proceedings of the 15th Symposium on Operating Systems Principles (Copper Mountain, Col.). 267--284.]]
[9]
Blackburn, S. M., Singhai, S., Hertz, M., McKinley, K. S., and Moss, J. E. B. 2001. Pretenuring for Java. In Proceedings of the ACM Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA '01) (Tampa Bay, Fla.). ACM, New York, 342--352.]]
[10]
Bollella, G., Gosling, J., Brosgol, B., Dibble, P., Furr, S., and Turnbull, M. 2000. The Real-Time Specification for Java, First ed. The Java Series. Addison-Wesley, Reading, Mass.]]
[11]
Chan, P., Lee, R., and Kramer, D. 1998. The Java Class Libraries: Volume 1, Second ed. The Java Series. Addison-Wesley, Reading, Mass.]]
[12]
Chase, J. S. 1995. An operating system structure for wide-address architectures. Ph.D. dissertation. Department of Computer Science and Engineering, University of Washington, Seattle, Wash.]]
[13]
Chen, H. and Wagner, D. 2002. MOPS: An infrastructure for examining security properties of software. In Proceedings of the 9th ACM Conference on Computer and Communications Security (Washington, D.C.). ACM, New York, 235--244.]]
[14]
Cheng, P., Harper, R., and Lee, P. 1998. Generational stack collection and profile-driven pretenuring. In Proceedings of the SIGPLAN '98 Conference on Programming Language Design and Implementation (Montreal, Ont., Canada). ACM, New York, 162--173.]]
[15]
Czajkowski, G. 2000. Application isolation in the Java virtual machine. In Proceedings of the ACM Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA '00) (Minneapolis, Minn.). ACM, New York, 354--366.]]
[16]
Czajkowski, G., Chang, C.-C., Hawblitzel, C., Hu, D., and von Eicken, T. 1998. Resource management for extensible Internet servers. In Proceedings of the 8th ACM SIGOPS European Workshop (Sintra, Portugal). ACM, New York, 33--39.]]
[17]
Czajkowski, G. and Daynés, L. 2001. Multitasking without compromise: A virtual machine evolution. In Proceedings of the ACM Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA '01) (Tampa Bay, Fla.). ACM, New York, 125--138.]]
[18]
Czajkowski, G. and von Eicken, T. 1998. JRes: A resource accounting interface for Java. In Proceedings of the ACM Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA '98) (Vancouver, B.C. Canada). ACM, New York, 21--35.]]
[19]
Dean, D. 1997. The security of static typing with dynamic linking. In Proceedings of the 4th ACM Conference on Computer and Communications Security (Zurich, Switzerland). ACM, New York, 18--27.]]
[20]
Dillenberger, D., Bordawekar, R., Clark, C. W., Durand, D., Emmes, D., Gohda, O., Howard, S., Oliver, M. F., Samuel, F., and John, R. W. S. 2000. Building a Java virtual machine for server applications: The JVM on OS/390. IBM Syst. J. 39, 1, 194--210.]]
[21]
Domani, T., Goldshtein, G., Kolodner, E. K., Lewis, E., Petrank, E., and Sheinwald, D. 2002. Thread-local heaps for Java. In Proceedings of the 3rd International Symposium on Memory Management (Berlin, Germany). ACM, New York, 183--194.]]
[22]
Dorward, S., Pike, R., Presotto, D. L., Ritchie, D. M., Trickey, H., and Winterbottom, P. 1997. The Inferno operating system. Bell Labs Tech. J. 2, 1, 5--18.]]
[23]
Engler, D., Chelf, B., Chou, A., and Hallem, S. 2000. Checking system rules using system-specific, programmer-written compiler extensions. In Proceedings of the 4th Symposium on Operating Systems Design and Implementation (San Diego, Calif.). USENIX Association, 1-- 16.]]
[24]
Engler, D. R., Kaashoek, M. F., and O'Toole Jr., J. 1995. Exokernel: An operating system architecture for application-level resource management. In Proceedings of the 15th Symposium on Operating Systems Principles (Copper Mountain, Col.). 251--266.]]
[25]
Flatt, M. and Findler, R. 2004. Kill-safe synchronization abstractions. In Proceedings of the SIGPLAN '04 Conference on Programming Language Design and Implementation (Washington, D.C.). ACM, New York.]]
[26]
Ford, B., Hibler, M., Lepreau, J., Tullmann, P., Back, G., and Clawson, S. 1996. Microkernels meet recursive virtual machines. In Proceedings of the 2nd Symposium on Operating Systems Design and Implementation (Seattle, Wash.). USENIX Association, 137--151.]]
[27]
Franz, M. 1997. Beyond Java: An infrastructure for high-performance mobile code on the World Wide Web. In Proceedings of WebNet '97, World Conference of the WWW, Internet, and Intranet, S. Lobodzinski and I. Tomek, Eds. Association for the Advancement of Computing in Education, Toronto, Ont., Canada, 33--38.]]
[28]
Gay, D. and Aiken, A. 1998. Memory management with explicit regions. In Proceedings of the SIGPLAN '98 Conference on Programming Language Design and Implementation (Montreal, Ont., Canada). ACM, New York, 313--323.]]
[29]
Gorrie, L. 1998. Echidna---A free multiprocess system in Java. http://www.javagroup.org/ echidna/.]]
[30]
Hawblitzel, C., Chang, C.-C., Czajkowski, G., Hu, D., and von Eicken, T. 1998. Implementing multiple protection domains in Java. In Proceedings of the 1998 USENIX Annual Technical Conference (New Orleans, La.). USENIX Association, 259--270.]]
[31]
Hawblitzel, C. and von Eicken, T. 2002. Luna: A flexible java protection system. In Proceedings of the 5th Symposium on Operating Systems Design and Implementation (Boston, Mass.).]]
[32]
Henzinger, T., Jhala, R., Majumdar, R., Necula, G., Sutre, G., and Weimer, W. 2002. Temporal safety proofs for systems code. In Proceedings of the 14th International Conference on Computer Aided Verification (CAV'02) (Copenhagen, Denmark).]]
[33]
Jaeger, T., Liedtke, J., and Islam, N. 1998. Operating system protection for fine-grained programs. In Proceedings of the 7th USENIX Security Symposium (San Antonio, Tex.). USENIX Association, 143--157.]]
[34]
Java Apache Project. 2000. The Apache JServ project. http://java.apache.org/jserv.]]
[35]
Java Community Process. 2003. Jsr 121. http://www.jcp.org/en/jsr/detail?id=121.]]
[36]
Joy, B., Steele, G., Gosling, J., and Bracha, G. 2000. The Java Language Specification, Second ed. The Java Series. Addison-Wesley, Reading, Mass.]]
[37]
Jul, E., Levy, H., Hutchison, N., and Black, A. 1988. Fine-grained mobility in the Emerald system. ACM Trans. Comput. Syst. 6, 1 (Feb.), 109--133.]]
[38]
Lepreau, J., Hibler, M., Ford, B., and Law, J. 1993. In-kernel servers on Mach 3.0: Implementation and performance. In Proceedings of the 3rd USENIX Mach Symposium (Santa Fe, N.M.). USENIX Association, 39--55.]]
[39]
Liang, S. 1999. The Java Native Interface: Programmer's Guide and Specification, First ed. The Java Series. Addison-Wesley, Reading, Mass.]]
[40]
Liang, S. and Bracha, G. 1998. Dynamic class loading in the Java virtual machine. In Proceedings of the ACM Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA '98) (Vancouver, B.C., Canada). ACM, New York, 36--44.]]
[41]
Lizt, J. 1999. Oracle JServer Scalability and Performance. http://www.oracle.com/ java/scalability/index.html?testresults_twp.html. Java Products Team, Oracle Server Technologies.]]
[42]
Malkhi, D., Reiter, M. K., and Rubin, A. D. 1998. Secure execution of Java applets using a remote playground. In Proceedings of the 1998 IEEE Symposium on Security and Privacy (Oakland, Calif.). IEEE Computer Society Press, Los Alamitos, Calif., 40--51.]]
[43]
Marlow, S., Jones, S. P., Moran, A., and Reppy, J. 2001. Asynchronous exceptions in haskell. In Proceedings of the Conference on Programming Language Design and Implementation (Snowbird, Ut.). ACM, New York, 274--285.]]
[44]
McGraw, G. and Felten, E. 1997. Java Security: Hostile Applets, Holes, and Antidotes. Wiley Computer Publishing, New York.]]
[45]
Microsoft Corporation. 2003. NET web pages. http://msdn.microsoft.com/netframework/.]]
[46]
Plainfossé, D. and Shapiro, M. 1995. A survey of distributed garbage collection techniques. In Proceedings of the International Workshop on Memory Management (IWMM95) (Kinross, Scotland). Lecture Notes in Computer Science, vol. 986. Springer-Verlag, New York, 211--249.]]
[47]
Price, D. W., Rudys, A., and Wallach, D. S. 2003. Garbage collector memory accounting in language-based systems. In Proceedings of 2003 IEEE Symposium on Security and Privacy (Oakland, Calif.). IEEE Computer Society Press, Los Alamitos, Calif., 263--274.]]
[48]
Redell, D. D., Dalal, Y. K., Horsley, T. R., Lauer, H. C., Lynch, W. C., McJones, P. R., Murray, H. G., and Purcell, S. C. 1980. Pilot: An operating system for a personal computer. Commun. ACM 23, 2, 81--92.]]
[49]
Ritchie, D. M. and Thompson, K. 1978. The UNIX time-sharing system. The Bell Syst. Tech. J. 57, 6 (July/Aug.), 1905--1930.]]
[50]
Rivest, R. 1992. The MD5 message-digest algorithm. Internet Request for Comments RFC 1321, Internet Network Working Group. April.]]
[51]
Roscoe, T. 1995. The structure of a multi-service operating system. Ph.D. dissertation. Queen's College, University of Cambridge, Cambridge, U.K.]]
[52]
Rudys, A. and Wallach, D. S. 2002. Termination in language-based systems. ACM Trans. Inf. Syst. Sec. 5, 2 (May), 138--168.]]
[53]
Saraswat, V. 1997. Java is not type-safe. http://matrix.research.att.com/vj/bug.html.]]
[54]
Saulpaugh, T. and Mirho, C. A. 1999. Inside the JavaOS Operating System. The Java Series. Addison-Wesley, Reading, Mass.]]
[55]
Seltzer, M. I., Endo, Y., Small, C., and Smith, K. A. 1996. Dealing with disaster: Surviving misbehaved kernel extensions. In Proceedings of the 2nd Symposium on Operating Systems Design and Implementation (Seattle, Wash.). USENIX Association, 213--227.]]
[56]
Shapiro, J. S. 2003. Vulnerabilities in synchronous IPC designs. In Proceedings of the 2003 IEEE Symposium on Security and Privacy (Oakland, Calif.). IEEE Computer Society Press, Los Alamitos, Calif., 251--262.]]
[57]
Sirer, E., Fiuczynski, M., Pardyak, P., and Bershad, B. 1996. Safe dynamic linking in an extensible operating system. In Proceedings of the 1st Workshop on Compiler Support for System Software (Tucson, Az.). 141--148.]]
[58]
SPEC. 1998. SPEC JVM98 benchmarks. http://www.spec.org/osg/jvm98/.]]
[59]
Steensgaard, B. 2000. Thread-specific heaps for multi-threaded programs. In Proceedings of the 2nd International Symposium on Memory Management (Minneapolis, Minn.). ACM, New York, 18--24.]]
[60]
Stefanović, D., McKinley, K. S., and Moss, J. E. B. 1999. Age-based garbage collection. In Proceedings of the ACM Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA '99) (Denver, Col.). ACM, New York, 370--381.]]
[61]
Suganuma, T., Ogasawara, T., Takeuchi, M., Yasue, T., Kawahito, M., Ishizaki, K., Komatsu, H., and Nakatani, T. 2000. Overview of the IBM Java just-in-time compiler. IBM Syst. J. 39, 1, 175--193.]]
[62]
Swinehart, D. C., Zellweger, P. T., Beach, R. J., and Hagmann, R. B. 1986. A structural view of the Cedar programming environment. ACM Trans. Prog. Lang. Syst. 8, 4 (Oct.), 419--490.]]
[63]
Tullmann, P. A. 1999. The Alta operating system. M.S. dissertation, Department of Computer Science, University of Utah.]]
[64]
Tullmann, P., Hibler, M., and Lepreau, J. 2001. Janos: A Java-oriented OS for active network nodes. IEEE J. Sel. Areas Commun. 19, 3 (Mar.), 501--510.]]
[65]
Tullmann, P. and Lepreau, J. 1998. Nested Java processes: OS structure for mobile code. In Proceedings of the 8th ACM SIGOPS European Workshop (Sintra, Portugal). ACM, New York, 111--117.]]
[66]
van Doorn, L. 2000. A secure Java virtual machine. In Proceedings of the 9th USENIX Security Symposium (Denver, Col.). USENIX Association, 19--34.]]
[67]
van Doorn, L., Homburg, P., and Tanenbaum, A. S. 1995. Paramecium: an extensible object-based kernel. In Proceedings of the 5th Workshop on Hot Topics in Operating Systems (Orcas Island, Wash.). IEEE Computer Society Press, Los Alamitos, Calif., 86--89.]]
[68]
Wahbe, R., Lucco, S., Anderson, T., and Graham, S. 1993. Efficient software-based fault isolation. In Proceedings of the 14th Symposium on Operating Systems Principles (Asheville, N.C.). 203--216.]]
[69]
Waldspurger, C. A. 1995. Lottery and stride scheduling: Flexible proportional-share resource management. Ph.D. dissertation. Massachusetts Institute of Technology, Cambridge, Mass.]]
[70]
Wick, A., Flatt, M., and Hsieh, W. 2002. Reachability-based memory accounting. In Proceedings of the 2002 Scheme Workshop (Pittsburgh, Pa.).]]
[71]
Wilkinson, T. 1996. Kaffe---A Java virtual machine. http://www.kaffe.org/.]]
[72]
Wilkinson, T., Stiemerling, T., Gull, A., Whitcroft, A., Osmon, P., Saulsbury, A., and Kelly, P. 1992. Angel: A proposed multiprocessor operating system kernel. In Proceedings of the European Workshop on Parallel Computing (Barcelona, Spain). 316--319.]]
[73]
Wilson, P. R. 1992. Uniprocessor garbage collection techniques. In Proceedings of the International Workshop on Memory Management (IWMM92), Y. Bekkers and J. Cohen, Eds. Lecture Notes in Computer Science, vol. 637. Springer-Verlag, New York, 1--42.]]
[74]
Wind River Systems, Inc. 1995. VxWorks Programmer's Guide. Wind River Systems, Inc., Alameda, Calif.]]
[75]
Wirth, N. and Gutknecht, J. 1992. Project Oberon. ACM, New York.]]
[76]
Zee, K. and Rinard, M. 2002. Write barrier removal by static analysis. In Proceedings of the ACM Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA '02) (Seattle, Wash.). ACM, New York, 191--210.]]

Cited By

View all

Recommendations

Reviews

R. Clayton

The Java Virtual Machine (JVM) can be thought of as a single-process operating system (OS). The advantage of a single-process OS over a multiple-process OS is simplicity and security; the advantage of a multiple-process OS is flexibility and utility. The wildcard is security; it exists on both sides of the tradeoff, but complexity of implementation and use is superlinear in its ability to compromise security. There is a great temptation to make the JVM a multiprocess OS to gain flexibility and utility without losing too much simplicity and security. The authors cede to temptation with KaffeOS, a JVM extension supporting multiple processes. The extension requires the usual OS steps, but the steps are made interesting by the need to adapt to the JVM semantics and implementation. KaffeOS introduces the necessary protected and user modes (with Java-type safety and a trusted library providing the equivalent of hardware mode bits), and multiple heaps to support multiple processes and interprocess sharing. The protected-mode kernel and library implement the resource abstractions, which include detecting and corralling resource hogs. Effective and efficient garbage collection over multiple heaps imposes costs on implementation (for example, write barriers) and semantics (for example, restrictions on shared-heap use). SPEC JVM98 measurements show that multiple-heap overhead is less than ten percent, compared to an unmodified JVM. KaffeOS running multiple servlets shows a 25 to 30 percent loss of requests per second when compared to multiple JVMs, each running a single servlet. However, KaffeOS is more stable in the presence of ill-behaved servlets than multiple JVMs are. Online Computing Reviews Service

Access critical reviews of Computing literature here

Become a reviewer for Computing Reviews.

Comments

Information & Contributors

Information

Published In

cover image ACM Transactions on Programming Languages and Systems
ACM Transactions on Programming Languages and Systems  Volume 27, Issue 4
July 2005
236 pages
ISSN:0164-0925
EISSN:1558-4593
DOI:10.1145/1075382
Issue’s Table of Contents

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 July 2005
Published in TOPLAS Volume 27, Issue 4

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Robustness
  2. garbage collection
  3. isolation
  4. language runtimes
  5. resource management
  6. termination
  7. virtual machines

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)111
  • Downloads (Last 6 weeks)18
Reflects downloads up to 30 Jan 2025

Other Metrics

Citations

Cited By

View all

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Login options

Full Access

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media