TY - GEN
T1 - Runtime checking for paired functions in device drivers
AU - Bai, Jia Ju
AU - Liu, Hu Qiu
AU - Wang, Yu Ping
AU - Hu, Shi Min
N1 - Publisher Copyright:
© 2014 IEEE.
PY - 2014
Y1 - 2014
N2 - Device drivers usually invoke functions to allocate resources for managing hardware devices and communicating with the kernel, and these resources should be released by functions when the work is finished. Thus allocating functions and releasing functions must be invoked in pairs. However, many developers ignore this vital rule, and some allocated resources are not released in time, which may cause resource related problems like deadlocks and memory leak. For improving the resource management of device drivers, we propose an approach named PairDyn to check these paired functions during runtime. When the driver runs, PairDyn records the runtime information of allocating functions such as key parameters and return value, and dynamically detects whether the relevant releasing functions are invoked to free allocated resources during runtime. Before the driver exits, PairDyn automatically attempts to invoke the related releasing functions which are lacked in runtime, in order to free the allocated resources of the operation system. We have implemented PairDyn with the LLVM compiler infrastructure, and make the evaluation with four real device drivers in Linux version 3.10.1. The experimental result shows that with the low extra overhead, PairDyn can provide effective runtime checking for allocate-release paired functions. Moreover, 9 potential bugs are found in the four drivers, which are all fixed automatically before exiting. Finally, no manual modification of the source code is needed with PairDyn.
AB - Device drivers usually invoke functions to allocate resources for managing hardware devices and communicating with the kernel, and these resources should be released by functions when the work is finished. Thus allocating functions and releasing functions must be invoked in pairs. However, many developers ignore this vital rule, and some allocated resources are not released in time, which may cause resource related problems like deadlocks and memory leak. For improving the resource management of device drivers, we propose an approach named PairDyn to check these paired functions during runtime. When the driver runs, PairDyn records the runtime information of allocating functions such as key parameters and return value, and dynamically detects whether the relevant releasing functions are invoked to free allocated resources during runtime. Before the driver exits, PairDyn automatically attempts to invoke the related releasing functions which are lacked in runtime, in order to free the allocated resources of the operation system. We have implemented PairDyn with the LLVM compiler infrastructure, and make the evaluation with four real device drivers in Linux version 3.10.1. The experimental result shows that with the low extra overhead, PairDyn can provide effective runtime checking for allocate-release paired functions. Moreover, 9 potential bugs are found in the four drivers, which are all fixed automatically before exiting. Finally, no manual modification of the source code is needed with PairDyn.
KW - Device drivers
KW - Operation system
KW - Paired functions
KW - Resource management
KW - Runtime checking
UR - https://www.scopus.com/pages/publications/84951277991
U2 - 10.1109/APSEC.2014.66
DO - 10.1109/APSEC.2014.66
M3 - 会议稿件
AN - SCOPUS:84951277991
T3 - Proceedings - Asia-Pacific Software Engineering Conference, APSEC
SP - 407
EP - 414
BT - Proceedings - 21st Asia-Pacific Software Engineering Conference, APSEC 2014
A2 - Gueheneuc, Yann-Gael
A2 - Kwon, Gihwon
A2 - Cha, Sungdeok
PB - IEEE Computer Society
T2 - 21st Asia-Pacific Software Engineering Conference, APSEC 2014
Y2 - 1 December 2014 through 4 December 2014
ER -