Detection of Potential Invalid Function Pointer Access Error based on Assembly Codes

어셈블리어 코드 기반의 Invalid Function Pointer Access Error 가능성 검출

  • Published : 2010.05.27

Abstract

Though a compiler checks memory errors, it is difficult for the compiler to detect function pointer errors in code level. Thus, in this paper, we propose a method for effectively detecting Invalid function pointer access errors, by analyzing assembly codes that are obtained by disassembling an executable file. To detect the errors, assembly codes in disassembled files are checked out based on the instruction transition diagrams which are constructed through analyzing normal usage patterns of function pointer access. When applying the proposed method to various programs having no compilation error, a total of about 500 potential errors including the ones of well-known open source programs such as Apache web server and PHP script interpreter are detected among 1 million lines of assembly codes corresponding to a total of about 10 thousand functions.

일반적으로 컴파일러가 프로그램 번역시 메모리 사용 오류에 대한 검사도 병행하지만, 코드 레벨에서는 검사가 불가능한 함수 포인터는 정상적인 검사가 매우 힘들다. 이에 본 논문에서는 실행 프로그램을 역어셈블하여 만들어진 어셈블리 언어 프로그램을 구문 분석하여 함수 포인터 사용의 형태(패턴)를 어셈블리 명령어 전이도를 기반으로 "Invalid Function Pointer Access Error"에 대한 오류 가능성을 검출한다. 검사대상인 3개 프로그램은 약 10,000개의 함수와 1,000,000 개의 어셈블리 명령어로 구성되어 있으며, 본 논문에서 제안한 방법을 사용하여 함수 포인터의 사용 오류를 검출한 결과 1,100개의 함수 포인터 사용 중 약 500개의 비정상적 함수 포인터의 사용을 검출하였으며 검출에 걸린 시간은 총 82초 정도가 소요되었다.

Keywords