Understanding Integer Overflow in C/C plus

被引:0
|
作者
Dietz, Will [1 ]
Li, Peng [2 ]
Regehr, John [2 ]
Adve, Vikram [1 ]
机构
[1] Univ Illinois, Dept Comp Sci, 1304 W Springfield Ave, Urbana, IL 61801 USA
[2] Univ Utah, Sch Comp, Salt Lake City, UT 84112 USA
关键词
integer overflow; integer wraparound; undefined behavior;
D O I
暂无
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Integer overflow bugs in C and C++ programs are difficult to track down and may lead to fatal errors or exploitable vulnerabilities. Although a number of tools for finding these bugs exist, the situation is complicated because not all overflows are bugs. Better tools need to be constructed-but a thorough understanding of the issues behind these errors does not yet exist. We developed IOC, a dynamic checking tool for integer overflows, and used it to conduct the first detailed empirical study of the prevalence and patterns of occurrence of integer overflows in C and C++ code. Our results show that intentional uses of wraparound behaviors are more common than is widely believed; for example, there are over 200 distinct locations in the SPEC CINT2000 benchmarks where overflow occurs. Although many overflows are intentional, a large number of accidental overflows also occur. Orthogonal to programmers' intent, overflows are found in both well-defined and undefined flavors. Applications executing undefined operations can be, and have been, broken by improvements in compiler optimizations. Looking beyond SPEC, we found and reported undefined integer overflows in SQLite, PostgreSQL, SafeInt, GNU MPC and GMP, Firefox, GCC, LLVM, Python, BIND, and OpenSSL; many of these have since been fixed. Our results show that integer overflow issues in C and C++ are subtle and complex, that they are common even in mature, widely used programs, and that they are widely misunderstood by developers.
引用
收藏
页码:760 / 770
页数:11
相关论文
共 50 条
  • [41] Model Checking of C and C plus plus with DIVINE 4
    Baranova, Zuzana
    Barnat, Jiri
    Kejstova, Katarina
    Kucera, Tadeas
    Lauko, Henrich
    Mrazek, Jan
    Rockai, Petr
    Still, Vladimir
    AUTOMATED TECHNOLOGY FOR VERIFICATION AND ANALYSIS (ATVA 2017), 2017, 10482 : 201 - 207
  • [42] C plus plus interfaces for C-language libraries
    Baker, LE
    DR DOBBS JOURNAL, 1997, 22 (08): : 34 - +
  • [43] C and C plus plus Language Application Similarity Analysis
    Zhou Jianru
    PROCEEDINGS OF THE 2015 INTERNATIONAL CONFERENCE ON EDUCATION, MANAGEMENT AND COMPUTING TECHNOLOGY, 2015, 30 : 1167 - 1170
  • [44] Program Transformations to Fix C Buffer Overflow
    Shaw, Alex
    36TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING (ICSE COMPANION 2014), 2014, : 733 - 735
  • [45] On Monitoring C/C plus plus Transactional Memory Programs
    Fiedor, Jan
    Letko, Zdenek
    Lourenco, Joao
    Vojnar, Tomas
    MATHEMATICAL AND ENGINEERING METHODS IN COMPUTER SCIENCE, MEMICS 2014, 2014, 8934 : 73 - 87
  • [46] An adaptor for C plus plus callbacks with C and Fortran libraries
    Broeckhove, J.
    Vanmechelen, K.
    COMPUTER PHYSICS COMMUNICATIONS, 2013, 184 (03) : 824 - 832
  • [48] C11Tester: A Race Detector for C/C plus plus Atomics
    Luo, Weiyu
    Demsky, Brian
    ASPLOS XXVI: TWENTY-SIXTH INTERNATIONAL CONFERENCE ON ARCHITECTURAL SUPPORT FOR PROGRAMMING LANGUAGES AND OPERATING SYSTEMS, 2021, : 630 - 646
  • [49] Efficient integer multiplication overflow detection circuits
    Gok, M
    Schulte, MJ
    Balzola, PI
    CONFERENCE RECORD OF THE THIRTY-FIFTH ASILOMAR CONFERENCE ON SIGNALS, SYSTEMS AND COMPUTERS, VOLS 1 AND 2, 2001, : 1661 - 1665
  • [50] Integer Overflow Detection with Delayed Runtime Test
    Huang, Zhen
    Yu, Xiaowei
    ARES 2021: 16TH INTERNATIONAL CONFERENCE ON AVAILABILITY, RELIABILITY AND SECURITY, 2021,