TCD: Statically Detecting Type Confusion Errors in C plus plus Programs

被引:5
|
作者
Zou, Changwei [1 ]
Sui, Yulei [2 ]
Yan, Hua [1 ]
Xue, Jingling [1 ]
机构
[1] Univ New South Wales, Sch Comp Sci & Engn, Sydney, NSW, Australia
[2] Univ Technol Sydney, Fac Engn & Informat Technol, Sydney, NSW, Australia
基金
澳大利亚研究理事会;
关键词
type confusion; bug detection; software security; pointer analysis; static analysis;
D O I
10.1109/ISSRE.2019.00037
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
For performance reasons, C++, albeit unsafe, is often the programming language of choice for developing software infrastructures. A serious type of security vulnerability in C++ programs is type confusion, which may lead to program crashes and control flow hijack attacks. While existing mitigation solutions almost exclusively rely on dynamic analysis techniques, which suffer from low code coverage and high overhead, static analysis has rarely been investigated. This paper presents TCD, a static type confusion detector built on top of a precise demand-driven field-, context- and flow-sensitive pointer analysis. Unlike existing pointer analyses, TCD is type-aware as it not only preserves the type information in the pointed-to objects but also handles complex language features of C++ such as multiple inheritance and placement new, making it therefore possible to reason about type casting in C++ programs. We have implemented TCD in LLVM and evaluated it using seven C++ applications (totaling 526,385 lines of C++ code) from Qt, a widely-adopted C++ toolkit for creating GUIs and cross-platform software. TCD has found five type confusion bugs, including one reported previously in prior work and four new ones, in under 7.3 hours, with a low false positive rate of 28.2%.
引用
收藏
页码:292 / 302
页数:11
相关论文
共 50 条
  • [1] HexType: Efficient Detection of Type Confusion Errors for C plus
    Jeon, Yuseok
    Biswas, Priyam
    Carr, Scott
    Lee, Byoungyoung
    Payer, Mathias
    [J]. CCS'17: PROCEEDINGS OF THE 2017 ACM SIGSAC CONFERENCE ON COMPUTER AND COMMUNICATIONS SECURITY, 2017, : 2373 - 2387
  • [2] Detecting Exception Handling Bugs in C plus plus Programs
    Zhang, Hao
    Luo, Ji
    Hu, Mengze
    Yan, Jun
    Zhang, Jian
    Qiu, Zongyan
    [J]. 2023 IEEE/ACM 45TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING, ICSE, 2023, : 1084 - 1095
  • [3] Early Detection of Type Errors in C plus plus Templates
    Chen, Sheng
    Erwig, Martin
    [J]. PEPM '14: PROCEEDINGS OF THE ACM SIGPLAN WORKSHOP ON PARTIAL EVALUATION AND PROGRAM MANIPULATION, 2014, : 133 - 144
  • [4] A type system for statically detecting spreadsheet errors
    Ahmad, Y
    Antoniu, T
    Goldwater, S
    Krishnamurthi, S
    [J]. 18TH IEEE INTERNATIONAL CONFERENCE ON AUTOMATED SOFTWARE ENGINEERING, PROCEEDINGS, 2003, : 174 - 183
  • [5] Detecting and Eliminating Potential Violation of Sequential Consistency for Concurrent C/C plus plus Programs
    Duan, Yuelu
    Feng, Xiaobing
    Wang, Lei
    Zhang, Chao
    Yew, Pen-Chung
    [J]. CGO 2009: INTERNATIONAL SYMPOSIUM ON CODE GENERATION AND OPTIMIZATION, PROCEEDINGS, 2009, : 25 - +
  • [6] SPrinter: A Static Checker for Finding Smart Pointer Errors in C plus plus Programs
    Ma, Xutong
    Yan, Jiwei
    Li, Yaqi
    Yan, Jun
    Zhang, Jian
    [J]. 34TH IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMATED SOFTWARE ENGINEERING (ASE 2019), 2019, : 1122 - 1125
  • [7] Model checking C plus plus programs
    Monteiro, Felipe R.
    Gadelha, Mikhail R.
    Cordeiro, Lucas C.
    [J]. SOFTWARE TESTING VERIFICATION & RELIABILITY, 2022, 32 (01):
  • [8] On Monitoring C/C plus plus Transactional Memory Programs
    Fiedor, Jan
    Letko, Zdenek
    Lourenco, Joao
    Vojnar, Tomas
    [J]. MATHEMATICAL AND ENGINEERING METHODS IN COMPUTER SCIENCE, MEMICS 2014, 2014, 8934 : 73 - 87
  • [9] Validating Optimizations of Concurrent C/C plus plus Programs
    Chakraborty, Soham
    Vafeiadis, Viktor
    [J]. PROCEEDINGS OF CGO 2016: THE 14TH INTERNATIONAL SYMPOSIUM ON CODE GENERATION AND OPTIMIZATION, 2016, : 216 - 226
  • [10] Flexible semi-automatic support for type migration of primitives for C/C plus plus programs
    Szalay, Richard
    Porkolab, Zoltan
    [J]. 2022 IEEE INTERNATIONAL CONFERENCE ON SOFTWARE ANALYSIS, EVOLUTION AND REENGINEERING (SANER 2022), 2022, : 878 - 889