skip to main content
10.1145/3293882.3338990acmconferencesArticle/Chapter ViewAbstractPublication PagesisstaConference Proceedingsconference-collections
research-article

JNI program analysis with automatically extracted C semantic summary

Published:10 July 2019Publication History

ABSTRACT

From Oracle JVM to Android Runtime, most Java runtime environments officially support Java Native Interface (JNI) for interaction between Java and C. Using JNI, developers can improve Java program performance or reuse existing libraries implemented in C. At the same time, differences between the languages can lead to various kinds of unexpected bugs when developers do not understand the differences or comprehensive interoperation semantics completely. Furthermore, existing program analysis techniques do not cover the interoperation, which can reduce the quality of JNI programs.

We propose a JNI program analysis technique that analyzes Java and C code of JNI programs using analyzers targeting each language respectively. The C analyzer generates a semantic summary for each C function callable from Java and the Java analyzer constructs call graphs using the semantic summaries and Java code. In addition to the call graph construction, we extend the analysis technique to detect four bug types that can occur in the interoperation between the languages. We believe that our approach would be able to detect genuine bugs as well as improve the quality of JNI programs.

References

  1. Shahid Alam, Zhengyang Qu, Ryan Riley, Yan Chen, and Vaibhav Rastogi. 2017. DroidNative: Automating and optimizing detection of Android native code malware variants. computers & security 65 (2017), 230–246. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Isil Dillig, Thomas Dillig, Alex Aiken, and Mooly Sagiv. 2011. Precise and compact modular procedure summaries for heap manipulating programs. In ACM SIGPLAN Notices, Vol. 46. ACM, 567–577. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Facebook. 2019. Infer. https://fbinfer.com.Google ScholarGoogle Scholar
  4. Google. 2016. Android NDK. https://developer.android.com/ndk?hl=en.Google ScholarGoogle Scholar
  5. Martin Hirzel, Daniel Von Dincklage, Amer Diwan, and Michael Hind. 2007. Fast online pointer analysis. ACM Transactions on Programming Languages and Systems (TOPLAS) 29, 2 (2007), 11. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Goh Kondoh and Tamiya Onodera. 2008. Finding bugs in Java native interface programs. In Proceedings of the 2008 international symposium on Software testing and analysis. ACM, 109–118. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Byeongcheol Lee, Ben Wiedermann, Martin Hirzel, Robert Grimm, and Kathryn S McKinley. 2010. Jinn: synthesizing dynamic bug detectors for foreign language interfaces. ACM Sigplan Notices 45, 6 (2010), 36–49. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Siliang Li and Gang Tan. 2009. Finding bugs in exceptional situations of JNI programs. In Proceedings of the 16th ACM conference on Computer and communications security. ACM, 442–452. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Oracle. 2018. Java Native Interface Specification. https://docs.oracle.com/javase/ 7/docs/technotes/guides/jni/spec/jniTOC.html.Google ScholarGoogle Scholar
  10. Nastaran Shafiei and Franck van Breugel. 2014. Automatic handling of native methods in Java PathFinder. In Proceedings of the 2014 International SPIN Symposium on Model Checking of Software. ACM, 97–100. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Michael Spreitzenbarth, Thomas Schreck, Florian Echtler, Daniel Arp, and Johannes Hoffmann. 2015. Mobile-Sandbox: combining static and dynamic analysis with machine-learning techniques. International Journal of Information Security 14, 2 (2015), 141–153. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Gang Tan and Greg Morrisett. 2007. ILEA: Inter-language analysis across Java and C. In ACM SIGPLAN Notices, Vol. 42. ACM, 39–56. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Fengguo Wei, Xingwei Lin, Xinming Ou, Ting Chen, and Xiaosong Zhang. 2018. JN-SAF: Precise and Efficient NDK/JNI-aware Inter-language Static Analysis Framework for Security Vetting of Android Applications with Native Code. In Proceedings of the 2018 ACM SIGSAC Conference on Computer and Communications Security. ACM, 1137–1150. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. JNI program analysis with automatically extracted C semantic summary

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in
    • Published in

      cover image ACM Conferences
      ISSTA 2019: Proceedings of the 28th ACM SIGSOFT International Symposium on Software Testing and Analysis
      July 2019
      451 pages
      ISBN:9781450362245
      DOI:10.1145/3293882

      Copyright © 2019 ACM

      Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 10 July 2019

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • research-article

      Acceptance Rates

      Overall Acceptance Rate58of213submissions,27%

      Upcoming Conference

      ISSTA '24

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader