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 条
  • [31] C plus plus standards
    Myers, N
    DR DOBBS JOURNAL, 1997, 22 (11): : 10 - +
  • [32] C plus plus evolves!
    Naumann, Axel
    20TH INTERNATIONAL CONFERENCE ON COMPUTING IN HIGH ENERGY AND NUCLEAR PHYSICS (CHEP2013), PARTS 1-6, 2014, 513
  • [33] ABC: Accelerated Building of C/C plus plus Projects
    Zhang, Ying
    Jiang, Yanyan
    Xu, Chang
    Ma, Xiaoxing
    Yu, Ping
    2015 22ND ASIA-PACIFIC SOFTWARE ENGINEERING CONFERENCE (APSEC 2015), 2015, : 182 - 189
  • [34] C plus plus constructors
    Meyers, S
    DR DOBBS JOURNAL, 1997, 22 (05): : 10 - 10
  • [35] C plus plus builder
    Brauer, R
    DR DOBBS JOURNAL, 1997, 22 (07): : 12 - 12
  • [36] Validating Optimizations of Concurrent C/C plus plus Programs
    Chakraborty, Soham
    Vafeiadis, Viktor
    PROCEEDINGS OF CGO 2016: THE 14TH INTERNATIONAL SYMPOSIUM ON CODE GENERATION AND OPTIMIZATION, 2016, : 216 - 226
  • [37] Methods for effective C/C plus plus unit testing
    Kolawa, A
    Dunlop, C
    EIGHTEENTH ANNUAL PACIFIC NORTHWEST SOFTWARE QUALITY CONFERENCE, PROCEEDINGS, 2000, : 29 - 43
  • [38] C plus plus constructors
    Plochan, F
    DR DOBBS JOURNAL, 1997, 22 (08): : 10 - +
  • [39] Tracing Error Propagation in C/C plus plus Applications
    Kong, Shiyi
    Lu, Minyan
    Li, Luyi
    2018 IEEE 18TH INTERNATIONAL CONFERENCE ON SOFTWARE QUALITY, RELIABILITY AND SECURITY COMPANION (QRS-C), 2018, : 308 - 315
  • [40] Investigating the Performance of C and C plus plus Cryptographic Libraries
    Alrowaithy, Majed
    Thomas, Nigel
    PROCEEDINGS OF THE 12TH EAI INTERNATIONAL CONFERENCE ON PERFORMANCE EVALUATION METHODOLOGIES AND TOOLS (VALUETOOLS 2019), 2019, : 167 - 170