BP-Miner: Mining Paired Functions from the Binary Code of Drivers for Error Handling

Hu-Qiu Liu, Jia-Ju Bai, Yuping Wang, Shimin Hu
{"title":"BP-Miner: Mining Paired Functions from the Binary Code of Drivers for Error Handling","authors":"Hu-Qiu Liu, Jia-Ju Bai, Yuping Wang, Shimin Hu","doi":"10.1109/APSEC.2014.67","DOIUrl":null,"url":null,"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.","PeriodicalId":380881,"journal":{"name":"2014 21st Asia-Pacific Software Engineering Conference","volume":"45 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2014-12-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"3","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"2014 21st Asia-Pacific Software Engineering Conference","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/APSEC.2014.67","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 3

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.
BP-Miner:从驱动程序的二进制代码中挖掘配对函数以进行错误处理
内核扩展函数是作为驱动程序管理设备和资源的接口提供的,关于它们的用法有许多隐含的规则。最重要的规则之一是,许多函数应该成对调用。也就是说,当函数发生错误时,驱动程序应该调用相关的函数来处理它,并在返回之前释放获得的资源,我们将这些位于正常执行路径和错误处理路径之间的函数称为成对函数。然而,许多开发人员并没有意识到这一点,从而导致了许多错误。因此,对驾驶员进行配对函数的自动提取和违规检测具有重要意义。本文提出了一种高效的BP-Miner工具,该工具可以从驱动模块的二进制代码中提取成对函数,并利用提取的成对函数检测驱动程序的错误处理。BP-Miner基于二进制代码的基本块构造控制流图(CFG),并定位潜在的执行路径以提取成对函数。我们已经在Linux驱动程序2.6.38和3.13.0-rc7上评估了BP-Miner。BP-Miner在2.6.38中报告了76个错误,这些错误已在当前最新版本3.13.0-rc7中修复。BP-Miner花了大约90分钟处理3.13.0-rc7的3653个模块文件,在提取的1167个配对函数中检测到859个违规行为。由于它在二进制代码上工作,因此可以用来检查闭源驱动程序。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信