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 条
  • [1] Understanding Integer Overflow in C/C plus
    Dietz, Will
    Li, Peng
    Regehr, John
    Adve, Vikram
    ACM TRANSACTIONS ON SOFTWARE ENGINEERING AND METHODOLOGY, 2015, 25 (01)
  • [2] A Study of C/C plus plus Code Weaknesses on Stack Overflow
    Zhang, Haoxiang
    Wang, Shaowei
    Li, Heng
    Chen, Tse-Hsun
    Hassan, Ahmed E.
    IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2021, 48 (07) : 2359 - 2375
  • [3] Characterizing Buffer Overflow Vulnerabilities in Large C/C plus plus Projects
    Pereira, Jose D'Abruzzo
    Ivaki, Naghmeh
    Vieira, Marco
    IEEE ACCESS, 2021, 9 : 142879 - 142892
  • [4] ABOR: An Automatic Framework for Buffer Overflow Removal in C/C plus plus Programs
    Ding, Sun
    Tan, Hee Beng Kuan
    Zhang, Hongyu
    ENTERPRISE INFORMATION SYSTEMS, ICEIS 2014, 2015, 227 : 204 - 221
  • [5] Identifying and understanding header file hotspots in C/C plus plus build processes
    McIntosh, Shane
    Adams, Bram
    Nagappan, Meiyappan
    Hassan, Ahmed E.
    AUTOMATED SOFTWARE ENGINEERING, 2016, 23 (04) : 619 - 647
  • [6] SMT-Constrained Symbolic Execution Engine for Integer Overflow Detection in C Code
    Muntean, Paul
    Rahman, Mustafizur
    Ibing, Andreas
    Eckert, Claudia
    2015 INFORMATION SECURITY FOR SOUTH AFRICA - PROCEEDINGS OF THE ISSA 2015 CONFERENCE, 2015,
  • [7] Analysis of Entities in C and C plus plus Programs and Relations between Them for Program Understanding
    Belevantsev, A. A.
    Veselevich, E. A.
    Ivannikov, V. P.
    PROGRAMMING AND COMPUTER SOFTWARE, 2016, 42 (01) : 49 - 53
  • [8] Towards Understanding Third-party Library Dependency in C/C plus plus Ecosystem
    Tang, Wei
    Xu, Zhengzi
    Liu, Chengwei
    Wu, Jiahui
    Yang, Shouguo
    Li, Yi
    Luo, Ping
    Liu, Yang
    PROCEEDINGS OF THE 37TH IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMATED SOFTWARE ENGINEERING, ASE 2022, 2022,
  • [9] C for C plus plus programmers
    Stevens, A
    DR DOBBS JOURNAL, 1997, 22 (07): : 99 - 102
  • [10] Method of integer overflow detection to avoid buffer overflow
    School of Computer Science and Engineering, Southeast University, Nanjing 211189, China
    不详
    J. Southeast Univ. Engl. Ed., 2009, 2 (219-223):