Taxonomy of Linux Kernel Vulnerability Solutions
Total Page:16
File Type:pdf, Size:1020Kb
Taxonomy of Linux Kernel Vulnerability Solutions Serguei A. Mokhov Marc-Andre´ Laverdiere` Djamel Benredjem Computer Security Laboratory Computer Security Laboratory Computer Security Laboratory Concordia Institute for Concordia Institute for Concordia Institute for Information Systems Engineering Information Systems Engineering Information Systems Engineering Concordia University, Concordia University, Concordia University, Montreal, Quebec, Canada Montreal, Quebec, Canada Montreal, Quebec, Canada Email: [email protected] Email: ma [email protected] Email: d [email protected] Abstract—This paper presents the results of a case study on C programs in general, as well as statistics on their relative software vulnerability solutions in the Linux kernel. Our major importance. We also introduce a new methodology to track contribution is the introduction of a classification of methods used the patch solving a security issue based only on the contents to solve vulnerabilities. Our research shows that precondition validation, error handling, and redesign are the most used of the security advisory. methods in solving vulnerabilities in the Linux kernel. This The paper is organized as follows: we examine previous contribution is accompanied with statistics on the occurrence work that was done regarding Linux and C security in of the different types of vulnerabilities and their solutions that Section II, followed by a description of the methodology we observed during our case study, combined with example used in order to obtain the solutions to the vulnerabilities in source code patches. We also combine our findings with existing programming guidelines to create the first security-oriented Section III. Afterwards, in Section IV, we show our results, coding guidelines for the Linux kernel. notably classification of the vulnerability solutions we define, Index Terms—Linux kernel, Software Vulnerabilities, Vulner- as well as statistics related to the occurrence of certain ability Remedial, Vulnerability Solutions Taxonomy vulnerabilities and their solutions in our data set. In Section V, we illustrate the vulnerability solutions with patches from I. MOTIVATION our data set. In Section VI, we introduce our guidelines for Linux solutions for both servers and desktops are increasing Linux kernel development based on our findings. Finally, in in popularity and notably so in the developing world as well as Section VII, we conclude. virtualization. Today, systems running on the Linux operating system kernel represent 12.7% of server market and estimated II. RELATED WORK 3%-6% of desktop systems [32], [11]. As Linux is becom- The security of Linux has been covered at many levels in the ing an important actor in the computing world, its security IT industry. The level that drew the more ink so far has been becomes paramount. Similarly to other Unix and Unix-like related to administrative tasks. For example, [12], [19] describe systems, there is a wide variety of software (desktop, shells, the security features of Linux as well as how to properly con- services, etc.) that can be chosen by the administrator from figure Linux-based systems. Other works approach the security various vendors and the security of a Linux-based system thus of Linux systems from the viewpoint of the programmer. For relies on the security of a wide set of applications, libraries, example, Wheeler [33] explains proper coding practices in programming languages, etc. However, what is unique to a both generic and language-specific cases. Furthermore, some Linux system is the Linux kernel itself. Since the kernel studies on the security of the Linux kernel done in the past handles file and network operations, access control, resource incorporated useful statistics on the preponderance of certain allocation, etc., its correct functioning is an important part of types of software vulnerabilities [5], [25], [34]. the overall system security. The world of software vulnerabilities in C and C++ has been We performed this case study on the Linux kernel due to its extensively studied [26], [14], [33], etc. This literature will open-source nature, its popularity, and its development model. often list various forms of software vulnerabilities, explain, This popularity has created a greater interest in scrutinizing the and illustrate them. They will also often propose a method source code for potential vulnerabilities, yielding substantial that can be used to remediate the vulnerability. When turning amount of vulnerability reports to work from. Our study to coding guidelines or code review guidelines [27], [29], examined the solutions to the vulnerabilities reported in 290 [20], [30], [1], [17], we see a need for simple and relevant CVE (Common Vulnerabilities and Exposures referred to from documentation. In some cases, we can find literature [12], [16] [21]) advisories, in the 2.4.x and 2.6.x version families. From that will describe how we can attack Linux systems as well these solutions, we drew a classification scheme and computed as countermeasures to such attacks. statistics related to the usage of these families of solutions. The open-source community created some high-security Our major contribution is the classification of the security variants of Linux for environments requiring it. A first example solutions used for the improvement of the Linux kernel, and is the Linux Security Modules architecture [35], especially known for SELinux [28], which implements strong security link to the revision control systems (BitKeeper [2] and GIT policies, and LIDS [15], which offers intrusion detection ca- [36]), giving us directly the patch related to the problem. pabilities. Another option available is Owl [23], a distribution Sometimes, the advisory would lead us to Linux vendors’ that ensures that the software included runs with minimal advisories and bug tracking systems that lead to a patch privileges and fail-safe defaults which also offers a modified addressing the vulnerability. The advisories would also refer version of the kernel. to Bugtraq [3] emails that announced the vulnerability, which However, as far as we know, there is no study that was done sometimes included a patch to the vulnerability. At other times, on the techniques practically used by developers to remedy the best information that we could find from the advisory was Linux kernel vulnerabilities and their relative importance. the function name, source code file or driver affected, as well as the vulnerable versions. This allowed us to search the patch III. APPROACH of the first unaffected version for this precise information and In this section we summarize the methods we used to find find the solution to the security issue. the remedial methods for given vulnerabilities. Over the course We also found that the vulnerability number, expressed of roughly two years as a part of the research course work, under the CAN/CVE schemes, could often be found in ven- master’s research work [24], and general interest we gathered dors’ bug tracking systems, maintainer mailing lists, maintain- the statistics of common vulnerability solutions, taxonomy of ers’ management systems [8], enthusiasts’ websites [13] and which we present in this paper, covering most Linux kernel newsgroups [6]. This information often leads us, directly or vulnerabilities from 2002 to 2007. indirectly, to the patch for the given vulnerability. We used a spreadsheet program1 to keep track of vulnerabil- The Linux kernel project, for each version, includes a ity numbers, version(s) of the Linux kernel, the classification ChangeLog. The changelog sometimes would include the of the vulnerability, links to the solutions, notes on the CVE/CAN number, or have a comment that allowed us to methodology used to obtain the solution, solution summaries, conclude that it was related to the vulnerability investigated. and the vulnerability solutions’ classification in the comma- The commit comment or GIT commit number was then separated values (CSV) format. This spreadsheet was then queried for in the BitKeeper [2] archives. processed using a Perl script which generated the statistical As we were finding the vulnerability solutions, we also information for the counts, tables, and the relevant graphs. examined them and noted a summary of the code changes We will now look in more depth at the methodology we observed. Broad categories quickly emerged as we were used to obtain our results. We first chose a reliable data doing this activity, which we started allocating to solutions that source for Linux software vulnerabilities and extracted relevant were matching said categories. In order to ensure reasonble vulnerability reports, then used the vulnerability reports as a consistency and proper classification, the authors refined the starting point to find the patch associated. In parallel and after classification and each category’s definition, and then collec- this last activity, we established a classification of the solution tively re-examined most of the patches to ensure that they were types we observed and assigned one or more classification to correctly classified. Afterwards, we used the earlier mentioned each of the patches found. We finally developed an automated Perl script in order to regroup and count the occurrences of tool that extracted statistics from the data set we were using. each vulnerability and solution and generate all the statistical For the extraction of relevant vulnerabilities, we decided figures and table present in the paper. to use the National