이진 조작을 통한 정적 스택 보호 시 발생하는 명령어 밀림현상 방지 기법

Instruction-corruption-less Binary Modification Mechanism for Static Stack Protections

  • 이영림 (고려대학교 컴퓨터학과) ;
  • 김영필 (고려대학교 컴퓨터학과) ;
  • 유혁 (고려대학교 컴퓨터학과)
  • 발행 : 2008.02.15

초록

현재 많은 센서 운영체제에서는 메모리 제약 때문에 스레드 스택을 공유한다. 하지만 대부분의 대상 플랫폼에서는 MMU가 없어서 하드웨어적으로 스택 보호가 이루어지기 어렵다. 이러한 문제를 해결하기 위해 바이너리코드에 스택 보호 기능을 가진 래퍼 함수를 추가하고 바이너리 코드 안에 존재하는 스택 연산 명령어들을 스택 보호 기능을 가진 래퍼 함수호출로 바꾸어준다. 이때 스택 영역에 접근하는 명령어들과 스택 관리 모듈로의 분기 명령어간의 명령어 길이 차이에 의한 명령어 밀림현상이 발생한다. 이러한 문제를 해결하기 위해 본 논문에서는 밀림현상을 발생시키지 않고 임의의 명령어를 추가된 임의의 모듈을 호출하는 알고리즘을 제안하였다. 이 알고리즘은 제한된 도달 범위를 가지는 분기명령어를 반복적으로 사용하여 명령어 밀림현상 없이 추가된 임의의 모듈에 도달하게 한다. 본 논문에서 제안한 알고리즘은 센서 노드의 소프트웨어 보안 패치와 소프트웨어적 유지 보수를 용이하게 할 것이다.

Many sensor operating systems have memory limitation constraint; therefore, stack memory areas of threads resides in a single memory space. Because most target platforms do not have hardware MMY (Memory Management Unit), it is difficult to protect each stack area. The method to solve this problem is to exchange original stack handling instructions in binary code for wrapper routines to protect stack area. In this exchanging phase, instruction corruption problem occurs due to difference of each instruction length between stack handling instructions and branch instructions. In this paper, we propose the algorithm to call a target routine without instruction corruption problem. This algorithm can reach a target routine by repeating branch instructions to have a short range. Our solution makes it easy to apply security patch and maintain upgrade of software of sensor node.

키워드

참고문헌

  1. Rob von Behren, Jeremy Condit and Eric Brewer, "Why Event Are A Bad Idea," the 9th Workshop on Hot Topics in Operating System, Lihue, Hawaii, USA, May 18-21, 2003
  2. H. Abrach, S. Bhatti, J. Carlson, H. Dai, J. Rose, A. Sheth, B. Shucker, J. Deng, R. Han, MANTIS: system support for multimodAl NeTworks of in- situ sensors, Proceedings of the 2nd ACM international conference on Wireless sensor networks and applications, September 19-19, 2003, San Diego, CA, USA
  3. Seungmin Park, Jin Won Kim, Kwangyong Lee, Kee-Young Shin, Daeyoung Kim, "Embedded Sensor Networked Operating System," Ninth IEEE International Symposium on Object and Component- Oriented Real-Time Distributed Computing (ISORC '06) pp. 117-124
  4. 이영림, 김영필, 유혁, "MMU가 없는 Thread기반 운영체제에서 스택 보호를 위한 메모리 관리 기법", 한국정보과학회 추계학술대회, 2006년 10월
  5. LEVIS, P., MADDEN, S., GAY, D., POLASTRE, J., SZEWCZYK, R., WOO, A., BREWER, E., AND CULLER, D. The emergence of networking abstractions and techniques in tinyos. In Proceedings of the First Symposium on Networked Systems Design and Implementation (2004), USENIX Association, pp. 1-14
  6. atmega128 datasheet, available : http://www.atmel.com/
  7. Bruce Jacob, "Uniprocessor Virtual Memory without TLBs," IEEE Transaction on Computers, Vol.50, No.5, May 2001
  8. Siddharth Choudhuri, "Software Virtual Memory Management for MMU-less Embedded Systems," Technical Report CECS-05-16, 2005
  9. Kishan A, Lam M, "Dynamic Kernel Modification and extensibility," Technical Report of SUIF Group, Department of Computer Science, Stanford University Stanford CA, 2002
  10. David J. Pearce, Paul H.J. Kelly, Tony Field and Uli Harder, "GILK: A dynamic instrumentation tool for the Linux Kernel," In Proceedings of the 12th International Conference on Modeling Tools and Techniques for Computer and Communication System Performance Evaluation(TOOLS '02), page 220-226, April 2002