This paper presents a user transparent protection against binary code injection attacks. Code injection is a major vehicle for carrying out software attacks. Using the TLB (Translation Lookahead Buffer) that is usually split between data (D-TLB) and i...
This paper presents a user transparent protection against binary code injection attacks. Code injection is a major vehicle for carrying out software attacks. Using the TLB (Translation Lookahead Buffer) that is usually split between data (D-TLB) and instructions (I-TLB) as found in modern processors, a simple protection can be developed based on an observation that activating an injected code causes I-TLB miss for a memory page modified by code injection. If program execution from a modified page is disallowed, injected code cannot start. However, such protection is of limited use unless the protection can handle legitimate runtime generated codes, which would trigger false-alarms due to the same translation trace as that of code injection attacks. Modern systems often utilize runtime-generated code for extensibility and flexibility. In order to prevent such false-alarms, the presented protection identifies the source of the code injected – from external I/O or not and refers to the privilege level of the process at runtime. This paper introduces a scheme that determines whether the code injected is legitimate. By identifying memory pages modified by external I/O operations, the scheme provides software transparent data execution prevention in processors with and without NX-bit support. The experimental results show that the proposed protection can detect all the code injection attacks tested on the two Linux operating systems out of the box and that the performance impact incurred by this protection is insignificant.