HexType: Efficient Detection of Type Confusion Errors for C plus

被引:22
|
作者
Jeon, Yuseok [1 ]
Biswas, Priyam [1 ]
Carr, Scott [1 ]
Lee, Byoungyoung [1 ]
Payer, Mathias [1 ]
机构
[1] Purdue Univ, W Lafayette, IN 47907 USA
基金
美国国家科学基金会;
关键词
Type confusion; Bad casting; Type safety; Typecasting; Static_cast; Dynamic_cast; Reinterpret_cast; SAFETY;
D O I
10.1145/3133956.3134062
中图分类号
TP [自动化技术、计算机技术];
学科分类号
0812 ;
摘要
Type confusion, often combined with use-after-free, is the main attack vector to compromise modern C++ software like browsers or virtual machines. Typecasting is a core principle that enables modularity in C++. For performance, most typecasts are only checked statically, i.e., the check only tests if a cast is allowed for the given type hierarchy, ignoring the actual runtime type of the object. Using an object of an incompatible base type instead of a derived type results in type confusion. Attackers abuse such type confusion issues to attack popular software products including Adobe Flash, PHP, Google Chrome, or Firefox. We propose to make all type checks explicit, replacing static checks with full runtime type checks. To minimize the performance impact of our mechanism HexType, we develop both low-overhead data structures and compiler optimizations. To maximize detection coverage, we handle specific object allocation patterns, e.g., placement new or re int erpret_cast which are not handled by other mechanisms. Our prototype results show that, compared to prior work, Hex Type has at least 1.1- 6.1 times higher coverage on Firefox benchmarks. For SPEC CPU2006 benchmarks with overhead, we show a 2 - 33.4 times reduction in overhead. In addition, HexType discovered 4 new type confusion bugs in Qt and Apache Xerces-C++.
引用
收藏
页码:2373 / 2387
页数:15
相关论文
共 50 条
  • [11] DETECTION OF (C plus A)-TYPE DISLOCATION SELF-BLOCKING IN MAGNESIUM
    Grinberg, B. A.
    Ivanov, M. A.
    Antonova, O. V.
    Vlasova, A. M.
    Kruglikov, N. A.
    Plotnikov, A. V.
    [J]. RUSSIAN PHYSICS JOURNAL, 2012, 54 (08) : 906 - 913
  • [12] EffectiveSan: Type and Memory Error Detection using Dynamically Typed C/C plus
    Duck, Gregory J.
    Yap, Roland H. C.
    [J]. PROCEEDINGS OF THE 39TH ACM SIGPLAN CONFERENCE ON PROGRAMMING LANGUAGE DESIGN AND IMPLEMENTATION, PLDI 2018, 2018, : 181 - 195
  • [13] EffectiveSan: Type and Memory Error Detection using Dynamically Typed C/C plus
    Duck, Gregory J.
    Yap, Roland H. C.
    [J]. ACM SIGPLAN NOTICES, 2018, 53 (04) : 181 - 195
  • [14] Enhanced Memory Corruption Detection in C/C plus plus Programs
    Lin, Ching-Yi
    Yang, Wuu
    [J]. PROCEEDINGS OF THE 52ND INTERNATIONAL CONFERENCE ON PARALLEL PROCESSING WORKSHOPS PROCEEDINGS, ICPP-W 2023, 2023, : 71 - 78
  • [15] An Architectural Smells Detection Tool for C and C plus plus projects
    Biaggi, Andrea
    Fontana, Francesca Arcelli
    Roveda, Riccardo
    [J]. 44TH EUROMICRO CONFERENCE ON SOFTWARE ENGINEERING AND ADVANCED APPLICATIONS (SEAA 2018), 2018, : 417 - 420
  • [16] QUAFF: efficient C plus plus design for parallel skeletons
    Falcou, J.
    Serot, J.
    Chateau, T.
    Lapreste, J. T.
    [J]. PARALLEL COMPUTING, 2006, 32 (7-8) : 604 - 615
  • [17] 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
  • [18] EFFICIENT DETECTION OF ALL POINTER AND ARRAY ACCESS ERRORS
    AUSTIN, TM
    BREACH, SE
    SOHI, GS
    [J]. SIGPLAN NOTICES, 1994, 29 (06): : 290 - 301
  • [19] TOWARDS EFFICIENT CORRECTION OF COCONUT TREE DETECTION ERRORS
    Vargas-Munoz, John E.
    Schibli, Diego
    Tuia, Devis
    [J]. 2022 IEEE INTERNATIONAL GEOSCIENCE AND REMOTE SENSING SYMPOSIUM (IGARSS 2022), 2022, : 5065 - 5068
  • [20] Techniques for Memory-Efficient Model Checking of C and C plus plus Code
    Rockai, Petr
    Still, Vladimir
    Barnat, Jiri
    [J]. SOFTWARE ENGINEERING AND FORMAL METHODS, 2015, 9276 : 268 - 282