Chroot Hardening Through System Calls Modification

The chroot system call implemented in Unix-like (or *nix) OSes changes a view of the file structure for the calling process and its children by changing the root directory for them. It was intended as an administrative tool and not a security one and the Linux implementation follows the Portable Operating System Interface (POSIX) standards. However, it is used as a security tool extensively. Difference in intended use and actual use of chroot in Linux implementation has resulted in labeling of some features as security vulnerabilities. Vulnerabilities could allow malicious users to completely circumvent the security aspect of chroot. The methods used in this paper removes the cause of those vulnerabilities which results in a more secure construct. Some of those are: not changing of the Current Working Directory (CWD), not closing file descriptors and allowing mounting of file systems inside the newly created environment. In this paper we try to address these specific issues by modifying the system calls in the system call table and more generally, present a solution with a good design. The proposed solutions aims to improve the design of chroot when used as a security construct.