Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/3319535.3354244acmconferencesArticle/Chapter ViewAbstractPublication PagesccsConference Proceedingsconference-collections
research-article
Public Access

Where Does It Go?: Refining Indirect-Call Targets with Multi-Layer Type Analysis

Published: 06 November 2019 Publication History

Abstract

System software commonly uses indirect calls to realize dynamic program behaviors. However, indirect-calls also bring challenges to constructing a precise control-flow graph that is a standard pre-requisite for many static program-analysis and system-hardening techniques. Unfortunately, identifying indirect-call targets is a hard problem. In particular, modern compilers do not recognize indirect-call targets by default. Existing approaches identify indirect-call targets based on type analysis that matches the types of function pointers and the ones of address-taken functions. Such approaches, however, suffer from a high false-positive rate as many irrelevant functions may share the same types.
In this paper, we propose a new approach, namely Multi-Layer Type Analysis (MLTA), to effectively refine indirect-call targets for C/C++ programs. MLTA relies on an observation that function pointers are commonly stored into objects whose types have a multi-layer type hierarchy; before indirect calls, function pointers will be loaded from objects with the same type hierarchy "layer by layer". By matching the multi-layer types of function pointers and functions, MLTA can dramatically refine indirect-call targets. MLTA is effective because multi-layer types are more restrictive than single-layer types. It does not introduce false negatives by conservatively tracking targets propagation between multi-layer types, and the layered design allows MLTA to safely fall back whenever the analysis for a layer becomes infeasible. We have implemented MLTA in a system, namely TypeDive, based on LLVM and extensively evaluated it with the Linux kernel, the FreeBSD kernel, and the Firefox browser. Evaluation results show that TypeDive can eliminate 86% to 98% more indirect-call targets than existing approaches do, without introducing new false negatives. We also demonstrate that TypeDive not only improves the scalability of static analysis but also benefits semantic-bug detection. With TypeDive, we have found 35 new deep semantic bugs in the Linux kernel.

Supplementary Material

WEBM File (p1867-lu.webm)

References

