Qualcomm Hexagon is an architecture for general-purpose digital signal processors and is used for mobile communication of various devices. Despite the importance of security as much as its popularity, studies on the correctness of emulators and decompilers are insufficient, which are essential for Hexagon's security analysis. In this study, we propose a differential testing tool to automatically discover bugs in emulators and decompilers for Hexagon. To this end, we devise an algorithm to generate random instructions while ensuring constraints in Hexagon; Hexagon employs several constraints in its instruction because of its VLIW (very long instruction word) structure. Then, we applied our tool to two emulators for Hexagon (hexagon-sim and quic/qemu) and one decompiler, binja-hexagon from Google. As a result, we found about 15,000 instructions that cause inconsistent results among them. By analyzing these instructions, we could discover four bugs which are fatal to the correctness.
Qualcomm Hexagon은 범용 디지털 신호 프로세서를 위한 아키텍처로, 다양한 기기의 이동통신에 사용되고 있다. 그 대중성만큼 보안의 중요성이 대두됨에도 불구하고, Hexagon의 보안성 분석에 필수적인 에뮬레이터와 디컴파일러의 정확성에 대한 연구는 미비한 실정이다. 본 연구에서는 Hexagon 에뮬레이터와 디컴파일러로부터 버그를 자동으로 찾아내는 차등 테스트 도구를 제안한다. 이를 위해 Hexagon의 VLIW 구조로부터 기인하는 명령어의 제약 조건들을 알아보고, 이 제약 조건들을 준수하여 무작위의 명령어들을 생성할 수 있는 알고리즘을 고안하였다. 그리고 이를 통해 작성한 차등 테스트 도구를 Hexagon의 널리 알려진 두 에뮬레이터인 hexagon-sim과 quic/qemu, 그리고 디컴파일러인 binja-hexagon에 적용하였다. 그 결과 서로 다른 결과를 반환하는 약 15,000개의 명령어 입력들을 찾을 수 있고, 이를 분석하여 에뮬레이터와 디컴파일러의 정확성에 치명적인 4개의 버그를 발견했다.