Font Size: a A A

Study And Implementation Of Methods For Tracing Runtime Device Drivers

Posted on:2020-11-04Degree:MasterType:Thesis
Country:ChinaCandidate:Z J GuanFull Text:PDF
GTID:2428330578957376Subject:Computer technology
Abstract/Summary:PDF Full Text Request
In Linux system,the device driver causes more errors than other parts of the kernel.Moreover,the bug caused by the device driver can easily affect the stability and security of the operating system.Therefore,it's quite important and necessary to test device driver.In software testing,runtime tracing is an important method to monitor the actual execution of a program.At the same time,runtime information can be used by developers to more accurately analyze programs,such as verifying the correctness of code execution and detecting errors.However,what needs to be emphasized is that the device driver mainly works in kernel mode,it's very difficult to trace the driver in such a particular work scenario.For this reason,a method that can be adopted in the runtime tracing of the device driver is proposed in this paper.The common Linux device driver is taken as the analysis object in this paper,an outline of the current domestic and international device driver analysis methods and research trends are given,and the important position of device drivers in the system and related architecture are analyzed.Partial and overall analysis of the communication architecture are implemented according to the device driver interface communication related mechanism.The device driver runtime tracing method is researched and proposed,which is based on two basic structures,Kprobes and Ftrace.It not only improves the inadequacies of the two methods,but also provides a new idea for pairing function tracing.Combined with the resource interface function frequently used by the kernel,also called the pairing function,further analysis and studies on its matching rules are conducted in this paper,the extraction algorithm of pairing function is proposed,and the corresponding device driver runtime tracing prototype are designed and built.Specifically,the source code of the driver is preprocessed to extract the relevant information of the pairing function.On this basis,the necessary other functions to construct the set of functions to be traced are added,in combination with the execution path of the function to construct the calling relationship of the function,during which time,build an automated tracing module and perform runtime information tracing on the functions in the tracing function set.At the same time,a runtime information log is generated during execution.And finally,the relevant security bug is detected and verified in the automatically generated result report.In order to verify the availability of the method,related functional tests and performance tests for the runtime tracing prototype of the device driver are conducted in this paper.The test results show that the method proposed in this paper can effectively trace device driver and collect rich runtime information.At the same time,multiple violations related to resource usage at runtime are found through the analysis of the recorded runtime information.According to the various functional indicators and performance indicators in the test,the final test results also show that the method has the advantages of high accuracy and low load.Some potential bugs or design flaws in the device driver can be discovered by the device driver runtime tracing method,and the related prototype can be used as an important tool for the development and maintenance of device driver.
Keywords/Search Tags:Linux, Device driver, Pair functions, Runtime tracing
PDF Full Text Request
Related items