Analysis of Program Patches Nature and Searching for Unpatched Code Fragments

Software developers often copy and paste code within a project. Due to the possible existence of defects in the initial code fragment, this can lead to defects propagation across the project. Software changes in new version (patches) usually contain bug fixes, which can be used for detecting similar defects in a project. The purpose of this work is to develop method for analyzing the nature of patches between versions of executables and finding unpatched code fragments. At first, two versions of executables are compared for finding common and changed parts of code. Then, the method determines patches that can possibly be fixes of bugs. The final step is detection of unpatched code fragments. It is based on finding all clones of the buggy code fragments found in previous step which are not patched in the new version of the program. These fragments possibly contain defects. Developed tool allows to analyze programs of several architectures (x86, x86-64, arm, mips, powerpc). The experimental results show that the average percentage of true positive rate on the CoreBench test suite is 73%.

[1]  Andy King,et al.  BinSlayer: accurate comparison of binary executables , 2013, PPREW '13.

[2]  Harold W. Kuhn,et al.  The Hungarian method for the assignment problem , 1955, 50 Years of Integer Programming.

[3]  Cesare Tinelli,et al.  Solving SAT and SAT Modulo Theories: From an abstract Davis--Putnam--Logemann--Loveland procedure to DPLL(T) , 2006, JACM.

[4]  Debin Gao,et al.  iBinHunt: Binary Hunting with Inter-procedural Control Flow , 2012, ICISC.

[5]  Shamil Kurmangaleev,et al.  Platform-independent and scalable tool for binary code clone detection , 2016 .

[6]  Arutyun Avetisyan,et al.  Scalable Framework for Accurate Binary Code Comparison , 2017, 2017 Ivannikov ISPRAS Open Conference (ISPRAS).

[7]  David Lo,et al.  Identifying Linux bug fixing patches , 2012, 2012 34th International Conference on Software Engineering (ICSE).

[8]  Subhas C. Misra,et al.  Relationships Between Selected Software Measures and Latent Bug-Density: Guidelines for Improving Quality , 2003, ICCSA.

[9]  Letha H. Etzkorn,et al.  Recovering traceability links between source code and fixed bugs via patch analysis , 2011, TEFSE '11.

[10]  Chen Jing,et al.  PVDF: An automatic Patch-based Vulnerability Description and Fuzzing method , 2014 .

[11]  Joe D. Warren,et al.  The program dependence graph and its use in optimization , 1984, TOPL.

[12]  Yang Liu,et al.  SPAIN: Security Patch Analysis for Binaries towards Understanding the Pain and Pills , 2017, 2017 IEEE/ACM 39th International Conference on Software Engineering (ICSE).

[13]  Debin Gao,et al.  BinHunt: Automatically Finding Semantic Differences in Binary Programs , 2008, ICICS.