[go: up one dir, main page]

KR102833142B1 - Dynamic kernel module protection method of mobile device and system using the same - Google Patents

Dynamic kernel module protection method of mobile device and system using the same Download PDF

Info

Publication number
KR102833142B1
KR102833142B1 KR1020220187368A KR20220187368A KR102833142B1 KR 102833142 B1 KR102833142 B1 KR 102833142B1 KR 1020220187368 A KR1020220187368 A KR 1020220187368A KR 20220187368 A KR20220187368 A KR 20220187368A KR 102833142 B1 KR102833142 B1 KR 102833142B1
Authority
KR
South Korea
Prior art keywords
execution environment
shielded
kernel module
module
trusted execution
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
KR1020220187368A
Other languages
Korean (ko)
Other versions
KR20240104780A (en
Inventor
장진수
Original Assignee
충남대학교 산학협력단
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 충남대학교 산학협력단 filed Critical 충남대학교 산학협력단
Priority to KR1020220187368A priority Critical patent/KR102833142B1/en
Priority to PCT/KR2023/019708 priority patent/WO2024143952A1/en
Publication of KR20240104780A publication Critical patent/KR20240104780A/en
Application granted granted Critical
Publication of KR102833142B1 publication Critical patent/KR102833142B1/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/52Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems during program execution, e.g. stack integrity ; Preventing unwanted data erasure; Buffer overflow
    • G06F21/53Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems during program execution, e.g. stack integrity ; Preventing unwanted data erasure; Buffer overflow by executing in a restricted environment, e.g. sandbox or secure virtual machine
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/55Detecting local intrusion or implementing counter-measures
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/57Certifying or maintaining trusted computer platforms, e.g. secure boots or power-downs, version controls, system software checks, secure updates or assessing vulnerabilities

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Storage Device Security (AREA)
  • Medicines Containing Antibodies Or Antigens For Use As Internal Diagnostic Agents (AREA)

Abstract

본 발명은, 일반 실행 환경에서 차폐 커널 모듈의 실행을 트리거하기 위해 차폐된 커널 모듈에 관한 정보를 신뢰 실행 환경에 대한 압축 메시지로 생성하는 클라이언트 애플리케이션; 상기 클라이언트 애플리케이션에서 생성된 압축 메시지를 복사하여 신뢰 실행 환경으로 전송하는 TrustZone 커널 드라이버; 신뢰 실행 환경에서 차폐된 커널 모듈을 초기화하고 실행하기 위해, 압축 메시지를 수신하고 상기 차폐된 커널 모듈의 무결성을 확인하며 하기 차폐된 모듈 로더를 호출하는 신뢰할 수 있는 디스패처; 및 상기 디스패처의 호출에 의해 상기 차폐된 커널 모듈을 실행하는 차폐된 모듈 로더;를 포함하는 것을 일 특징으로 한다.The present invention is characterized by including: a client application which generates information about a shielded kernel module as a compressed message for a trusted execution environment to trigger execution of the shielded kernel module in a general execution environment; a TrustZone kernel driver which copies the compressed message generated by the client application and transmits it to the trusted execution environment; a trusted dispatcher which receives the compressed message, verifies the integrity of the shielded kernel module, and calls a shielded module loader to initialize and execute the shielded kernel module in the trusted execution environment; and a shielded module loader which executes the shielded kernel module by calling the dispatcher.

Description

모바일 기기의 동적커널모듈 보호 방법 및 이를 이용한 시스템{DYNAMIC KERNEL MODULE PROTECTION METHOD OF MOBILE DEVICE AND SYSTEM USING THE SAME}{DYNAMIC KERNEL MODULE PROTECTION METHOD OF MOBILE DEVICE AND SYSTEM USING THE SAME}

본 발명은 모바일 기기의 동적커널모듈 보호 방법 및 이를 이용한 시스템에 관한 것으로서, 특히 운영체제가 공격자로부터 장악당한 상황에서도 안전하게 실행될 수 있는 모바일 기기의 동적커널모듈 보호 방법 및 이를 이용한 시스템에 관한 것이다.The present invention relates to a method for protecting a dynamic kernel module of a mobile device and a system using the same, and more particularly, to a method for protecting a dynamic kernel module of a mobile device and a system using the same, which can be safely executed even in a situation where the operating system is taken over by an attacker.

사물 인터넷(Internet of Things, IoT) 산업은 계속해서 성장하고 있고, IoT 장치의 수는 2050년까지 240억 개로 증가할 것으로 예상된다. 또한, 가정 내 엔터테인먼트, 중요 인프라 및 산업을 포함한 일상생활을 위한 IoT 장치가 계속해서 등장하고 있다. 불행하게도 이러한 상황은 IoT 장치를 공격자의 매력적인 표적이 될 수 있고, IoT 장치와 관련하여 보안이 빠른 배포 및 생산성보다 우선순위가 낮은 경향이 있으므로 IoT 세계에 더 많은 공격자를 끌어들일 수 있다. The Internet of Things (IoT) industry continues to grow, with the number of IoT devices expected to increase to 24 billion by 2050. In addition, IoT devices continue to appear for our daily lives, including home entertainment, critical infrastructure, and industry. Unfortunately, this situation can make IoT devices an attractive target for attackers, and security tends to be a lower priority than rapid deployment and productivity when it comes to IoT devices, which could attract more attackers to the IoT world.

신뢰 실행 환경(Trusted Execution Environment, TEE)은 일반 실행 환경(Rich Execution Environment, REE)에서 실행 컨텍스트(Execution context)를 격리할 수 있어, IoT 장치를 보호하기 위한 유망한 기술이다. 즉, 일반 실행 환경의 운영체제가 손상된 경우에도 암호화 작업 및 펌웨어 복구와 같은 보안에 중요한 논리 및 작업을 효과적으로 격리할 수 있다. Trusted Execution Environment (TEE) is a promising technology for protecting IoT devices because it can isolate execution contexts from rich execution environments (REEs). In other words, even if the operating system of the rich execution environment is compromised, security-critical logic and operations such as cryptographic operations and firmware recovery can be effectively isolated.

ARM TrustZone은 소형 IoT 장치에서 서버에 이르는 ARM 아키텍처 기반 플랫폼에서 사용할 수 있는 신뢰 실행 환경 기술 중 하나이다. 클라우드 서버용 가상화 신뢰 실행 환경, 모바일 장치용 일회용 암호, 보안 광고 등 TrustZone을 사용하는 다양한 보안 애플리케이션이 제안되고 있다. 특히, TrustZone을 활용하여 운영체제의 권한을 박탈하고 신뢰 실행 환경에서 중요한 작업의 에뮬레이션을 시행하여 운영체제의 불변성을 보장하는 방식으로 운영체제 커널을 보호한다. TrustZone은 모바일 및 서버 환경에서의 적용 외에도 IoT 분야에서도 주목을 받고 있다.ARM TrustZone is one of the trusted execution environment technologies that can be used on ARM architecture-based platforms ranging from small IoT devices to servers. Various security applications using TrustZone are being proposed, such as virtualized trusted execution environments for cloud servers, one-time passwords for mobile devices, and secure advertisements. In particular, TrustZone is utilized to protect the operating system kernel by depriving the operating system of its authority and emulating important tasks in the trusted execution environment to ensure the immutability of the operating system. In addition to its application in mobile and server environments, TrustZone is also attracting attention in the IoT field.

TrustZone을 사용하면 시스템에서 신뢰 실행 환경의 이점을 얻을 수 있지만 TrustZone에 대한 타사 응용 프로그램 개발자 및 IoT 서비스 공급자의 액세스 가능성은 제한된다. 이는 신뢰 실행 환경이 SoC(System on a Chip) 제조업체 또는 신뢰 실행 환경 소프트웨어 플랫폼 제공업체에 속하기 때문이다. 신뢰 실행 환경은 일반적으로 멤버십을 기반으로 지원되는 유료 서비스이다. 신뢰 실행 환경 클라이언트는 특정 신뢰 실행 환경 공급업체에서 제공하는 신뢰 실행 환경 API(Application Programming Interfaces)를 사용하여 신뢰할 수 있는 애플리케이션(Trusted Application, TA)을 개발해야 한다. 또한, 이러한 TA는 악용 가능한 버그가 있는 새 TA의 배포를 방지하기 위해 신뢰 실행 환경 공급업체에서 엄격하게 확인한다. 이러한 신뢰 실행 환경 기능은 새롭거나 업데이트된 신뢰할 수 있는 IoT 소프트웨어의 개발 및 배포에 필요한 시간을 지연시키고 IoT 서비스의 출시 기간을 지연시킬 수 있다. 따라서, 이것은 타사 IoT 서비스 공급자가 TrustZone 사용을 꺼리는 주된 이유일 수 있다.While TrustZone enables a system to benefit from a trusted execution environment, the accessibility of TrustZone to third-party application developers and IoT service providers is limited. This is because the trusted execution environment is owned by the SoC (System on a Chip) manufacturer or the trusted execution environment software platform provider. The trusted execution environment is typically a paid service supported on a membership basis. The trusted execution environment client must develop a trusted application (TA) using the trusted execution environment application programming interfaces (APIs) provided by a particular trusted execution environment vendor. In addition, these TAs are strictly checked by the trusted execution environment vendor to prevent the distribution of new TAs with exploitable bugs. This trusted execution environment feature can delay the time required to develop and deploy new or updated trusted IoT software and delay the time to market of IoT services. Therefore, this may be the main reason why third-party IoT service providers are reluctant to use TrustZone.

한국등록특허 제10-1894926호Korean Patent No. 10-1894926

본 발명은 ARM과 같은 모바일 프로세서에서 제공하는 보안기술(TrustZone)을 활용하여 생성된 신뢰 실행 환경에 커널 모듈을 동적으로 적재함으로써 해당 모듈을 공격자로부터 보호하면서 안전하게 실행시키고자 한다. The present invention seeks to safely execute a kernel module while protecting it from attackers by dynamically loading the kernel module into a trusted execution environment created by utilizing security technology (TrustZone) provided by a mobile processor such as ARM.

또한, 본 발명은 기존 신뢰 실행 환경을 확장시키지 않으며 신뢰 실행 환경에 새로운 공격 표면을 도입하지 않고 타사 소프트웨어의 안전한 실행을 보장하고자 한다. Furthermore, the present invention seeks to ensure secure execution of third-party software without extending the existing trusted execution environment or introducing a new attack surface into the trusted execution environment.

또한, 본 발명은 신뢰할 수 있는 애플리케이션을 개발하기 위해 별도의 API 사용을 최소화하고자 한다. Additionally, the present invention seeks to minimize the use of separate APIs in order to develop reliable applications.

상기 목적을 달성하기 위하여 본 발명은, 일반 실행 환경에서 차폐 커널 모듈의 실행을 트리거하기 위해 차폐된 커널 모듈에 관한 정보를 신뢰 실행 환경에 대한 압축 메시지로 생성하는 클라이언트 애플리케이션; 상기 클라이언트 애플리케이션에서 생성된 압축 메시지를 복사하여 신뢰 실행 환경으로 전송하는 TrustZone 커널 드라이버; 신뢰 실행 환경에서 차폐된 커널 모듈을 초기화하고 실행하기 위해, 압축 메시지를 수신하고 상기 차폐된 커널 모듈의 무결성을 확인하며 하기 차폐된 모듈 로더를 호출하는 신뢰할 수 있는 디스패처; 및 상기 디스패처의 호출에 의해 상기 차폐된 커널 모듈을 실행하는 차폐된 모듈 로더;를 포함하는 것을 일 특징으로 한다.In order to achieve the above object, the present invention is characterized by including: a client application which generates information about a shielded kernel module as a compressed message for a trusted execution environment in order to trigger execution of the shielded kernel module in a general execution environment; a TrustZone kernel driver which copies the compressed message generated by the client application and transmits it to the trusted execution environment; a trusted dispatcher which receives the compressed message, verifies the integrity of the shielded kernel module, and calls the shielded module loader to initialize and execute the shielded kernel module in the trusted execution environment; and a shielded module loader which executes the shielded kernel module by calling the dispatcher.

바람직하게는, 상기 클라이언트 애플리케이션은, 차폐된 커널 모듈의 이미지를 파일 스트림으로 로드하고, 로드된 커널 모듈의 시작 주소, 모듈 크기, 진입점 및 서명된 해시를 신뢰 실행 환경의 API를 사용하여 신뢰 실행 환경에 대한 메시지로 압축하며, 프로세서 간 인터럽트(inter-processor interrupt, IPI)를 호출하여 다른 코어를 오프시킬 수 있다. Preferably, the client application loads the image of the shielded kernel module as a file stream, compresses the start address, module size, entry point and signed hash of the loaded kernel module into a message to the trusted execution environment using the trusted execution environment's API, and can call an inter-processor interrupt (IPI) to turn off other cores.

바람직하게는, 상기 클라이언트 애플리케이션은, 신뢰 실행 환경에 압축 메시지가 전달될 수 있도록 상기 TrustZone 커널 드라이버를 오픈(open)시킬 수 있다. Preferably, the client application can open the TrustZone kernel driver to allow compressed messages to be passed to the trusted execution environment.

바람직하게는, 상기 디스패처는, 수신한 압축 메시지를 구문 분석하여 상기 차폐된 커널 모듈의 주소와 크기를 획득하고, 신뢰 실행 환경의 샌드박스 영역에 메모리를 할당하고 획득한 차폐된 커널 모듈의 크기 정보를 기반으로 상기 차폐된 커널 모듈의 이미지를 메모리가 할당된 샌드박스 영역에 복사할 수 있다. Preferably, the dispatcher can parse the received compressed message to obtain an address and a size of the shielded kernel module, allocate memory to a sandbox area of the trusted execution environment, and copy an image of the shielded kernel module to the sandbox area to which memory is allocated based on the obtained size information of the shielded kernel module.

또한 본 발명은, 일반 실행 환경에서 사용자 애플리케이션이 커널 모듈을 신뢰 실행 환경으로 전송하고 차폐 실행을 요청하는 (a)단계; 신뢰 실행 환경에서 신뢰할 수 있는 디스패처가 상기 커널 모듈의 무결성을 확인하고 차폐된 모듈 로더를 호출하는 (b)단계; 및 상기 차폐된 모듈 로더가 상기 커널 모듈을 안전하게 실행하고 신뢰 실행 환경의 보안을 유지하도록 메모리 방화벽과 샌드박스를 구성하는 (c)단계;를 포함하는 것을 다른 특징으로 한다.In addition, the present invention is characterized by including a step (a) in which a user application in a general execution environment transfers a kernel module to a trusted execution environment and requests shielded execution; a step (b) in which a trusted dispatcher in the trusted execution environment verifies the integrity of the kernel module and calls a shielded module loader; and a step (c) in which a memory firewall and a sandbox are configured so that the shielded module loader safely executes the kernel module and maintains the security of the trusted execution environment.

본 발명은 사용자 수준 응용 프로그램 보호에 중점이 있다. The present invention focuses on user level application protection.

또한, 본 발명은 타사 IoT 서비스 공급자가 안전한 OS 권한 작업을 보장받을 수 있는 환경을 제공해 줄 수 있다는 이점이 있다. In addition, the present invention has an advantage in that it can provide an environment in which third-party IoT service providers can be guaranteed secure OS permission operations.

또한, 본 발명은 신뢰할 수 없는 일반 실행 환경의 OS에서 LKM과 같은 권한 있는 소프트웨어를 격리하여 사용자 애플리케이션 보호에 국한된 이전 TrustZone 기반 작업과 차별화된다. Additionally, the present invention differentiates itself from previous TrustZone-based work that was limited to protecting user applications by isolating privileged software such as LKMs from the untrusted general execution environment of the OS.

또한, 본 발명은 기존의 커널 모듈 개발 관행에 따라 보호 소프트웨어를 만들 수 있는 환경을 제공하여, 신뢰 실행 환경 전용 API를 사용할 필요가 없으므로 개발자의 개발 노력이 줄일 수 있다는 이점이 있다.In addition, the present invention provides an environment in which protection software can be created according to existing kernel module development practices, so that there is no need to use an API dedicated to a trusted execution environment, thereby reducing the development effort of developers.

또한, 본 발명은 신뢰 실행 환경의 권한이 필요한 다양한 긴급 장치 관리 작업은 IoT 서비스 공급자가 신뢰 실행 환경 공급업체의 개입을 기다리지 않고 즉석에서 수행할 수 있으므로 IoT 장치의 시장 출시 요구 사항을 방해할 수 있다는 문제를 해결할 수 있다. Furthermore, the present invention can solve the problem that various emergency device management tasks requiring the authority of the trusted execution environment can be performed on the fly by the IoT service provider without waiting for the intervention of the trusted execution environment vendor, which may hinder the time-to-market requirements of IoT devices.

도 1은 본 발명의 배경기술로 TrustZone을 가진 ARM 아키텍처를 나타낸다.
도 2는 본 발명의 실시예에 따른 모바일 기기의 동적커널모듈 보호 시스템의 구성도를 나타낸다.
도 3은 본 발명의 실시예에 따른 메모리 변환 설정을 나타낸다.
Figure 1 shows an ARM architecture with TrustZone as a background technology of the present invention.
FIG. 2 shows a configuration diagram of a dynamic kernel module protection system for a mobile device according to an embodiment of the present invention.
Figure 3 illustrates a memory conversion setting according to an embodiment of the present invention.

이하, 첨부된 도면들에 기재된 내용들을 참조하여 본 발명을 상세히 설명한다. 다만, 본 발명이 예시적 실시 예들에 의해 제한되거나 한정되는 것은 아니다. 각 도면에 제시된 동일 참조부호는 실질적으로 동일한 기능을 수행하는 부재를 나타낸다.Hereinafter, the present invention will be described in detail with reference to the contents described in the attached drawings. However, the present invention is not limited or restricted by the exemplary embodiments. The same reference numerals presented in each drawing represent components that perform substantially the same function.

본 발명의 목적 및 효과는 하기의 설명에 의해서 자연스럽게 이해되거나 보다 분명해 질 수 있으며, 하기의 기재만으로 본 발명의 목적 및 효과가 제한되는 것은 아니다. 또한, 본 발명을 설명함에 있어서 본 발명과 관련된 공지 기술에 대한 구체적인 설명이, 본 발명의 요지를 불필요하게 흐릴 수 있다고 판단되는 경우에는 그 상세한 설명을 생략하기로 한다.The purpose and effect of the present invention can be naturally understood or made clearer by the following description, and the purpose and effect of the present invention are not limited to the following description alone. In addition, when explaining the present invention, if it is judged that a detailed description of a known technology related to the present invention may unnecessarily obscure the gist of the present invention, the detailed description will be omitted.

도 1은 본 발명의 배경기술로 TrustZone을 가진 ARM 아키텍처를 나타낸다. 도 1을 참조하면, ARM TrustZone은 ARM 프로세서의 보안 확장으로, TrustZone 기술을 통해 시스템을 일반 실행 환경과 신뢰 실행 환경의 두 가지 실행 환경으로 나눌 수 있다. Linux 및 Android 기반과 같은 일반 소프트웨어 스택은 일반 실행 환경에서 호스팅된다. 반면에 신뢰 실행 환경은 암호화 서비스 및 DRM(Digital Rights Management)과 같은 보안이 중요한 애플리케이션을 보호한다. Fig. 1 shows an ARM architecture with TrustZone as a background technology of the present invention. Referring to Fig. 1, ARM TrustZone is a security extension of ARM processor, and TrustZone technology can divide the system into two execution environments, a general execution environment and a trusted execution environment. General software stacks such as Linux and Android-based are hosted in the general execution environment. On the other hand, the trusted execution environment protects security-critical applications such as cryptographic services and DRM (Digital Rights Management).

이러한 환경 간의 격리를 보장하기 위해 다양한 하드웨어 구성요소가 지원되는데, ARM 프로세서는 서로 다른 보안 상태(보안 및 비보안 상태)를 정의한다. 비보안 상태에서는 사용자, 커널 및 하이퍼바이저 모드가 지원된다. 보안 상태에서는 사용자, 커널 및 모니터 모드를 사용할 수 있다. 특히 모니터 모드와 관련하여 실행 중인 소프트웨어는 각 환경의 컨텍스트를 저장하고 복원하여 환경 간 전환을 관리한다. 프로세서의 보안 상태 외에도 각 환경에 맞게 DRAM을 분할하기 위해 TZASC가 제공된다. TZASC를 사용하여 프로세서의 보안 상태에 따라 여러 물리적 메모리 영역과 해당 액세스 권한을 정의할 수 있다. 예를 들어, 물리적 메모리의 특정 범위는 신뢰 실행 환경(보안 상태)에서는 액세스를 허용하지만, 일반 실행 환경(비보안 상태)에서는 액세스를 허용하지 않음으로써 신뢰 실행 환경의 영역으로 구성할 수 있다. 보안 상태 및 메모리 액세스 제어 외에도 TrustZone은 디스플레이 및 키패드와 같은 입/출력(IO) 주변 장치도 보호한다. TZPC(TrustZone Protection Controller)는 이러한 주변 장치를 신뢰 실행 환경에 동적으로 연결하여 안전한 IO 채널을 생성할 수 있도록 하여 손상된 일반 실행 환경으로 인한 간섭을 방지할 수 있다.To ensure isolation between these environments, various hardware components are supported. ARM processors define different security states (secure and non-secure). In the non-secure state, user, kernel, and hypervisor modes are supported. In the secure state, user, kernel, and monitor modes are available. In particular, with respect to the monitor mode, the running software manages the transition between environments by saving and restoring the context of each environment. In addition to the security state of the processor, TZASC is provided to partition the DRAM for each environment. Using TZASC, several physical memory regions and their access permissions can be defined according to the security state of the processor. For example, a specific range of physical memory can be configured as a trusted execution environment region by allowing access from the trusted execution environment (secure state) but not from the normal execution environment (non-secure state). In addition to the security state and memory access control, TrustZone also protects input/output (IO) peripherals such as the display and the keypad. The TrustZone Protection Controller (TZPC) can dynamically connect these peripherals to the trusted execution environment to create secure IO channels, thereby preventing interference from a compromised common execution environment.

ARM 프로세서는 가상 주소를 물리적 주소로 변환하는 가상 메모리 시스템을 지원한다. 이러한 변환은 TTBR(Translation Table Base Registers)을 사용하여 기본 주소가 구성된 페이지 테이블을 기반으로 수행된다. 일반적으로 TTBR0 및 TTBR1의 두 가지 아키텍처 지원 TTBR이 있다. 64비트 시스템에서 TTBR0 및 TTBR1은 일반적으로 각각 사용자 및 커널 공간에 대한 페이지 테이블 기본 주소를 포함한다. 32비트 시스템에서는 작은 주소 범위, 즉 4GB로 인해 하나의 페이지 테이블만 사용할 수 있다. 예를 들어 사용자 및 커널 공간을 포함하는 32비트 Linux 기반 주소 공간의 경우 TTBCR(Translation Table Base Control Register)의 설정에 따라 TTBR 중 하나가 활용되는지 또는 두 TTBR이 모두 활용되는지 여부가 결정된다. ARM processors support a virtual memory system that translates virtual addresses into physical addresses. This translation is performed based on page tables whose base addresses are configured using Translation Table Base Registers (TTBRs). There are typically two architecture-supported TTBRs: TTBR0 and TTBR1. On 64-bit systems, TTBR0 and TTBR1 typically contain page table base addresses for user and kernel space, respectively. On 32-bit systems, only one page table can be used due to the small address range, i.e., 4 GB. For example, in the case of a 32-bit Linux-based address space that includes user and kernel space, the setting of the Translation Table Base Control Register (TTBCR) determines whether one or both TTBRs are utilized.

짧은 설명자 형식을 사용하는 경우 TTBCR의 N 플래그는 TTBR0 및 TTBR1을 사용하여 가리키는 페이지 테이블을 통해 수행되는 주소 변환의 크기를 결정한다. 예를 들어 N값이 0b000이면 TTBR0만 사용됩니다. 그렇지 않으면 TTBR0과 TTBR1이 모두 활용되고 각 TTBR을 사용하여 변환된 주소 범위는 N값으로 결정된다. 예를 들어 N값을 0b001로 설정하면 가상 메모리의 2GB 미만과 2GB 초과 주소는 각각 TTBR0과 TTBR1을 사용하여 변환된다. TTBR 및 TTBCR은 프로세서의 비보안 및 보안 상태를 위한 뱅크 레지스터이다. 따라서 TTBR 및 TTBCR은 일반 실행 환경과 신뢰 실행 환경에서 독립적으로 구성될 수 있다.When using the short descriptor format, the N flag in the TTBCR determines the size of the address translation performed via the page tables pointed to by TTBR0 and TTBR1. For example, if the N value is 0b000, only TTBR0 is used. Otherwise, both TTBR0 and TTBR1 are utilized, and the range of addresses translated using each TTBR is determined by the N value. For example, if the N value is set to 0b001, addresses less than 2 GB and greater than 2 GB of virtual memory are translated using TTBR0 and TTBR1, respectively. TTBR and TTBCR are banked registers for the non-secure and secure states of the processor. Therefore, TTBR and TTBCR can be configured independently in the normal execution environment and the trusted execution environment.

도 2는 본 발명의 실시예에 따른 모바일 기기의 동적커널모듈 보호 시스템(10)의 구성도를 나타낸다. 도 2를 참조하면, 모바일 기기의 동적커널모듈 보호 시스템(10)은 클라이언트 애플리케이션(100), TrustZone 커널 드라이버(200), 신뢰할 수 있는 디스패처(300), 차폐된 모듈 로더(400), 메모리 방화벽(500), 및 샌드박스(600)를 포함할 수 있다. FIG. 2 illustrates a configuration diagram of a dynamic kernel module protection system (10) for a mobile device according to an embodiment of the present invention. Referring to FIG. 2, the dynamic kernel module protection system (10) for a mobile device may include a client application (100), a TrustZone kernel driver (200), a trusted dispatcher (300), a shielded module loader (400), a memory firewall (500), and a sandbox (600).

모바일 기기의 동적커널모듈 보호 시스템(10)은 유저 어플리케이션을 신뢰 실행 환경에 적재하는 기존의 시스템과는 달리 커널 모듈을 신뢰 실행 환경에 동적으로 적재하여 실행할 수 있다. 동적커널모듈 보호 시스템(10)은 ARM과 같은 모바일 프로세서에서 제공하는 보안기술(TrustZone)을 활용하여 생성된 신뢰 실행 환경에 커널 모듈을 동적으로 적재함으로써 해당 모듈을 공격자로부터 보호하면서 안전하게 실행할 수 있다. 동적커널모듈 보호 시스템(10)은 페이지 테이블을 신뢰 실행 환경 내에 동적으로 로딩된 커널 모듈이 공유하여 사용하도록 하여, 커널 모듈이 운영체제와 격리된 영역인 신뢰 실행 환경에서 실행됨으로써 메모리나 파일 시스템 접근 시의 성능 저하가 발생하는 것을 방지할 수 있다. The dynamic kernel module protection system (10) of a mobile device can dynamically load a kernel module into a trusted execution environment and execute it, unlike existing systems that load a user application into a trusted execution environment. The dynamic kernel module protection system (10) can safely execute a kernel module while protecting it from an attacker by dynamically loading the kernel module into a trusted execution environment created by utilizing a security technology (TrustZone) provided by a mobile processor such as ARM. The dynamic kernel module protection system (10) can prevent performance degradation when accessing memory or a file system by allowing a kernel module dynamically loaded into the trusted execution environment to share and use a page table, thereby preventing the kernel module from being executed in a trusted execution environment, which is an area isolated from the operating system.

동적커널모듈 보호 시스템(10)은 신뢰 실행 환경의 단점을 최소화하기 위해 제3자가 TrustZone 기반의 신뢰 실행 환경을 쉽게 사용할 수 있도록 해주는 신뢰 실행 환경 플랫폼을 제공할 수 있다. 동적커널모듈 보호 시스템(10)은 신뢰 실행 환경을 사용하여 LKM(Loadable Kernel Module)과 같은 커널 권한 소프트웨어를 보호할 수 있다. The dynamic kernel module protection system (10) can provide a trusted execution environment platform that allows a third party to easily use a TrustZone-based trusted execution environment in order to minimize the shortcomings of the trusted execution environment. The dynamic kernel module protection system (10) can protect kernel privilege software such as LKM (Loadable Kernel Module) by using the trusted execution environment.

신뢰 실행 환경 기반 커널 무결성 모니터링에 의해 무결성이 보호되는 OS에 대한 모든 업데이트는 일반적으로 신뢰 실행 환경 공급업체가 업데이트를 확인하고 OS 이미지에 적용해야 한다. 그러나, 동적커널모듈 보호 시스템(10)은 신뢰 실행 환경 공급업체가 확인을 완료하고 변경 사항을 OS 이미지에 적용할 때까지 기다리지 않고 제3자가 메모리의 OS 버그를 즉시 수정하는 것과 같은 긴급 장치 관리 작업을 수행할 수 있는 환경을 제공할 수 있다. Any updates to an OS whose integrity is protected by a Trusted Execution Environment-based kernel integrity monitoring typically require the Trusted Execution Environment vendor to verify the update and apply it to the OS image. However, the dynamic kernel module protection system (10) can provide an environment in which a third party can perform emergency device management tasks, such as immediately fixing an OS bug in memory, without waiting for the Trusted Execution Environment vendor to complete verification and apply the changes to the OS image.

동적커널모듈 보호 시스템(10)은 일반 실행 환경 구성요소와 신뢰 실행 환경 구성요소로 구성될 수 있다. 일반 실행 환경 구성요소는 클라이언트 애플리케이션(100)과 TrustZone 커널 드라이버(200)를 포함할 수 있다. 신뢰 실행 환경 구성요소는 신뢰할 수 있는 디스패처(300), 차폐된 모듈 로더(400), 메모리 방화벽(500), 및 샌드박스(600)를 포함할 수 있다. The dynamic kernel module protection system (10) may be composed of a general execution environment component and a trusted execution environment component. The general execution environment component may include a client application (100) and a TrustZone kernel driver (200). The trusted execution environment component may include a trusted dispatcher (300), a shielded module loader (400), a memory firewall (500), and a sandbox (600).

일반 실행 환경은 신뢰 실행 환경의 구성요소와 통신하여 타사에서 제공하는 커널 모듈의 보안 실행 요청을 보내는 간단한 로더가 구현될 수 있다. 신뢰 실행 환경의 구성요소는 일반 실행 환경의 요청을 처리하기 위해 먼저 비대칭 암호화 알고리즘을 기반으로 수신된 커널 모듈의 서명과 무결성을 확인할 수 있다. 수신된 커널 모듈은 신뢰 실행 환경의 보호 아래 실행될 수 있다. The general execution environment can implement a simple loader that communicates with the components of the trusted execution environment to send a request for secure execution of a kernel module provided by a third party. The components of the trusted execution environment can first verify the signature and integrity of the received kernel module based on an asymmetric cryptographic algorithm in order to process the request of the general execution environment. The received kernel module can be executed under the protection of the trusted execution environment.

동적커널모듈 보호 시스템(10)은 신뢰 실행 영역의 메모리 영역에 대한 필터링 액세스를 가능하게 하는 TZASC(TrustZone Address Space Controller)를 활용하여 커널 모듈의 실행을 보호할 수 있다. 동적커널모듈 보호 시스템(10)은 하드웨어 디버깅 감시점을 설정하여 차폐된 커널 모듈에 의한 신뢰 실행 환경의 메모리 영역에 대한 모든 액세스를 모니터링하여, 일반 실행 환경의 OS 대신 신뢰 실행 환경의 메모리를 잘못 배치하는 등 기존 신뢰 실행 환경의 플랫폼 보안에 영향을 미칠 수 있는 프로그래밍 오류를 고려할 수 있다.The dynamic kernel module protection system (10) can protect the execution of a kernel module by utilizing a TrustZone Address Space Controller (TZASC) that enables filtering access to the memory area of a trusted execution zone. The dynamic kernel module protection system (10) sets a hardware debugging watchpoint to monitor all accesses to the memory area of a trusted execution environment by a shielded kernel module, thereby taking into account programming errors that may affect the platform security of an existing trusted execution environment, such as incorrectly allocating memory of a trusted execution environment instead of an OS of a general execution environment.

동적커널모듈 보호 시스템(10)은 신뢰할 수 있는 신뢰 실행 환경의 클라이언트에 의해서만 사용하도록 하기 위해 DRM과 같은 모바일 장치 서비스를 보호하는 데 널리 사용되는 공개키 인프라(Public Key Infrastructure, PKI)에 의존할 수 있다. 즉, 동적커널모듈 보호 시스템(10)을 이용하는 클라이언트는 자신의 공개 키를 신뢰 실행 환경의 공급업체에 등록해야 한다. 신뢰 실행 환경의 공급업체는 공개키의 해시를 신뢰 실행 환경에 저장한다. 클라이언트가 제공한 커널 모듈을 실행하기 위해, 모듈 개발자는 먼저 등록된 공개키 쌍인 개인키를 사용하여 모듈의 해시에 서명한다. 동적커널모듈 보호 시스템(10)은 커널 모듈이 로드되기 전에 먼저 신뢰 실행 환경에 저장된 해시를 사용하여 공개키의 무결성을 확인할 수 있다. 이어서, 동적커널모듈 보호 시스템(10)은 공개키를 사용하여 새로 계산된 해시와 복호화된 해시를 비교하여 커널 모듈의 무결성을 확인할 수 있다.The dynamic kernel module protection system (10) can rely on a public key infrastructure (PKI) widely used to protect mobile device services such as DRM to ensure that they are used only by clients of a trusted execution environment. That is, a client using the dynamic kernel module protection system (10) must register its public key with a vendor of the trusted execution environment. The vendor of the trusted execution environment stores a hash of the public key in the trusted execution environment. In order to execute a kernel module provided by a client, the module developer first signs the hash of the module using the private key, which is a registered public key pair. The dynamic kernel module protection system (10) can first verify the integrity of the public key using the hash stored in the trusted execution environment before the kernel module is loaded. Subsequently, the dynamic kernel module protection system (10) can verify the integrity of the kernel module by comparing a newly calculated hash using the public key with a decrypted hash.

동적커널모듈 보호 시스템(10)은 IoT 서비스 공급자(신뢰 실행 환경의 클라이언트)가 필요에 따라 커널 모듈을 배포하고 신뢰 실행 환경의 보안을 방해하지 않고 TrustZone 보호 아래에서 안전하게 실행되게 할 수 있다. 동적커널모듈 보호 시스템(10)은 응용 프로그램의 보안에 중요한 논리의 확인 및 분리가 필요한 TA를 구축할 때 개발자의 노력을 최소화시킬 수 있다. 동적커널모듈 보호 시스템(10)은 특정한 신뢰 실행 환경의 공급업체에서 제공하는 API를 사용하지 않고 구현될 수 있다. The dynamic kernel module protection system (10) enables IoT service providers (clients of the trusted execution environment) to distribute kernel modules as needed and to execute them safely under TrustZone protection without disturbing the security of the trusted execution environment. The dynamic kernel module protection system (10) can minimize the developer's efforts when building a TA that requires verification and separation of logic important to the security of an application. The dynamic kernel module protection system (10) can be implemented without using an API provided by a supplier of a specific trusted execution environment.

개발자는 IoT 서비스 및 장치 유지 관리를 위해 차폐된 커널 모듈로 실행되는 커널 모듈을 생성할 수 있으므로 동적커널모듈 보호 시스템(10)의 이점을 누릴 수 있다. 예를 들어, 커널 모듈은 메모리의 커널 텍스트 영역을 긴급하게 패치하여 전체 커널 이미지를 교체하고 장치를 재부팅하지 않고도 버그를 수정할 수 있다. 일반적으로 신뢰 실행 환경 기반의 메모리 보호 솔루션이 제공하는 보호로 인해 텍스트 영역이 불변으로 강제되는 조건 아래에서 이 패치 작업은 보호된 메모리를 업데이트하기 위해 신뢰 실행 환경의 공급업체 개입이 필요할 수 있다. Developers can benefit from the dynamic kernel module protection system (10) by creating kernel modules that run as shielded kernel modules for IoT services and device maintenance. For example, a kernel module can patch a kernel text region in memory on an emergency basis to fix a bug without replacing the entire kernel image and rebooting the device. Under conditions where the text region is enforced to be immutable due to the protection provided by a TEE-based memory protection solution, this patching operation may require the intervention of the TEE vendor to update the protected memory.

동적커널모듈 보호 시스템(10)은 신뢰 실행 환경의 권한으로 클라이언트 모듈을 실행할 수 있어서 신뢰 실행 환경의 공급업체 개입이 필요하지 않다. 또한, 동적커널모듈 보호 시스템(10)에서 커널 모듈은 실행 중에 신뢰할 수 없는 OS로부터 격리되고 보호될 수 있다. 따라서, 동적커널모듈 보호 시스템(10)은 포렌식 분석을 위한 일반 실행 환경의 메모리 덤프와 같은 메모리 검사 작업을 공격자의 간섭 없이 안정적으로 수행할 수 있다. The dynamic kernel module protection system (10) can execute a client module with the authority of a trusted execution environment, so that intervention by a vendor of the trusted execution environment is not required. In addition, in the dynamic kernel module protection system (10), the kernel module can be isolated and protected from an untrusted OS during execution. Therefore, the dynamic kernel module protection system (10) can stably perform a memory inspection task, such as a memory dump of a general execution environment for forensic analysis, without interference from an attacker.

일반 실행 환경과 신뢰 실행 환경은 서로 다른 API를 사용하므로, 동적커널모듈 보호 시스템(10)은 개발자의 개발 노력과 개발의 복잡성을 최소화하는데 기여할 수 있다. 이하에서는 동적커널모듈 보호 시스템(10)의 일반 실행 환경의 구성요소를 설명한다. Since the general execution environment and the trusted execution environment use different APIs, the dynamic kernel module protection system (10) can contribute to minimizing the developer's development effort and development complexity. Below, the components of the general execution environment of the dynamic kernel module protection system (10) are described.

차폐된 커널 모듈은 커널 데이터 구조 검사와 같은 작업을 허용하는 일반 Linux 커널 기호를 사용하여 개발될 수 있다. 차폐된 커널 모듈은 독립적이며 사용자 프로세스와 상호 작용하지 않고 실행될 수 있다. 차폐된 커널 모듈은 copy_from_user 및 copy_to_user와 같은 커널 API를 사용하지 않을 수 있다. 차폐된 커널 모듈은 신뢰 실행 영역에서 무결성 검증되는데, 이를 위해 SHA256을 기반으로 모듈의 해시를 얻고 개발자의 개인 키를 사용하여 서명될 수 있다. 서명된 해시는 차폐된 커널 모듈의 실행 요청과 함께 신뢰 실행 환경으로 전달될 수 있다.Shielded kernel modules can be developed using common Linux kernel symbols, which allow operations such as inspecting kernel data structures. Shielded kernel modules are standalone and can run without interacting with user processes. Shielded kernel modules may not use kernel APIs such as copy_from_user and copy_to_user. Shielded kernel modules are integrity-verified in the TEE, for which a hash of the module can be obtained based on SHA256 and signed using the developer's private key. The signed hash can be passed to the TEE along with the execution request of the shielded kernel module.

클라이언트 애플리케이션(100)은 일반 실행 환경에서 차폐 커널 모듈의 실행을 트리거하기 위해 차폐된 커널 모듈에 관한 정보를 신뢰 실행 환경에 대한 압축 메시지로 생성할 수 있다. 클라이언트 애플리케이션(100)은 차폐된 커널 모듈 이미지의 경로, 진입점(함수 이름) 및 서명된 해시의 세 가지 입력 인수를 처리할 수 있다. The client application (100) can generate a compressed message to the trusted execution environment with information about the shielded kernel module to trigger execution of the shielded kernel module in the normal execution environment. The client application (100) can process three input arguments: the path to the shielded kernel module image, the entry point (function name), and the signed hash.

클라이언트 애플리케이션(100)은 차폐된 커널 모듈의 이미지를 파일 스트림으로 로드하고, 로드된 커널 모듈의 시작 주소, 모듈 크기, 진입점 및 서명된 해시를 신뢰 실행 환경의 API를 사용하여 신뢰 실행 환경에 대한 메시지로 압축하며, 프로세서 간 인터럽트(inter-processor interrupt, IPI)를 호출하여 다른 코어를 오프(off) 시킬 수 있다. A client application (100) loads an image of a shielded kernel module as a file stream, compresses the start address, module size, entry point, and signed hash of the loaded kernel module into a message to the trusted execution environment using the trusted execution environment's API, and can call an inter-processor interrupt (IPI) to turn off other cores.

클라이언트 애플리케이션(100)은 다른 코어를 오프(off)함으로써 여러 코어 간의 경쟁 조건을 악용하는 TOCTTOU(time-of-check-totime-of-use) 공격을 방지할 수 있다. 특히, 클라이언트 애플리케이션(100)은 잠재적으로 악의적인 코어가 공격자의 발자국을 숨기는 것을 방지하여, 일반 실행 환경의 메모리 검사와 같은 커널 모듈의 작업을 안정적으로 수행할 수 있다.The client application (100) can prevent TOCTTOU (time-of-check-totime-of-use) attacks that exploit race conditions between multiple cores by turning off other cores. In particular, the client application (100) can reliably perform kernel module tasks such as memory inspection in a general execution environment by preventing a potentially malicious core from hiding the attacker's footprints.

클라이언트 애플리케이션(100)은 신뢰 실행 환경에 압축 메시지가 전달될 수 있도록 상기 TrustZone 커널 드라이버를 오픈(open)시킬 수 있다. The client application (100) can open the TrustZone kernel driver so that compressed messages can be delivered to the trusted execution environment.

TrustZone 커널 드라이버(200)는 클라이언트 애플리케이션에서 생성된 압축 메시지를 복사하여 신뢰 실행 환경으로 전송할 수 있다. TrustZone 커널 드라이버(200)는 일반 실행 환경에 상주하므로 손상될 수 있다. 따라서, TrustZone 커널 드라이버(200)는 차폐된 커널 모듈의 실행 요청, 즉 서비스 거부(DoS) 공격을 무시할 수 있다. The TrustZone kernel driver (200) can copy the compressed message generated by the client application and send it to the trusted execution environment. Since the TrustZone kernel driver (200) resides in the general execution environment, it can be corrupted. Therefore, the TrustZone kernel driver (200) can ignore the execution request of the shielded kernel module, i.e., a denial of service (DoS) attack.

신뢰 실행 환경은 차폐된 커널 모듈의 실행 요청을 처리할 수 있다. 신뢰 실행 환경에서는 차폐된 커널 모듈의 초기화, 메모리 방화벽 구성, 샌드박스(600) 활성화 및 모듈 디스패칭이 수행될 수 있다. 이하에서는 동적커널모듈 보호 시스템(10)의 신뢰 실행 환경의 구성요소를 설명한다. The trusted execution environment can process execution requests of shielded kernel modules. In the trusted execution environment, initialization of shielded kernel modules, memory firewall configuration, sandbox (600) activation, and module dispatching can be performed. The components of the trusted execution environment of the dynamic kernel module protection system (10) are described below.

신뢰할 수 있는 디스패처(300)는 신뢰 실행 환경에서 차폐된 커널 모듈을 초기화하고 실행하기 위해, 압축 메시지를 수신하고 상기 차폐된 커널 모듈의 무결성을 확인하며 하기 차폐된 모듈 로더(400)를 호출할 수 있다. 신뢰할 수 있는 디스패처(300)는 일반 실행 환경의 클라이언트 애플리케이션(100)에 대응되는 구성이다. A trusted dispatcher (300) can receive a compressed message, verify the integrity of the shielded kernel module, and call the shielded module loader (400) to initialize and execute a shielded kernel module in a trusted execution environment. The trusted dispatcher (300) is a configuration corresponding to a client application (100) in a general execution environment.

신뢰할 수 있는 디스패처(300)는 복사된 차폐된 커널 모듈의 해시를 클라이언트 애플리케이션(100)의 서명된 해시를 사용하여 확인할 수 있다. 신뢰할 수 있는 디스패처(300)는 해시를 확인한 후 차폐된 커널 모듈을 초기화하고 실행하기 위해 차폐된 모듈 로더를 호출할 수 있다. 신뢰할 수 있는 디스패처(300)는 샌드박스(600) 및 진입점에 있는 차폐 커널 모듈의 주를 차폐 모듈 로더로 전달할 수 있다.The trusted dispatcher (300) can verify the hash of the copied shielded kernel module using the signed hash of the client application (100). After verifying the hash, the trusted dispatcher (300) can call the shielded module loader to initialize and execute the shielded kernel module. The trusted dispatcher (300) can pass the host of the shielded kernel module in the sandbox (600) and the entry point to the shielded module loader.

신뢰할 수 있는 디스패처(300)는 수신한 압축 메시지를 구문 분석하여 상기 차폐된 커널 모듈의 주소와 크기를 획득하고, 신뢰 실행 환경의 샌드박스(600) 영역에 메모리를 할당하고 획득한 차폐된 커널 모듈의 크기 정보를 기반으로 상기 차폐된 커널 모듈의 이미지를 메모리가 할당된 샌드박스(600) 영역에 복사할 수 있다. A trusted dispatcher (300) can parse the received compressed message to obtain the address and size of the shielded kernel module, allocate memory to a sandbox (600) area of the trusted execution environment, and copy the image of the shielded kernel module to the sandbox (600) area where the memory is allocated based on the obtained size information of the shielded kernel module.

차폐된 모듈 로더(400)는 신뢰할 수 있는 디스패처(300)의 호출에 의해 차폐된 커널 모듈을 실행할 수 있다. 차폐된 모듈 로더(400)는 ELF 로더의 변형 버전으로 차폐된 커널 모듈을 적절하게 실행하기 위해 ELF 헤더 파싱, 커널 심볼 연결, 각 메모리 세그먼트 로딩 등의 일반적인 동작을 수행할 수 있다. The shielded module loader (400) can execute a shielded kernel module by a call from a trusted dispatcher (300). The shielded module loader (400) is a modified version of an ELF loader and can perform general operations such as parsing an ELF header, linking kernel symbols, and loading each memory segment to properly execute a shielded kernel module.

차폐된 커널 모듈이 신뢰 실행 환경에서 실행되기 때문에 공격자는 모듈 실행에 직접 영향을 미칠 수 없으나, 공격자는 적시에 대상 검사 개체의 상태를 조작하여 차폐된 커널 모듈의 실행 결과에 여전히 영향을 미칠 수 있다. 이 문제를 해결하기 위해 클라이언트 애플리케이션(100)은 차폐된 커널 모듈을 실행하는 코아를 제외한 모든 코어를 일시적으로 중지할 수 있다. 그러나 다른 코어를 중지하기 위한 IPI는 공격자가 무시할 수 있는 커널 API의 실행에 의존하기 때문에 이 접근 방식은 위협을 안정적으로 방지할 수 없다. Since the shielded kernel module runs in a trusted execution environment, the attacker cannot directly affect the execution of the module, but the attacker can still affect the execution result of the shielded kernel module by manipulating the state of the target inspection object in a timely manner. To address this issue, the client application (100) can temporarily stop all cores except the core that runs the shielded kernel module. However, this approach cannot reliably prevent the threat because the IPI for stopping other cores relies on the execution of kernel APIs that the attacker can override.

메모리 방화벽(500)은 악성 코어가 차폐된 커널 모듈의 결과를 방해하지 않도록 TZASC를 활용할 수 있다. TZASC는 CPU의 보안 상태를 기반으로 물리적 메모리 영역에서 액세스 제어를 수행할 수 있다. 메모리 방화벽(500)은 일반 실행 환경에 할당된 전체 물리적 영역이 비보안 상태의 코어에서 액세스할 수 없도록 차폐된 커널 모듈을 실행하기 전에 TZASC를 동적으로 재구성할 수 있다. 메모리 방화벽(500)은 공격자가 IPI 중지 요청을 차단하더라도 비보안 상태에서 실행되는 악성 코어가 차폐된 커널 모듈 및 커널 API에 액세스할 수 없도록 할 수 있다. 차폐된 커널 드라이버를 실행하는 코어는 보안 상태에 있기 때문에 여전히 전체 물리적 메모리에 액세스할 수 있으므로 모듈을 원활하게 실행할 수 있다. TZASC의 이러한 동적 구성은 일반 실행 환경 및 신뢰 실행 환경에 대한 물리적 메모리 영역이 부팅 시 이미 정의되고 구성되므로 영역을 재정의할 필요가 없다. 메모리 방화벽(500)은 TZASC의 REGION_ID_ACCESS_<n> 레지스터를 재설정하여 비보안 상태의 코어에서 일반 실행 환경의 영역에 대한 읽기 및 쓰기 액세스를 차단할 수 있다.The memory firewall (500) can utilize TZASC to prevent a malicious core from interfering with the results of a shielded kernel module. The TZASC can perform access control in the physical memory area based on the security state of the CPU. The memory firewall (500) can dynamically reconfigure the TZASC before executing the shielded kernel module so that the entire physical area allocated to the normal execution environment cannot be accessed by the core in the non-secure state. The memory firewall (500) can prevent a malicious core running in the non-secure state from accessing the shielded kernel module and kernel API even if an attacker blocks an IPI stop request. The core running the shielded kernel driver can still access the entire physical memory because it is in the secure state, so that the module can be executed smoothly. This dynamic configuration of the TZASC does not require redefinition of the area because the physical memory areas for the normal execution environment and the trusted execution environment are already defined and configured at boot time. A memory firewall (500) can block read and write access to areas of the general execution environment from a core in a non-secure state by resetting the REGION_ID_ACCESS_<n> register of the TZASC.

차폐된 드라이버의 취약성 또는 프로그래밍 오류로 인한 신뢰 실행 환경에 대한 의도하지 않은 액세스는 공격자가 이러한 측면을 악용하여 신뢰 실행 환경을 손상시킬 수 있다. 예를 들어 공격자는 차폐된 커널 모듈을 악용하여 신뢰 실행 환경의 내부 작동을 학습할 수 있다. 신뢰 실행 환경의 OS와 펌웨어 이미지는 일반적으로 암호화된 바이너리로 제공되기 때문에 정적 분석을 통해서는 일반적으로 수행할 수 없다. 그러나 런타임 시 신뢰 실행 환경에서 복호화되기 때문에 공격자는 차폐된 커널 모듈 권한을 남용하여 신뢰 실행 환경의 유익한 정보를 유추할 수 있다.Unintended access to the TEE due to vulnerabilities in shielded drivers or programming errors can allow an attacker to exploit these aspects to compromise the TEE. For example, an attacker can exploit shielded kernel modules to learn the internal workings of the TEE. This cannot be done through static analysis, as the OS and firmware images of the TEE are typically provided as encrypted binaries. However, since they are decrypted by the TEE at runtime, an attacker can abuse the privileges of shielded kernel modules to infer useful information about the TEE.

샌드박스(600)는 신뢰 실행 환경 내에 적재된 커널 모듈이 취약점을 수반할 경우, 공격자는 해당 취약점을 공격하여 신뢰 실행 환경 전체를 장악할 수 있는 문제를 해결하기 위해 신뢰 실행 환경 내에서 동적으로 로딩된 커널 모듈이 실행되는 영역을 분리(격리)할 수 있다.The sandbox (600) can separate (isolate) the area where a dynamically loaded kernel module is executed within the trusted execution environment to resolve the problem that an attacker can take control of the entire trusted execution environment by attacking the vulnerability if the kernel module loaded within the trusted execution environment has a vulnerability.

샌드박스(600)는 감시점 기반 메모리 격리 기술로 구축될 수 있다. 샌드박스(600)를 구축하는 방법은 다음과 같다. 신뢰 실행 환경의 메모리 일부를 샌드박스 영역으로 예약한다. 다음으로 차폐된 커널 모듈의 초기화 단계에서 예약된 영역은 모듈 할당에 활용된다. 샌드박스(600)에서 모듈을 실행하기 전에 다른 신뢰 실행 환경의 소프트웨어가 상주하는 샌드박스 외부의 모든 액세스를 모니터링하도록 감시점을 구성한다. The sandbox (600) can be constructed with a watchpoint-based memory isolation technology. The method of constructing the sandbox (600) is as follows. A portion of the memory of the trusted execution environment is reserved as a sandbox area. Next, the reserved area is utilized for module allocation during the initialization phase of the shielded kernel module. Before executing a module in the sandbox (600), a watchpoint is configured to monitor all accesses outside the sandbox where software of another trusted execution environment resides.

차폐된 커널 모듈이 실행을 완료하면 신뢰 실행 환경의 영역에 다시 액세스할 수 있도록 감시점이 재구성된다. 감시점 구성 지침은 샌드박스(600)에서 액세스할 수 있기 때문에 공격자는 이를 악용하여 구성을 조작하려고 할 수 있다. 이를 방지하기 위해 구성의 정확성을 확인하는 검증 로직을 통해 감시점 구성 지침이 준수되는지 확인한다. When the shielded kernel module completes execution, the watchdog is reconfigured to allow access to the trusted execution environment area again. Since the watchdog configuration instructions are accessible from the sandbox (600), an attacker may attempt to manipulate the configuration by exploiting this. To prevent this, verification logic is used to verify that the watchdog configuration instructions are followed to verify the correctness of the configuration.

감시점 기반 보호에도 불구하고 샌드박스(600) 영역 외부는 여전히 실행 가능하다. 따라서 공격자는 유용한 신뢰 실행 환경의 라이브러리를 활용하고 성공적인 공격을 달성하기 위해 제어 흐름을 샌드박스 처리되지 않은 영역으로 전환하려고 시도할 수 있으나, 신뢰 실행 환경의 내부 레이아웃을 동적으로 또는 정적으로 분석할 수 없어 매우 어려울 것이다. 특히 암호화된 신뢰 실행 환경의 소프트웨어는 정적 분석을 방지한다. 또한, 감시점 기반 샌드박스(600)는 신뢰 실행 환경의 레이아웃에서 런타임 정보 유출을 방해한다. 결과적으로 공격자는 신뢰 실행 환경에서 유용한 코드 청크의 위치를 정확히 찾아낼 수 없다.Despite the watchpoint-based protection, the outside of the sandbox (600) area is still executable. Therefore, an attacker may attempt to exploit useful TEE libraries and divert control flow to the non-sandboxed area to achieve a successful attack, but it would be very difficult to dynamically or statically analyze the internal layout of the TEE. In particular, the encrypted TEE software prevents static analysis. In addition, the watchpoint-based sandbox (600) prevents runtime information leakage from the layout of the TEE. As a result, an attacker cannot pinpoint the location of useful code chunks in the TEE.

본 발명의 다른 실시예인 모바일 기기의 동적커널모듈 보호 방법은 일반 실행 환경에서 사용자 애플리케이션이 커널 모듈을 신뢰 실행 환경으로 전송하고 차폐 실행을 요청하는 (a)단계, 신뢰 실행 환경에서 신뢰할 수 있는 디스패처가 커널 모듈의 무결성을 확인하고 차폐된 모듈 로더를 호출하는 (b)단계, 및 차폐된 모듈 로더가 커널 모듈을 안전하게 실행하고 신뢰 실행 환경의 보안을 유지하도록 메모리 방화벽과 샌드박스를 구성하는 (c)단계를 포함할 수 있다. Another embodiment of the present invention provides a method for protecting a dynamic kernel module of a mobile device, which may include a step (a) in which a user application in a general execution environment transfers a kernel module to a trusted execution environment and requests shielded execution, a step (b) in which a trusted dispatcher in the trusted execution environment verifies the integrity of the kernel module and calls a shielded module loader, and a step (c) in which a memory firewall and a sandbox are configured so that the shielded module loader safely executes the kernel module and maintains the security of the trusted execution environment.

이상에서 대표적인 실시예를 통하여 본 발명을 상세하게 설명하였으나, 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자는 상술한 실시예에 대하여 본 발명의 범주에서 벗어나지 않는 한도 내에서 다양한 변형이 가능함을 이해할 것이다. 그러므로 본 발명의 권리 범위는 설명한 실시예에 국한되어 정해져서는 안 되며, 후술하는 특허청구범위뿐만 아니라 특허청구범위와 균등 개념으로부터 도출되는 모든 변경 또는 변형된 형태에 의하여 정해져야 한다. Although the present invention has been described in detail through representative examples above, those skilled in the art will understand that various modifications can be made to the above-described embodiments without departing from the scope of the present invention. Therefore, the scope of the rights of the present invention should not be limited to the described embodiments, but should be determined by all changes or modifications derived from the claims and equivalent concepts as well as the claims.

10 : 모바일 기기의 동적커널모듈 보호 시스템
100 : 클라이언트 애플리케이션
200 : TrustZone 커널 드라이버
300 : 신뢰할 수 있는 디스패처
400 : 차폐된 모듈 로더
500 : 메모리 방화벽
600 : 샌드박스
10: Dynamic Kernel Module Protection System for Mobile Devices
100 : Client Application
200 : TrustZone Kernel Driver
300: Trusted Dispatcher
400 : Shielded Module Loader
500 : Memory Firewall
600 : Sandbox

Claims (5)

일반 실행 환경에서 차폐 커널 모듈의 실행을 트리거하기 위해 차폐된 커널 모듈에 관한 정보를 신뢰 실행 환경에 대한 압축 메시지로 생성하는 클라이언트 애플리케이션;
상기 클라이언트 애플리케이션에서 생성된 압축 메시지를 복사하여 신뢰 실행 환경으로 전송하는 TrustZone 커널 드라이버;
신뢰 실행 환경에서 차폐된 커널 모듈을 초기화하고 실행하기 위해, 압축 메시지를 수신하고 상기 차폐된 커널 모듈의 무결성을 확인하며 하기 차폐된 모듈 로더를 호출하는 신뢰할 수 있는 디스패처; 및
상기 신뢰할 수 있는 디스패처의 호출에 의해 상기 차폐된 커널 모듈을 실행하는 차폐된 모듈 로더;를 포함하며,
상기 클라이언트 애플리케이션은 차폐된 커널 모듈의 이미지를 파일 스트림으로 로드하고, 로드된 커널 모듈의 시작 주소, 모듈 크기, 진입점 및 서명된 해시를 신뢰 실행 환경의 API를 사용하여 신뢰 실행 환경에 대한 메시지로 압축하며, 프로세서 간 인터럽트를 호출하여 다른 코어를 오프(off)시키는 것을 특징으로 하는 모바일 기기의 동적커널모듈 보호 시스템.
A client application that generates a compressed message to the trusted execution environment with information about the shielded kernel module to trigger execution of the shielded kernel module in the normal execution environment;
A TrustZone kernel driver that copies compressed messages generated by the client application and transmits them to the trusted execution environment;
A trusted dispatcher for receiving a compressed message, verifying the integrity of the shielded kernel module, and calling the shielded module loader to initialize and execute the shielded kernel module in a trusted execution environment; and
A shielded module loader that executes the shielded kernel module by a call from the trusted dispatcher;
A dynamic kernel module protection system for a mobile device, characterized in that the client application loads the image of a shielded kernel module as a file stream, compresses the start address, module size, entry point and signed hash of the loaded kernel module into a message to the trusted execution environment using the API of the trusted execution environment, and calls an inter-processor interrupt to turn off other cores.
삭제delete 제 1 항에 있어서,
상기 클라이언트 애플리케이션은,
신뢰 실행 환경에 압축 메시지가 전달될 수 있도록 상기 TrustZone 커널 드라이버를 오픈(open)시키는 것을 특징으로 하는 모바일 기기의 동적커널모듈 보호 시스템.
In paragraph 1,
The above client application,
A dynamic kernel module protection system for a mobile device, characterized by opening the TrustZone kernel driver so that compressed messages can be transmitted to a trusted execution environment.
제 1 항에 있어서,
상기 디스패처는,
수신한 압축 메시지를 구문 분석하여 상기 차폐된 커널 모듈의 주소와 크기를 획득하고, 신뢰 실행 환경의 샌드박스 영역에 메모리를 할당하고 획득한 차폐된 커널 모듈의 크기 정보를 기반으로 상기 차폐된 커널 모듈의 이미지를 메모리가 할당된 샌드박스 영역에 복사하는 것을 특징으로 하는 모바일 기기의 동적커널모듈 보호 시스템.
In paragraph 1,
The above dispatcher,
A dynamic kernel module protection system for a mobile device, characterized in that the system parses a received compressed message to obtain the address and size of the shielded kernel module, allocates memory to a sandbox area of a trusted execution environment, and copies the image of the shielded kernel module to the sandbox area to which memory is allocated based on the obtained size information of the shielded kernel module.
일반 실행 환경에서 클라이언트 애플리케이션이 커널 모듈을 신뢰 실행 환경으로 전송하고 차폐 실행을 요청하는 (a)단계;
신뢰 실행 환경에서 신뢰할 수 있는 디스패처가 상기 커널 모듈의 무결성을 확인하고 차폐된 모듈 로더를 호출하는 (b)단계; 및
상기 차폐된 모듈 로더가 상기 커널 모듈을 안전하게 실행하고 신뢰 실행 환경의 보안을 유지하도록 메모리 방화벽과 샌드박스를 구성하는 (c)단계;를 포함하며,
상기 (a)단계에서, 상기 클라이언트 애플리케이션은 차폐된 커널 모듈의 이미지를 파일 스트림으로 로드하고, 로드된 커널 모듈의 시작 주소, 모듈 크기, 진입점 및 서명된 해시를 신뢰 실행 환경의 API를 사용하여 신뢰 실행 환경에 대한 메시지로 압축하며, 프로세서 간 인터럽트를 호출하여 다른 코어를 오프(off)시키는 것을 특징으로 하는 모바일 기기의 동적커널모듈 보호 방법.
(a) Step where a client application in a normal execution environment transfers a kernel module to a trusted execution environment and requests shielded execution;
(b) step in which a trusted dispatcher in a trusted execution environment verifies the integrity of the kernel module and calls a shielded module loader; and
(c) step of configuring a memory firewall and a sandbox so that the shielded module loader safely executes the kernel module and maintains the security of the trusted execution environment;
A method for protecting a dynamic kernel module of a mobile device, characterized in that in the step (a), the client application loads the image of the shielded kernel module as a file stream, compresses the start address, module size, entry point, and signed hash of the loaded kernel module into a message to the trusted execution environment using the API of the trusted execution environment, and calls an inter-processor interrupt to turn off other cores.
KR1020220187368A 2022-12-28 2022-12-28 Dynamic kernel module protection method of mobile device and system using the same Active KR102833142B1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
KR1020220187368A KR102833142B1 (en) 2022-12-28 2022-12-28 Dynamic kernel module protection method of mobile device and system using the same
PCT/KR2023/019708 WO2024143952A1 (en) 2022-12-28 2023-12-01 Method of protecting dynamic kernel module of mobile device, and system using same

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020220187368A KR102833142B1 (en) 2022-12-28 2022-12-28 Dynamic kernel module protection method of mobile device and system using the same

Publications (2)

Publication Number Publication Date
KR20240104780A KR20240104780A (en) 2024-07-05
KR102833142B1 true KR102833142B1 (en) 2025-07-11

Family

ID=91718267

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020220187368A Active KR102833142B1 (en) 2022-12-28 2022-12-28 Dynamic kernel module protection method of mobile device and system using the same

Country Status (2)

Country Link
KR (1) KR102833142B1 (en)
WO (1) WO2024143952A1 (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200326766A1 (en) * 2019-04-10 2020-10-15 Red Hat, Inc. Idle state estimation by scheduler
CN113791898A (en) * 2021-08-24 2021-12-14 电子科技大学 A Trusted Microkernel Operating System Based on TrustZone

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104951316B (en) * 2014-03-25 2018-09-21 华为技术有限公司 A kind of credible startup method and apparatus of kernel
US9652631B2 (en) * 2014-05-05 2017-05-16 Microsoft Technology Licensing, Llc Secure transport of encrypted virtual machines with continuous owner access

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200326766A1 (en) * 2019-04-10 2020-10-15 Red Hat, Inc. Idle state estimation by scheduler
CN113791898A (en) * 2021-08-24 2021-12-14 电子科技大学 A Trusted Microkernel Operating System Based on TrustZone

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Liwei Guo and Felix Xiaozhu Lin, "Minimum Viable Device Drivers for ARM TrustZone"(2022.03.)*

Also Published As

Publication number Publication date
KR20240104780A (en) 2024-07-05
WO2024143952A1 (en) 2024-07-04

Similar Documents

Publication Publication Date Title
US11467982B2 (en) Virtualization-based platform protection technology
US10114958B2 (en) Protected regions
US9202046B2 (en) Systems and methods for executing arbitrary applications in secure environments
CN108475217B (en) System and method for auditing virtual machines
KR101922798B1 (en) Method and Apparatus for providing a private execution environment using ARM TrustZone
US10204220B1 (en) Thin hypervisor for native execution of unsafe code
US8627414B1 (en) Methods and apparatuses for user-verifiable execution of security-sensitive code
US12099864B2 (en) Formally verified trusted computing base with active security and policy enforcement
US20210049263A1 (en) Systems and methods for hypervisor-based protection of code
US10108800B1 (en) ARM processor-based hardware enforcement of providing separate operating system environments for mobile devices with capability to employ different switching methods
US10489185B2 (en) Hypervisor-assisted approach for locating operating system data structures based on attribute matching
US20180267818A1 (en) Hypervisor-assisted approach for locating operating system data structures based on notification data
US20150379265A1 (en) Systems And Methods For Preventing Code Injection In Virtualized Environments
Schiffman et al. The smm rootkit revisited: Fun with usb
Sani et al. The case for i/o-device-as-a-service
Wang et al. The Road to Trust: Building Enclaves within Confidential VMs
KR102833142B1 (en) Dynamic kernel module protection method of mobile device and system using the same
US12265650B2 (en) Systems, methods, and media for protecting applications from untrusted operating systems
Yu An I/O Separation Model and its Applications to On-Demand I/O on Commodity Platforms
Mallachiev et al. Protecting Applications from Highly Privileged Malware Using Bare-metal Hypervisor

Legal Events

Date Code Title Description
PA0109 Patent application

St.27 status event code: A-0-1-A10-A12-nap-PA0109

PA0201 Request for examination

St.27 status event code: A-1-2-D10-D11-exm-PA0201

D13-X000 Search requested

St.27 status event code: A-1-2-D10-D13-srh-X000

D14-X000 Search report completed

St.27 status event code: A-1-2-D10-D14-srh-X000

P11-X000 Amendment of application requested

St.27 status event code: A-2-2-P10-P11-nap-X000

P13-X000 Application amended

St.27 status event code: A-2-2-P10-P13-nap-X000

PG1501 Laying open of application

St.27 status event code: A-1-1-Q10-Q12-nap-PG1501

E902 Notification of reason for refusal
PE0902 Notice of grounds for rejection

St.27 status event code: A-1-2-D10-D21-exm-PE0902

T11-X000 Administrative time limit extension requested

St.27 status event code: U-3-3-T10-T11-oth-X000

T11-X000 Administrative time limit extension requested

St.27 status event code: U-3-3-T10-T11-oth-X000

E13-X000 Pre-grant limitation requested

St.27 status event code: A-2-3-E10-E13-lim-X000

P11-X000 Amendment of application requested

St.27 status event code: A-2-2-P10-P11-nap-X000

E701 Decision to grant or registration of patent right
PE0701 Decision of registration

St.27 status event code: A-1-2-D10-D22-exm-PE0701

PR0701 Registration of establishment

St.27 status event code: A-2-4-F10-F11-exm-PR0701

PR1002 Payment of registration fee

St.27 status event code: A-2-2-U10-U11-oth-PR1002

Fee payment year number: 1

PG1601 Publication of registration

St.27 status event code: A-4-4-Q10-Q13-nap-PG1601

PN2301 Change of applicant

St.27 status event code: A-5-5-R10-R13-asn-PN2301

St.27 status event code: A-5-5-R10-R11-asn-PN2301