[1]
M. Abadi, M. Budiu, U. Erlingsson, and J. Ligatti. Control-Flow Integrity. In Proceedings of the 12th ACM Conference on Computer and Communications Security (CCS), Alexandria, VA, Nov. 2005.
[2]
P. Akritidis, C. Cadar, C. Raiciu, M. Costa, and M. Castro. Preventing Memory Error Exploits with WIT. In Proceedings of the 29th IEEE Symposium on Security and Privacy (Oakland), Oakland, CA, May 2008.
[3]
t al.(2013)Biallas, Olesen, Cassez, and Huuck]unsound-pointS. Biallas, M. C. Olesen, F. Cassez, and R. Huuck. PtrTracker: Pragmatic Pointer Analysis. In 2013 IEEE 13th International Working Conference on Source Code Analysis and Manipulation (SCAM), 2013.
[4]
T. Bletsch, X. Jiang, and V. Freeh. Mitigating Code-Reuse Attacks with Control-Flow Locking. In Proceedings of the Annual Computer Security Applications Conference (ACSAC), 2011.
[5]
P. Boonstoppel, C. Cadar, and D. Engler. RWset: Attacking Path Explosion in Constraint-Based Test Generation. In Proceedings of the Theory and Practice of Software, 14th International Conference on Tools and Algorithms for the Construction and Analysis of Systems, TACAS'08/ETAPS'08, 2008.
[6]
N. Burow, S. A. Carr, J. Nash, P. Larsen, M. Franz, S. Brunthaler, and M. Payer. Control-Flow Integrity: Precision, Security, and Performance. ACM Computing Surveys (CSUR), 50 (1): 16, 2017.
[7]
C. Cadar, D. Dunbar, and D. Engler. KLEE: Unassisted and Automatic Generation of High-coverage Tests for Complex Systems Programs. In Proceedings of the 8th USENIX Symposium on Operating Systems Design and Implementation (OSDI), San Diego, CA, Dec. 2008.
[8]
N. Carlini, A. Barresi, M. Payer, D. Wagner, and T. R. Gross. Control-Flow Bending: On the Effectiveness of Control-Flow Integrity. In Proceedings of the 24th USENIX Security Symposium (Security), Washington, DC, Aug. 2015.
[9]
M. Castro, M. Costa, and T. Harris. Securing Software by Enforcing Data-Flow Integrity. In Proceedings of the 7th USENIX Symposium on Operating Systems Design and Implementation (OSDI), Seattle, WA, Nov. 2006.
[10]
S. Chen, J. Xu, E. C. Sezer, P. Gauriar, and R. K. Iyer. Non-Control-Data Attacks Are Realistic Threats. In Proceedings of the 14th USENIX Security Symposium (Security), Baltimore, MD, Aug. 2005.
[11]
V. Chipounov, V. Kuznetsov, and G. Candea. S2E: A Platform for In Vivo Multi-Path Analysis of Software Systems. In Proceedings of the 16th ACM International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS), Newport Beach, CA, Mar. 2011.
[12]
M. Conti, S. Crane, L. Davi, M. Franz, P. Larsen, M. Negro, C. Liebchen, M. Qunaibit, and A.-R. Sadeghi. Losing Control: On the Effectiveness of Control-Flow Integrity Under Stack Attacks. In Proceedings of the 22nd ACM Conference on Computer and Communications Security (CCS), Denver, Colorado, Oct. 2015.
[13]
R. Ding, C. Qian, C. Song, B. Harris, T. Kim, and W. Lee. Efficient Protection of Path-Sensitive Control Security. In Proceedings of the 26th USENIX Security Symposium (Security), Vancouver, BC, Canada, Aug. 2017.
[14]
R. M. Farkhani, S. Jafari, S. Arshad, W. Robertson, E. Kirda, and H. Okhravi. On the Effectiveness of Type-Based Control Flow Integrity. In Proceedings of the Annual Computer Security Applications Conference (ACSAC), 2018.
[15]
X. Ge, N. Talele, M. Payer, and T. Jaeger. Fine-Grained Control-Flow Integrity for Kernel Software. In 2016 IEEE European Symposium on Security and Privacy (EuroS&P), pages 179--194. IEEE, 2016.
[16]
X. Ge, W. Cui, and T. Jaeger. GRIFFIN: Guarding Control Flows Using Intel Processor Trace. In Proceedings of the 22nd ACM International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS), Xi'an, China, Apr. 2017.
[17]
as et al.(2014)Göktas, Athanasopoulos, Bos, and Portokalidis]goktas2014outE. Göktas, E. Athanasopoulos, H. Bos, and G. Portokalidis. Out of Control: Overcoming Control-Flow Integrity. In Proceedings of the 35th IEEE Symposium on Security and Privacy (Oakland), San Jose, CA, May 2014.
[18]
Google. syzkaller - Kernel Fuzzer. https://github.com/google/syzkaller, 2019.
[19]
acs, Athanasopoulos, Portokalidis, and Bos]shrinkwrapI. Haller, E. Göktacs, E. Athanasopoulos, G. Portokalidis, and H. Bos. ShrinkWrap: VTable Protection without Loose Ends. In Proceedings of the Annual Computer Security Applications Conference (ACSAC), 2015.
[20]
H. Hu, Z. L. Chua, S. Adrian, P. Saxena, and Z. Liang. Automatic Generation of Data-Oriented Exploits. In Proceedings of the 24th USENIX Security Symposium (Security), Washington, DC, Aug. 2015.
[21]
H. Hu, S. Shinde, S. Adrian, Z. L. Chua, P. Saxena, and Z. Liang. Data-Oriented Programming: On the Expressiveness of Non-control Data Attacks. In Proceedings of the 37th IEEE Symposium on Security and Privacy (Oakland), San Jose, CA, May 2016.
[22]
H. Hu, C. Qian, C. Yagemann, S. P. H. Chung, W. R. Harris, T. Kim, and W. Lee. Enforcing Unique Code Target Property for Control-Flow Integrity. In Proceedings of the 25th ACM Conference on Computer and Communications Security (CCS), Toronto, ON, Canada, Oct. 2018.
[23]
K. K. Ispoglou, B. AlBassam, T. Jaeger, and M. Payer. Block Oriented Programming: Automating Data-Only Attacks. In Proceedings of the 25th ACM Conference on Computer and Communications Security (CCS), Toronto, ON, Canada, Oct. 2018.
[24]
S. Jana, Y. J. Kang, S. Roth, and B. Ray. Automatically Detecting Error Handling Bugs Using Error Specifications. In Proceedings of the 25th USENIX Security Symposium (Security), Austin, TX, Aug. 2016.
[25]
D. Jang, Z. Tatlock, and S. Lerner. SafeDispatch: Securing C
[26]
Virtual Calls from Memory Corruption Attacks. In Proceedings of the 2014 Annual Network and Distributed System Security Symposium (NDSS), San Diego, CA, Feb. 2014.
[27]
Y. Kang, B. Ray, and S. Jana. APEx: Automated Inference of Error Specifications for C APIs. In Proceedings of the 31st IEEE/ACM International Conference on Automated Software Engineering, pages 472--482. ACM, 2016.
[28]
V. Kuznetsov, L. Szekeres, M. Payer, G. Candea, R. Sekar, and D. Song. Code-Pointer Integrity. In Proceedings of the 11th USENIX Symposium on Operating Systems Design and Implementation (OSDI), Broomfield, Colorado, Oct. 2014.
[29]
J. Lee, T. Avgerinos, and D. Brumley. TIE: Principled Reverse Engineering of Types in Binary Programs. In Proceedings of the 18th Annual Network and Distributed System Security Symposium (NDSS), San Diego, CA, Feb. 2011.
[30]
J. Li, X. Tong, F. Zhang, and J. Ma. FINE-CFI: Fine-Grained Control-Flow Integrity for Operating System Kernels. IEEE Transactions on Information Forensics and Security, 13 (6): 1535--1550, 2018.
[31]
Z. Lin, X. Zhang, and D. Xu. Automatic Reverse Engineering of Data Structures from Binary Execution. In Proceedings of the 17th Annual Network and Distributed System Security Symposium (NDSS), San Diego, CA, Feb.--Mar. 2010.
[32]
K. Lu, C. Song, T. Kim, and W. Lee. UniSan: Proactive Kernel Memory Initialization to Eliminate Data Leakages. In Proceedings of the 23rd ACM Conference on Computer and Communications Security (CCS), Vienna, Austria, Oct. 2016.
[33]
K. Lu, A. Pakki, and Q. Wu. Detecting Missing-Check Bugs via Semantic- and Context-Aware Criticalness and Constraints Inferences. In Proceedings of the 28th USENIX Security Symposium (Security), Santa Clara, CA, Aug. 2018.
[34]
A. Milanova, A. Rountev, and B. G. Ryder. Precise Call Graphs for C Programs with Function Pointers. Automated Software Engg., 11 (1): 7--26, Jan. 2004. ISSN 0928--8910.
[35]
C. Min, S. Kashyap, B. Lee, C. Song, and T. Kim. Cross-Checking Semantic Correctness: The Case of Finding File System Bugs. In Proceedings of the 25th ACM Symposium on Operating Systems Principles (SOSP), Monterey, CA, Oct. 2015.
[36]
B. Niu and G. Tan. Modular Control-Flow Integrity. In Proceedings of the 2014 ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), Edinburgh, UK, June 2014.
[37]
B. Niu and G. Tan. Per-Input Control-Flow Integrity. In Proceedings of the 22nd ACM Conference on Computer and Communications Security (CCS), Denver, Colorado, Oct. 2015.
[38]
S. Pailoor, A. Aday, and S. Jana. MoonShine: Optimizing OS Fuzzer Seed Selection with Trace Distillation. In Proceedings of the 27th USENIX Security Symposium (Security), Baltimore, MD, Aug. 2018.
[39]
J. Pewny, P. Koppe, and T. Holz. STEROIDS for DOPed Applications: A Compiler for Automated Data-Oriented Programming. In Proceeding of the 4th IEEE European Symposium on Security.
[40]
A. Prakash, X. Hu, and H. Yin. vfGuard: Strict Protection for Virtual Function Calls in COTS C
[41]
Binaries. In Proceedings of the 2015 Annual Network and Distributed System Security Symposium (NDSS), San Diego, CA, Feb. 2015.
[42]
S. Saha, J.-P. Lozi, G. Thomas, J. L. Lawall, and G. Muller. Hector: Detecting Resource-Release Omission Faults in Error-Handling Code for Systems Software. In 2013 43rd Annual IEEE/IFIP International Conference on Dependable Systems and Networks (DSN), pages 1--12. IEEE, 2013.
[43]
S. Schumilo, C. Aschermann, R. Gawlik, S. Schinzel, and T. Holz. kAFL: Hardware-Assisted Feedback Fuzzing for OS Kernels. In Proceedings of the 26th USENIX Security Symposium (Security), Vancouver, BC, Canada, Aug. 2017.
[44]
t al.(2015)Schuster, Tendyck, Liebchen, Davi, Sadeghi, and Holz]coopF. Schuster, T. Tendyck, C. Liebchen, L. Davi, A. Sadeghi, and T. Holz. Counterfeit Object-Oriented Programming: On the Difficulty of Preventing Code Reuse Attacks in C
[45]
Applications. In Proceedings of the 36th IEEE Symposium on Security and Privacy (Oakland), San Jose, CA, May 2015.
[46]
Y. Shoshitaishvili, R. Wang, C. Salls, N. Stephens, M. Polino, A. Dutcher, J. Grosen, S. Feng, C. Hauser, C. Kruegel, et al. Sok: (State of) the art of war: Offensive techniques in binary analysis. In Proceedings of the 37th IEEE Symposium on Security and Privacy (Oakland), San Jose, CA, May 2016.
[47]
Y. Sui and J. Xue. Svf: interprocedural static value-flow analysis in llvm. In Proceedings of the 25th International Conference on Compiler Construction, pages 265--266. ACM, 2016.
[48]
Y. Sui and J. Xue. Value-Flow-Based Demand-Driven Pointer Analysis for C and C
[49]
. IEEE Transactions on Software Engineering, PP, 09 2018.
[50]
C. Tice, T. Roeder, P. Collingbourne, S. Checkoway, Ú. Erlingsson, L. Lozano, and G. Pike. Enforcing Forward-Edge Control-Flow Integrity in GCC & LLVM. In USENIX Security Symposium, pages 941--955, 2014.
[51]
D. Trabish, A. Mattavelli, N. Rinetzky, and C. Cadar. Chopped Symbolic Execution. In Proceedings of the 40th International Conference on Software Engineering, ICSE '18, 2018.
[52]
acs, Gras, Sambuc, Slowinska, Bos, and Giuffrida]patharmorV. van der Veen, D. Andriesse, E. Göktacs, B. Gras, L. Sambuc, A. Slowinska, H. Bos, and C. Giuffrida. Practical Context-Sensitive CFI. In Proceedings of the 22nd ACM Conference on Computer and Communications Security (CCS), Denver, Colorado, Oct. 2015.
[53]
V. van der Veen, E. Goktas, M. Contag, A. Pawlowski, X. Chen, S. Rawat, H. Bos, T. Holz, E. Athanasopoulos, and C. Giuffrida. A Tough Call: Mitigating Advanced Code-Reuse Attacks at the Binary Level. In Proceedings of the 37th IEEE Symposium on Security and Privacy (Oakland), San Jose, CA, May 2016.
[54]
M. Xu, C. Qian, K. Lu, M. Backes, and T. Kim. Precise and Scalable Detection of Double-Fetch Bugs in OS Kernels. In Proceedings of the 39th IEEE Symposium on Security and Privacy (Oakland), San Francisco, CA, May 2018.
[55]
W. Xu, H. Moon, S. Kashyap, P.-N. Tseng, and T. Kim. Fuzzing File Systems via Two-Dimensional Input Space Exploration. In Proceedings of the 40th IEEE Symposium on Security and Privacy (Oakland), San Francisco, CA, May 2019.
[56]
I. Yun, C. Min, X. Si, Y. Jang, T. Kim, and M. Naik. APISan: Sanitizing API Usages through Semantic Cross-checking. In Proceedings of the 25th USENIX Security Symposium (Security), Austin, TX, Aug. 2016.
[57]
C. Zhang, T. Wei, Z. Chen, L. Duan, L. Szekeres, S. McCamant, D. Song, and W. Zou. Practical Control Flow Integrity and Randomization for Binary Executables. In Proceedings of the 34th IEEE Symposium on Security and Privacy (Oakland), San Francisco, CA, May 2013.
[58]
C. Zhang, D. Song, S. A. Carr, M. Payer, T. Li, Y. Ding, and C. Song. VTrust: Regaining Trust on Virtual Calls. In Proceedings of the 2016 Annual Network and Distributed System Security Symposium (NDSS), San Diego, CA, Feb. 2016.
[59]
M. Zhang and R. Sekar. Control Flow Integrity for COTS Binaries. In Proceedings of the 24th USENIX Security Symposium (Security), Washington, DC, Aug. 2015.

