The Linux kernel stack has only limited space and shared by numerous threads. This feature was exploited by an attacker over 10 years, but any patch is done for resolving this issue. One of the vulnerability stems from this feature is Use-before-initialization (UBI) bug. UBI is a common type of memory error in which variables are declared and read from without being initialized beforehand. Exploiting such a vulnerability could allow the attacker to modify the control flow, or peek into sensitive memory values via information leak. However, even with its potential to compromise a program as crucial as Linux Kernel, UBI vulnerabilities rarely get attention compared to Use-After-Free vulnerabilities. Furthermore, current full memory-safety implements do not consider UBI vulnerabilities, lead to exposing a new attack path via CVE-2010-2963. Lu et al.[7] proposes UBI defenses as an extensive analysis of the source code but it causes a detrimental effect on the performance. This thesis presents StackCleaner, a stack sanitizer for mitigating the UBI vulnerability. StackCleaner minimizes the exploitability of a UBI vulnerability via initializing only used stack area by a system call, resulting in an uninitialized variable not be crafted by the attackers with rigged function calls. The prototype of StackCleaner is implemented for system calls in x86-64 Linux, and tried to boot using instrumented the Kernel image. The proposed mitigation, StackCleaner shows a few running overheads and does not harm the normal routine of the kernel, proving a few side effects.
리눅스 커널 스택은 제한된 공간을 가지고 있으며 많은 스레드들에 의해 공유된다. 이 때문에 발생한 취약점 중 하나는 초기화 전 사용(UBI) 이다. UBI는 미리 초기화하지 않고 변수를 읽는 일반적인 메모리 오류 유형이다. 이러한 취약점을 악용하면 공격자가 정보 유출을 통해 제어 흐름을 수정하거나 중요한 메모리 값을 들여다 볼 수 있다. 그러나 리눅스 커널만큼 중요한 프로그램을 손상시킬 가능성이 있다고하더라도 UBI의 취약점은 메모리 해제 후 사용하는 취약점과 비교하여 거의 주목을받지 못하였다. 또한 현재의 메모리 방어를 위한 안전 장치는 UBI 취약점을 고려하지 않아 CVE-2010-2963을 통해 새로운 공격 경로를 노출하였다. 많은 연구자들이 UBI 방어를 컴파일러를 이용한 소스 코드의 분석 및 수정을 제안하였지만, 이는 성능에 많은 악영향을 미친다. 이 논문에서는 UBI 취약점을 방어하기 위한 StackCleaner를 제시하였다. StackCleaner는 시스템 호출에 의해 사용 된 스택 영역 만 초기화함으로써 UBI 취약성의 악용 가능성을 최소화하므로 초기화되지 않은 변수가 공격자에 의해 사용되지 않는다. StackCleaner의 프로토 타입은 64비트 리눅스에서 시스템 호출 엔트리에 구현되었다. 또한 StackCleaner는 커널의 정상적인 루틴을 손상시키지 않았을 뿐만 아니라 좋은 성능을 보여주였다.