BP-Miner: Mining paired functions from the binary code of drivers for error handling

Hu Qiu Liu, Jia Ju Bai, Yu Ping Wang, Shi Min Hu

Research output: Chapter in Book/Report/Conference proceedingConference contributionpeer-review

3 Citations (Scopus)

Abstract

Kernel extension functions are provided as interfaces for drivers to manage devices and resources, and there are many implicit rules about their usages. One of the most important rules is that many functions should be called in pairs. That is to say, when an error occurs in a function, the driver should call related functions to handle it and release the acquired resources before returning, and we name these functions between normal execution paths and error handling paths as paired functions. However, many developers are unaware of them, which causes lots of bugs. Therefore, it is highly significant to automatically extract paired functions and detect violations for drivers. This paper proposes an efficient tool named BP-Miner, which can extract paired functions from binary code of driver modules and detect violations for error handling in drivers with extracted paired functions. BP-Miner constructs control flow graph (CFG) based on basic blocks of binary code, and locates potential execution paths to extract paired functions. We have evaluated BP-Miner with Linux drivers 2.6.38 and 3.13.0-rc7. 76 bugs are reported by BP-Miner in 2.6.38 which have been fixed in the current latest version 3.13.0-rc7. BP-Miner spends about 90 minutes handling 3653 module files for 3.13.0-rc7, and 859 violations have been detected with 1167 extracted paired functions. As it works on the binary code, it can be utilized to check close-source drivers.

Original languageEnglish
Title of host publicationProceedings - 21st Asia-Pacific Software Engineering Conference, APSEC 2014
EditorsYann-Gael Gueheneuc, Gihwon Kwon, Sungdeok Cha
PublisherIEEE Computer Society
Pages415-422
Number of pages8
ISBN (Electronic)9781479974252
DOIs
Publication statusPublished - 2014
Externally publishedYes
Event21st Asia-Pacific Software Engineering Conference, APSEC 2014 - Jeju Island, Korea, Republic of
Duration: 1 Dec 20144 Dec 2014

Publication series

NameProceedings - Asia-Pacific Software Engineering Conference, APSEC
Volume1
ISSN (Print)1530-1362

Conference

Conference21st Asia-Pacific Software Engineering Conference, APSEC 2014
Country/TerritoryKorea, Republic of
CityJeju Island
Period1/12/144/12/14

Keywords

  • Binary code checking
  • Error path checking
  • Paired functions mining
  • Violations detection

Fingerprint

Dive into the research topics of 'BP-Miner: Mining paired functions from the binary code of drivers for error handling'. Together they form a unique fingerprint.

Cite this