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 条
  • [21] An integer overflow detection method based on integer variable unification
    Xu, Guo-Ai
    Zhang, Miao
    Chen, Ai-Guo
    Li, Zhong-Xian
    Beijing Youdian Daxue Xuebao/Journal of Beijing University of Posts and Telecommunications, 2008, 31 (06): : 90 - 93
  • [22] C/C plus plus Thread Safety Analysis
    Hutchins, DeLesley
    Ballman, Aaron
    Sutherland, Dean
    2014 14TH IEEE INTERNATIONAL WORKING CONFERENCE ON SOURCE CODE ANALYSIS AND MANIPULATION (SCAM 2014), 2014, : 41 - 46
  • [23] Bridging Excel and C/C plus plus Code
    Punuru, Janardhana R.
    Knopf, F. Carl
    COMPUTER APPLICATIONS IN ENGINEERING EDUCATION, 2008, 16 (04) : 289 - 304
  • [24] Clacc: OpenACC for C/C plus plus in Clang
    Denny, Joel E.
    Lee, Seyong
    Valero-Lara, Pedro
    Gonzalez-Tallada, Marc
    Teranishi, Keita
    Vetter, Jeffrey S.
    INTERNATIONAL JOURNAL OF HIGH PERFORMANCE COMPUTING APPLICATIONS, 2024, 38 (05): : 427 - 446
  • [25] Integer multiplication with overflow detection or saturation
    Schulte, MJ
    Balzola, PI
    Akkas, A
    Brocato, RW
    IEEE TRANSACTIONS ON COMPUTERS, 2000, 49 (07) : 681 - 691
  • [26] Precise measurement of the branching fractions of J/ψ→<overline>Λπ plus Σ- plus c.c. and J/ψ→<overline>Λπ-Σ plus plus c.c
    Ablikim, M.
    Achasov, M. N.
    Adlarson, P.
    Aliberti, R.
    Amoroso, A.
    An, M. R.
    An, Q.
    Bai, Y.
    Bakina, O.
    Balossino, I.
    Ban, Y.
    Batozskaya, V.
    Begzsuren, K.
    Berger, N.
    Berlowski, M.
    Bertani, M.
    Bettoni, D.
    Bianchi, F.
    Bianco, E.
    Bloms, J.
    Bortone, A.
    Boyko, I.
    Briere, R. A.
    Brueggemann, A.
    Cai, H.
    Cai, X.
    Calcaterra, A.
    Cao, G. F.
    Cao, N.
    Cetin, S. A.
    Chang, J. F.
    Chang, T. T.
    Chang, W. L.
    Che, G. R.
    Chelkov, G.
    Chen, C.
    Chen, Chao
    Chen, G.
    Chen, H. S.
    Chen, M. L.
    Chen, S. J.
    Chen, S. M.
    Chen, T.
    Chen, X. R.
    Chen, X. T.
    Chen, Y. B.
    Chen, Y. Q.
    Chen, Z. J.
    Cheng, W. S.
    Choi, S. K.
    PHYSICAL REVIEW D, 2023, 108 (11)
  • [27] RICB: Integer Overflow Vulnerability Dynamic Analysis via Buffer Overflow
    Wang Yong
    Gu Dawu
    Xu Jianping
    Wen Mi
    Deng Liwen
    CHINA COMMUNICATIONS, 2010, 7 (06) : 10 - 16
  • [28] C PORTAL Online Educational Framework for C and C plus plus Languages
    Gabor, Adam
    Nemeth, Denes
    Szeberenyi, Imre
    CSEDU 2009: PROCEEDINGS OF THE FIRST INTERNATIONAL CONFERENCE ON COMPUTER SUPPORTED EDUCATION, VOL I, 2009, : 248 - 253
  • [29] On hard gamma-rays from Ra (C plus C' plus C" plus D)
    Nishida, S
    PHYSICAL REVIEW, 1937, 51 (11): : 0996 - 0996
  • [30] C plus plus and Interoperability Between Libraries: The GraphBLAS C plus plus Specification
    Brock, Benjamin
    McMillan, Scott
    Buluc, Aydin
    Mattson, Timothy G.
    Moreira, Jose E.
    2023 IEEE INTERNATIONAL PARALLEL AND DISTRIBUTED PROCESSING SYMPOSIUM WORKSHOPS, IPDPSW, 2023, : 207 - 215