Automated resource release in device drivers

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

*Corresponding author for this work

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

1 Citation (Scopus)

Abstract

Device drivers require system resources to control hardware and provide fundamental services for applications. The acquired resources must be explicitly released by drivers. Otherwise, these resources will never be reclaimed by the operating system, and they are not available for other programs any more, causing hard-to-find system problems. We study on Linux driver mailing lists, and find many applied patches handle improper resource-release operations, especially in error handling paths. In order to improve current resource management and avoid resource-release omissions in device drivers, we propose a novel approach named AutoRR, which can automatically and safely release resources based on specification-mining techniques. During execution, we maintain a resource-state table by recording the runtime information of function calls. If the driver fails to release acquired resources during execution, AutoRR will report violations and call corresponding releasing functions with the recorded runtime information to release acquired resources. To fully and safely release acquired resources, a dynamic analysis of resource dependency and allocation hierarchy is also performed, which can avoid dead resources and double frees. AutoRR works in both normal execution and error handling paths for reliable resource management. We implement AutoRR with LLVM, and evaluate it on 8 Ethernet drivers in Linux 3.17.2. The evaluation shows that the overhead of AutoRR is very low, and it has successfully fixed 18 detected resource-release omission violations without side effects. Our work shows a feasible way of using specification-mining results to avoid related violations.

Original languageEnglish
Title of host publication2015 IEEE 26th International Symposium on Software Reliability Engineering, ISSRE 2015
PublisherInstitute of Electrical and Electronics Engineers Inc.
Pages172-182
Number of pages11
ISBN (Electronic)9781509004065
DOIs
Publication statusPublished - 13 Jan 2016
Externally publishedYes
Event26th IEEE International Symposium on Software Reliability Engineering, ISSRE 2015 - Gaithersbury, United States
Duration: 2 Nov 20155 Nov 2015

Publication series

Name2015 IEEE 26th International Symposium on Software Reliability Engineering, ISSRE 2015

Conference

Conference26th IEEE International Symposium on Software Reliability Engineering, ISSRE 2015
Country/TerritoryUnited States
CityGaithersbury
Period2/11/155/11/15

Keywords

  • LLVM
  • device drivers
  • dynamic analysis
  • operating systems
  • resource management
  • resource release

Fingerprint

Dive into the research topics of 'Automated resource release in device drivers'. Together they form a unique fingerprint.

Cite this