Cited By

View all
  • (2025)Towards Understanding and Defeating Abstract Resource Attacks for Container PlatformsIEEE Transactions on Dependable and Secure Computing10.1109/TDSC.2024.340392022:1(474-490)Online publication date: Jan-2025
  • (2025)Sliver: A Scalable Slicing-Based Verification for Information Flow SecurityIEEE Transactions on Dependable and Secure Computing10.1109/TDSC.2024.340365322:1(457-473)Online publication date: Jan-2025
  • (2025)Constructing arbitrary write via puppet objects and delivering gadgets in Linux kernelComputers & Security10.1016/j.cose.2024.104189150(104189)Online publication date: Mar-2025
  • Show More Cited By

Index Terms

  1. Where Does It Go?: Refining Indirect-Call Targets with Multi-Layer Type Analysis

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image ACM Conferences
    CCS '19: Proceedings of the 2019 ACM SIGSAC Conference on Computer and Communications Security
    November 2019
    2755 pages
    ISBN:9781450367479
    DOI:10.1145/3319535
    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]

    Sponsors

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 06 November 2019

    Permissions

    Request permissions for this article.

    Check for updates

    Badges

    • Best Paper

    Author Tags

    1. cfi
    2. function pointers
    3. indirect-call targets
    4. layered type analysis

    Qualifiers

    • Research-article

    Funding Sources

    Conference

    CCS '19
    Sponsor:

    Acceptance Rates

    CCS '19 Paper Acceptance Rate 149 of 934 submissions, 16%;
    Overall Acceptance Rate 1,261 of 6,999 submissions, 18%

    Upcoming Conference

    CCS '25

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)705
    • Downloads (Last 6 weeks)102
    Reflects downloads up to 09 Feb 2025

    Other Metrics

    Citations

    Cited By

    View all
    • (2025)Towards Understanding and Defeating Abstract Resource Attacks for Container PlatformsIEEE Transactions on Dependable and Secure Computing10.1109/TDSC.2024.340392022:1(474-490)Online publication date: Jan-2025
    • (2025)Sliver: A Scalable Slicing-Based Verification for Information Flow SecurityIEEE Transactions on Dependable and Secure Computing10.1109/TDSC.2024.340365322:1(457-473)Online publication date: Jan-2025
    • (2025)Constructing arbitrary write via puppet objects and delivering gadgets in Linux kernelComputers & Security10.1016/j.cose.2024.104189150(104189)Online publication date: Mar-2025
    • (2024)Improving indirect-call analysis in LLVM with type and data-flow co-analysisProceedings of the 33rd USENIX Conference on Security Symposium10.5555/3698900.3699230(5895-5912)Online publication date: 14-Aug-2024
    • (2024)DEEPTYPEProceedings of the 33rd USENIX Conference on Security Symposium10.5555/3698900.3699229(5877-5894)Online publication date: 14-Aug-2024
    • (2024)Detecting kernel memory bugs through inconsistent memory management intention inferencesProceedings of the 33rd USENIX Conference on Security Symposium10.5555/3698900.3699128(4069-4086)Online publication date: 14-Aug-2024
    • (2024)SymBisectProceedings of the 33rd USENIX Conference on Security Symposium10.5555/3698900.3699040(2493-2510)Online publication date: 14-Aug-2024
    • (2024)What IF is not enough? fixing null pointer dereference with contextual checkProceedings of the 33rd USENIX Conference on Security Symposium10.5555/3698900.3698977(1367-1382)Online publication date: 14-Aug-2024
    • (2024)SPATA: Effective OS Bug Detection with Summary-Based, Alias-Aware, and Path-Sensitive Typestate AnalysisACM Transactions on Computer Systems10.1145/369525042:3-4(1-40)Online publication date: 6-Sep-2024
    • (2024)Semantic-Enhanced Indirect Call Analysis with Large Language ModelsProceedings of the 39th IEEE/ACM International Conference on Automated Software Engineering10.1145/3691620.3695016(430-442)Online publication date: 27-Oct-2024
    • Show More Cited By

    View Options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Login options

    Figures

    Tables

    Media

    Share

    Share

    Share this Publication link

    Share on social media