KR102183648B1 - Method and apparatus for protecting kernel without nested paging - Google Patents

Method and apparatus for protecting kernel without nested paging Download PDF

Info

Publication number
KR102183648B1
KR102183648B1 KR1020180153016A KR20180153016A KR102183648B1 KR 102183648 B1 KR102183648 B1 KR 102183648B1 KR 1020180153016 A KR1020180153016 A KR 1020180153016A KR 20180153016 A KR20180153016 A KR 20180153016A KR 102183648 B1 KR102183648 B1 KR 102183648B1
Authority
KR
South Korea
Prior art keywords
area
memory
kernel
monitoring
write event
Prior art date
Application number
KR1020180153016A
Other languages
Korean (ko)
Other versions
KR20200066011A (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 KR1020180153016A priority Critical patent/KR102183648B1/en
Publication of KR20200066011A publication Critical patent/KR20200066011A/en
Application granted granted Critical
Publication of KR102183648B1 publication Critical patent/KR102183648B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/14Protection against unauthorised use of memory or access to memory
    • G06F12/1458Protection against unauthorised use of memory or access to memory by checking the subject access rights
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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

Abstract

중첩 페이징 없이 커널을 보호하는 방법 및 그 장치가 개시된다. 사용자 애플리케이션과 커널의 접근이 불가능하고 하이퍼바이저가 접근 가능한 보안영역을 포함하는 메모리와 시스템 버스를 감시하여 상기 메모리 내 감시영역에 대한 쓰기 이벤트를 파악하는 메모리버스감시장치를 포함한다.A method and apparatus for protecting a kernel without overlapping paging are disclosed. It includes a memory bus monitoring value that monitors a system bus and a memory including a security area in which the user application and the kernel cannot access and is accessible by the hypervisor, and detects write events for the monitoring area in the memory.

Description

중첩 페이징 없이 커널을 보호하는 방법 및 그 장치{Method and apparatus for protecting kernel without nested paging}Method and apparatus for protecting kernel without nested paging TECHNICAL FIELD

본 발명은 커널 보호 방법 및 그 장치에 관한 것으로, 보다 상세하게는 중첩 페이징을 사용하지 않고 악의적인 공격으로부터 커널을 보호하는 방법 및 그 장치에 관한 것이다.The present invention relates to a kernel protection method and apparatus, and more particularly, to a method and apparatus for protecting a kernel from malicious attacks without using overlapping paging.

일반적으로 SoC(System on Chip)에서 프로세서, 메모리 및 각종 디바이스들은 시스템 버스라고 하는 일종의 통신 채널로 상호 연결되어 있다. 프로세서에서 수행하는 코드가 메모리에 어떤 값을 쓰려고 하면, 프로세서는 메모리 쓰기 이벤트를 시스템 버스를 통해 메모리에 전달하고, 메모리 컨트롤러는 메모리 쓰기 이벤트에 따른 동작을 수행한다. In general, in a System on Chip (SoC), a processor, memory, and various devices are interconnected through a kind of communication channel called a system bus. When the code executed by the processor tries to write a value to the memory, the processor transmits a memory write event to the memory through the system bus, and the memory controller performs an operation according to the memory write event.

도 1은 종래 중첩 페이징을 포함하는 시스템 아키텍쳐의 일 예를 도시한 도면이다.1 is a diagram illustrating an example of a conventional system architecture including overlapping paging.

도 1을 참조하면, 종래 시스템 아키텍쳐는 사용자 레벨(100), 커널(kernel) 레벨(110), 하이퍼바이저(hypervisor) 레벨(120)을 포함한다. ARM 아키텍처에서 특권 레벨(privilege level)은 EL(exception level)로 불리며, EL0, EL1, EL2로 구분된다. 사용자 레벨(EL0) 및 커널 레벨(EL1)은 각각 사용자 애플리케이션 및 커널에 의해 사용되는 레벨이다. 하이퍼바이저는 레벨(EL2)에서 동작한다.Referring to FIG. 1, the conventional system architecture includes a user level 100, a kernel level 110, and a hypervisor level 120. In the ARM architecture, the privilege level is called an exception level (EL) and is classified into EL0, EL1, and EL2. The user level EL0 and the kernel level EL1 are levels used by the user application and the kernel, respectively. The hypervisor operates at level EL2.

하이퍼바이저 모드의 효율적인 구현을 위해, OS 커널 모드에서 하이퍼바이저 모드로 진입할 수 있게 해주는 전용 명령어(예를 들어, hypercall), OS 커널의 특정 명령어 수행을 감시하는 수 있는 기능(명령어 트랩), 중첩 페이징(nested paging) 등이 존재한다. For efficient implementation of hypervisor mode, a dedicated command that allows you to enter the hypervisor mode from the OS kernel mode (e.g., hypercall), the ability to monitor the execution of certain commands in the OS kernel (command trap), and nesting There is nested paging and the like.

예를 들어, ARM 아키텍처의 가상화 확장(virtualization extension)은 EL2(120)에서 하이퍼바이저가 효율적으로 동작할 수 있는 몇 가지 특징을 제공한다. 먼저, 하이퍼바이저는 HCR-EL2 레지스터를 설정하여 명령어 트랩을 할 수 있다. 이 레지스터를 사용하여, 하이퍼바이저는 TTBR(Translation Table Base Resister)레지스터의 갱신과 같은 몇 가지 커널 이벤트를 트랩할 수 있다. 또한, HVC라고 불리는 하이퍼콜(hypercall)을 지원할 수 있는데, 이를 수행하여 커널 모드에서 하이퍼바이저 모드로 진입할 수 있다. 중첩 페이징은 EL0(100)과 EL1(110)에서 가상 주소 변환에 사용된다. 메모리관리유닛(MMU, Memory Management Unit)은 중첩 페이지가 스테이지-1 페이지 테이블(112)과 스테이지-2 페이지 테이블(124)의 두 레벨을 동시에 관리할 수 있도록 지원한다. EL1(110)에서 사용되는 페이지 테이블인 스테이지-1 테이블(112)은 커널에 의해 사용되고, 가상 주소를 중간 물리 주소(IPA, Intermediate Physical Address)로 변환하는데 사용된다. 스테이지-2 페이지 테이블(124)은 스테이지-1 테이블(112)에 의해 변환된 중간 물리 주소를 물리 주소로 변환하는데 사용된다. EL2 페이지 테이블(122)은 EL2(120)의 가상 주소를 위하여 하이퍼바이저에 의해 사용된다. For example, the virtualization extension of the ARM architecture provides several features that enable the hypervisor to operate efficiently in the EL2 120. First, the hypervisor can do instruction traps by setting the HCR-EL2 register. Using this register, the hypervisor can trap several kernel events, such as updating the Translation Table Base Resister (TTBR) register. In addition, it can support a hypercall called HVC, and by doing this, you can enter the hypervisor mode from the kernel mode. Overlapping paging is used for virtual address translation in EL0 (100) and EL1 (110). A memory management unit (MMU) supports overlapping pages to simultaneously manage two levels of the stage-1 page table 112 and the stage-2 page table 124. The stage-1 table 112, which is a page table used in the EL1 110, is used by the kernel, and is used to convert a virtual address into an intermediate physical address (IPA). The stage-2 page table 124 is used to convert the intermediate physical address converted by the stage-1 table 112 into a physical address. The EL2 page table 122 is used by the hypervisor for the virtual address of the EL2 120.

중첩 페이징은 OS 커널의 다양한 메모리 이벤트를 감시할 수 있게 해준다는 점에서 다양한 커널 보호 보안 솔루션이 활용하고 있다. 그러나 중첩 페이징은 프로세서가 가상 주소(virtual address)를 물리 주소(physical address)로 변환할 때 2개의 페이지 테이블을 참조하여야 하므로 성능부하가 발생하는 문제점이 있다.Nested paging is utilized by various kernel protection security solutions in that it allows monitoring of various memory events of the OS kernel. However, when the processor converts a virtual address into a physical address, the overlapping paging has a problem in that a performance load occurs because two page tables must be referred to.

본 발명의 실시 예가 이루고자 하는 기술적 과제는, 중첩 페이징 없이 커널을 보호하는 방법 및 그 장치를 제공하는 데 있다.A technical problem to be achieved by an embodiment of the present invention is to provide a method and apparatus for protecting a kernel without overlapping paging.

상기의 기술적 과제를 달성하기 위한, 본 발명의 실시 예에 따른 커널 보호 방법의 일 예는, 사용자 애플리케이션 및 커널의 접근이 불가능하고 하이퍼바이저가 접근 가능한 메모리의 보안영역에 상주한 감시모듈이 수행하는 커널 보호 방법에 있어서, 커널로부터 페이지 테이블의 갱신 요청을 수신하면, 상기 갱신 요청을 검증하고 상기 페이지 테이블을 갱신하는 단계; 및 상기 페이지 테이블을 가리키는 시스템 컨트롤 레지스터가 갱신될 때 하이퍼바이저 모드의 명령어 트랩 기능을 이용하여 상기 갱신을 모니터링하는 단계;를 포함한다.An example of a kernel protection method according to an embodiment of the present invention for achieving the above technical problem is that a monitoring module residing in a secure area of a memory that is accessible to a user application and a kernel and accessible to a hypervisor is performed. A kernel protection method, comprising: upon receiving a request to update a page table from a kernel, verifying the update request and updating the page table; And monitoring the update using a hypervisor mode command trap function when a system control register indicating the page table is updated.

상기의 기술적 과제를 달성하기 위한, 본 발명의 실시 예에 따른 커널 보호 방법의 다른 예는, 시스템 버스와 연결된 메모리버스감시장치가 수행하는 커널 보호 방법에 있어서, 상기 시스템 버스를 통해 메모리 쓰기 이벤트를 모니터링하는 단계; 일정 크기 단위로 분할된 메모리의 각 영역과 맵핑되는 비트를 이용하여 감시영역을 표시하는 비트맵을 기초로, 감시영역에 대한 쓰기 이벤트가 발생하였는지 파악하는 단계; 및 감시영역에 대한 쓰기 이벤트가 발생하면, 쓰기 이벤트의 메모리 주소를 상기 메모리의 보안영역에 저장하고, 인터럽트를 발생하는 단계;를 포함한다.Another example of a kernel protection method according to an embodiment of the present invention for achieving the above technical problem is, in the kernel protection method performed by a memory bus monitoring device connected to a system bus, a memory write event is transmitted through the system bus. Monitoring; Determining whether a write event for the surveillance area has occurred based on a bitmap displaying the surveillance area using bits mapped to each area of the memory divided by a predetermined size unit; And when a write event for the monitoring area occurs, storing the memory address of the write event in the secure area of the memory, and generating an interrupt.

상기의 기술적 과제를 달성하기 위한, 본 발명의 실시 예에 따른 커널 보호를 위한 메모리버스감시장치의 일 예는, 시스템 버스를 감시하여 메모리 쓰기 이벤트를 파악하는 트래픽스누퍼; 메모리의 보안영역에 비트맵으로 저장된 감시영역 정보를 기초로 감시영역에 대한 쓰기 이벤트가 발생하였는지 파악하는 비트맵변환부; 및 감시영역에 대한 쓰기 이벤트가 발생하면, 쓰기 이벤트의 메모리 주소를 상기 메모리의 보안영역에 저장하고, 인터럽트를 발생하는 결정부;를 포함한다.In order to achieve the above technical problem, an example of a memory bus monitoring device for kernel protection according to an embodiment of the present invention includes: a traffic snooper that monitors a system bus and detects a memory write event; A bitmap conversion unit that determines whether a write event for the surveillance area has occurred based on the surveillance area information stored as a bitmap in the security area of the memory; And a determination unit for storing a memory address of the write event in the secure area of the memory and generating an interrupt when a write event for the monitoring area occurs.

상기의 기술적 과제를 달성하기 위한, 본 발명의 실시 예에 따른 커널 보호가 가능한 시스템의 일 예는, 사용자 애플리케이션과 커널의 접근이 불가능하고 하이퍼바이저가 접근 가능한 보안영역을 포함하는 메모리; 및 시스템 버스를 감시하여 상기 메모리 내 감시영역에 대한 쓰기 이벤트를 파악하는 메모리버스감시장치;를 포함하고, 상기 메모리의 보안영역에 소프트웨어로 구현된 감시모듈이 상주하고, 상기 감시모듈은 커널로부터 페이지 테이블의 갱신 요청을 수신하면, 상기 갱신 요청의 검증 후에 상기 페이지 테이블을 갱신한다.In order to achieve the above technical problem, an example of a system capable of protecting a kernel according to an embodiment of the present invention includes a memory including a security area in which a user application and a kernel cannot access and a hypervisor can access; And a memory bus monitoring device that monitors the system bus and detects a write event for the monitoring area in the memory, wherein a monitoring module implemented as software resides in the security area of the memory, and the monitoring module is a page from the kernel. Upon receiving a table update request, the page table is updated after verifying the update request.

본 발명의 실시 예에 따르면, 성능부하가 발생하는 중첩 페이징 없이 커널을 보호할 수 있다. 중첩 페이징은 MMU(Memory Management Unit)를 기반으로 동작하므로 MMU가 메모리를 관리하는 기본 단위인 페이지(4Kbyte) 단위로 메모리 감시영역을 지정할 수밖에 없으나, 본 실시 예는 이보다 훨씬 작은 단위로 메모리 감시영역을 지정할 수 있어, 페이지보다 작은 단위(예를 들어, 8byte 등)를 가지는 메모리 이벤트를 보다 효율적으로 감시할 수 있다. 또한, 메모리 감시를 위해 시스템 버스와 연결된 별도의 하드웨어 모듈을 포함하므로 프로세서에서 동작하는 프로그램에 전혀 성능 부가가 없는 장점이 있다.According to an embodiment of the present invention, it is possible to protect the kernel without overlapping paging in which a performance load occurs. Since overlapping paging operates based on the MMU (Memory Management Unit), the memory monitoring area must be designated in units of pages (4Kbytes), which are the basic units for the MMU to manage the memory. It can be specified, so that memory events with smaller units than pages (eg, 8 bytes) can be monitored more efficiently. In addition, since a separate hardware module connected to the system bus is included for memory monitoring, there is an advantage that there is no performance addition to a program running in the processor.

도 1은 종래 중첩 페이징을 포함하는 시스템 아키텍쳐의 일 예를 도시한 도면,
도 2는 본 발명의 실시 예에 따른 커널 보호를 위한 프레임워크의 일 예를 도시한 도면,
도 3은 본 발명의 실시 예에 따른 커널 보호를 위해 메모리의 분리된 실행 환경의 일 예를 도시한 도면,
도 4는 본 발명의 실시 예에 따른 커널 보호 방법의 일 예를 도시한 도면,
도 5는 본 발명의 실시 예에 따른 메모리버스감시장치의 구성의 일 예를 도시한 도면,
도 6은 본 발명의 실시 예에 따른 감시 모듈을 이용한 커널 보호 방법의 일 예를 도시한 흐름도,
도 7은 본 발명의 실시 예에 따른 감시 모듈을 이용한 커널 보호 방법의 다른 일 예를 도시한 흐름도, 그리고,
도 8은 본 발명의 실시 예에 따른 메모리버스감시장치가 수행하는 커널 보호 방법의 일 예를 도시한 흐름도이다.
1 is a diagram showing an example of a system architecture including a conventional overlapping paging;
2 is a diagram illustrating an example of a framework for kernel protection according to an embodiment of the present invention;
3 is a diagram illustrating an example of a separate execution environment of a memory for kernel protection according to an embodiment of the present invention;
4 is a diagram showing an example of a kernel protection method according to an embodiment of the present invention;
5 is a diagram showing an example of a configuration of a memory bus monitoring device according to an embodiment of the present invention;
6 is a flowchart showing an example of a kernel protection method using a monitoring module according to an embodiment of the present invention;
7 is a flow chart showing another example of a kernel protection method using a monitoring module according to an embodiment of the present invention, and,
8 is a flowchart illustrating an example of a kernel protection method performed by a memory bus monitoring apparatus according to an embodiment of the present invention.

이하에서, 첨부된 도면들을 참조하여 본 발명의 실시 예에 따른 중첩 페이지 없이 커널을 보호하는 방법 및 그 장치에 대해 상세히 살펴본다.Hereinafter, a method and apparatus for protecting a kernel without overlapping pages according to an embodiment of the present invention will be described in detail with reference to the accompanying drawings.

도 2는 본 발명의 실시 예에 따른 커널 보호를 위한 프레임워크의 일 예를 도시한 도면이다.2 is a diagram illustrating an example of a framework for protecting a kernel according to an embodiment of the present invention.

도 2를 참조하면, 커널 보호를 위해 메모리(200)는 OS 커널이나 사용자 애플리케이션이 접근 가능한 일반영역(normal space)(210)과 하이퍼바이저만 접근 가능한 보안영역(secure space)(220)으로 구분된다. 보안영역(220)에는 감시모듈(230)과 적어도 하나 이상의 보안솔루션(250)이 존재할 수 있다. 커널 보호를 위한 다른 방법으로, 하드웨어 모듈인 메모리버스감시장치(240)를 이용할 수 있다. 감시모듈(230)을 이용하여 커널을 보호하는 방법의 일 예가 도 3에 도시되어 있고, 메모리버스감시장치(240)를 이용하여 커널을 보호하는 방법의 일 예가 도 4에 도시되어 있다. Referring to FIG. 2, for kernel protection, the memory 200 is divided into a normal space 210 accessible by an OS kernel or a user application and a secure space 220 accessible only by a hypervisor. . A monitoring module 230 and at least one security solution 250 may exist in the security area 220. As another method for protecting the kernel, the memory bus monitoring device 240, which is a hardware module, may be used. An example of a method of protecting the kernel using the monitoring module 230 is shown in FIG. 3, and an example of a method of protecting the kernel using the memory bus monitoring device 240 is shown in FIG. 4.

감시모듈(230)은 시스템 부팅 시에 초기화될 수 있다. 예를 들어, 시스템이 ARM 아키텍처로 구현된 경우에, 초기화 과정에서 감시모듈(230)은 EL2 시스템 컨트롤 레지스터를 설정한다. 또한, 감시모듈(230)은 보안영역(220)에서 사용할 EL2 페이지 테이블(도 1의 122)을 만든다. 예를 들어, EL2 페이지 테이블(122)이 선형 맵핑 전략(linear mapping strategy)을 이용한다면 EL2 가상 주소는 물리 주소와 동일하며 스테이지-2 페이지 페이블(124)이 필요 없다. 감시모듈(230)은 EL2(120)에 대한 스택 포인터 레지스터(SP_EL2)를 초기화한다. 감시모듈(230)은 EL2(120)의 예외 벡터(exception vector)를 설정하여, 커널 동작 중에 발생하는 예외(호출함수, 트랩)를 동시에 처리할 수 있도록 한다. 감시모듈(230)은 가상 메모리 구성과 관련된 레지스터의 변경 시도를 트랩하기 위하여 HCR_EL2 레지스터의 TVM 비트를 활성화할 수 있다. 감시모듈(230)은 EL2 페이지 테이블(122)의 베이스 주소(base address)를 가지고 있는 TTBR1_EL2의 갱신을 감시하여, 커널이 유효한 EL1 페이지 테이블(110)만을 사용할 수 있도록 한다.The monitoring module 230 may be initialized when the system is booted. For example, when the system is implemented with the ARM architecture, the monitoring module 230 sets the EL2 system control register during the initialization process. Also, the monitoring module 230 creates an EL2 page table (122 in FIG. 1) to be used in the security area 220. For example, if the EL2 page table 122 uses a linear mapping strategy, the EL2 virtual address is the same as the physical address, and the stage-2 page page 124 is not required. The monitoring module 230 initializes the stack pointer register SP_EL2 for the EL2 120. The monitoring module 230 sets an exception vector of the EL2 120 so that exceptions (calling functions, traps) occurring during kernel operation can be simultaneously handled. The monitoring module 230 may activate the TVM bit of the HCR_EL2 register to trap an attempt to change a register related to the virtual memory configuration. The monitoring module 230 monitors the update of TTBR1_EL2 having a base address of the EL2 page table 122 so that the kernel can use only the valid EL1 page table 110.

커널이 EL1 페이지 테이블(110)을 간섭하는 것을 방지하기 위하여, 커널 코드를 변경할 수 있다. 또한, 메모리 블록을 2MB 섹션 단위가 아닌 4KB 페이지 단위로 할당하도록 커널을 변경할 수 있다. ARM 아키텍처의 경우에, 각 페이지 테이블의 크기는 4KB이나, 커널은 커널 선형 영역(kernel linear region)에 2MB 섹션으로 메모리 블록을 할당한다. 메모리 블록과 페이지 테이블 크기의 불일치로 인해 메모리 섹션은 페이지 테이블 및 이와 관련없는 데이터를 모두 포함할 수 있다. 따라서 커널이 메모리 영역을 4KB 페이지로 할당하도록 변경하여 이 문제를 해결할 수 있다.In order to prevent the kernel from interfering with the EL1 page table 110, the kernel code can be changed. Also, the kernel can be changed to allocate memory blocks in units of 4KB pages rather than in units of 2MB sections. In the case of the ARM architecture, the size of each page table is 4KB, but the kernel allocates memory blocks in 2MB sections in the kernel linear region. Due to the mismatch between the size of the memory block and the page table, the memory section may contain both the page table and unrelated data. Therefore, this problem can be solved by changing the kernel to allocate the memory area in 4KB pages.

페이지 테이블 크기와 메모리 블록의 크기가 일치하면, 감시모듈(230)의 개입 없이 페이지 테이블 페이지에 대한 읽기 전용 정책을 효과적으로 수행할 수 있다. 그리고 커널이 페이지 테이블을 직접 변경하는 대신에 감시모듈(230)을 통해 커널 페이지 테이블을 변경하도록 커널을 변경할 수 있다. 감시모듈(230)은 쓰기 동작을 검증하고, 쓰기 요청이 타당하면 커널을 대신하여 쓰기 동작을 수행한다. 이에 대해 도 3에서 다시 살펴본다.When the size of the page table and the size of the memory block match, the read-only policy for the page table page can be effectively executed without the intervention of the monitoring module 230. In addition, the kernel may be changed so that the kernel page table is changed through the monitoring module 230 instead of the kernel directly changing the page table. The monitoring module 230 verifies the write operation, and if the write request is valid, performs a write operation on behalf of the kernel. This will be described again in FIG. 3.

도 3은 본 발명의 실시 예에 따른 커널 보호를 위해 메모리의 분리된 실행 환경의 일 예를 도시한 도면이다.3 is a diagram illustrating an example of a separate execution environment of a memory for kernel protection according to an embodiment of the present invention.

도 2를 참조하면, 메모리는 일반영역(210)과 보안영역(220)으로 구분된다. 보안영역(220)에서 일반영역(210)으로 접근은 가능하나, 일반영역(210)에서 보안영역(220)으로 접근은 불가능하다. 따라서 일반영역(210)에 위치한 사용자 애플리케이션이나 커널은 보안영역(220)에 접근할 수 없으며, 보안영역(220)에 위치한 감시모듈(230)은 일반영역(210)에 접근할 수 있다.Referring to FIG. 2, the memory is divided into a general area 210 and a security area 220. Access from the security area 220 to the general area 210 is possible, but access from the general area 210 to the security area 220 is impossible. Accordingly, a user application or kernel located in the general area 210 cannot access the security area 220, and the monitoring module 230 located in the security area 220 can access the general area 210.

보안영역(220)에 위치한 감시모듈(230)은 소프트웨어 모듈로서, 시스템 부팅시 메모리의 보안영역(220)에 상주한다. 감시모듈(230)은 직접 커널 페이지 테이블을 감시하며, 도 1과 달리 별도의 중첩 페이징을 이용하지 않는다. 다시 말해, 보안영역(220)의 메모리 영역을 맵핑하기 위한 별도의 페이지 테이블(예를 들어, 도 1의 스테이지-2 페이지 테이블(124))이 생성되지 않는다. The monitoring module 230 located in the security area 220 is a software module and resides in the security area 220 of the memory when the system is booted. The monitoring module 230 directly monitors the kernel page table, and does not use a separate overlapping paging unlike FIG. 1. In other words, a separate page table (eg, stage-2 page table 124 of FIG. 1) for mapping the memory area of the security area 220 is not generated.

종래의 경우에, 커널은 일반영역(210)의 페이지 테이블을 관리하므로, 손상된 커널이 페이지 테이블을 건드릴 위험성이 있다. 예를 들어, 공격자가 보안영역(220)의 메모리 영역에 대한 맵핑을 생성하는 커널 페이지 테이블을 변경하여 보안영역(220)에 접근을 시도할 수 있다. 그러므로 커널 페이지 테이블을 보호하기 위하여, 본 실시 예는 커널 페이지를 갱신하는 커널 코드를 감시모듈을 호출하는 명령어(이하, '호출함수'라 함)(310)로 변경한다. 이러한 변경으로 인해 커널을 대신하여 감시모듈(230)이 커널 페이지 테이블(350)을 갱신할 수 있다. In the conventional case, since the kernel manages the page table of the general area 210, there is a risk that the damaged kernel may touch the page table. For example, an attacker may attempt to access the security area 220 by changing a kernel page table that creates a mapping for the memory area of the security area 220. Therefore, in order to protect the kernel page table, in the present embodiment, the kernel code for updating the kernel page is changed to a command (hereinafter, referred to as a'call function') 310 for calling a monitoring module. Due to this change, the monitoring module 230 may update the kernel page table 350 instead of the kernel.

감시모듈(230)은 커널로부터 호출함수(310)를 통해 커널 페이지 갱신 요청을 수신하면, 갱신 요청이 정당한 요청인지 검증한다. 예를 들어, 감시모듈(230)은 종래의 다양한 검증 방법을 통해 커널 페이지 갱신 요청이 커널의 정당한 요청인지 아니면 악의적인 제3자에 의한 갱신 요청인지 검증할 수 있다. 본 실시 예는 종래의 다양한 커널 페이지 갱신 요청의 검증 방법을 적용할 수 있다.When the monitoring module 230 receives a kernel page update request from the kernel through the call function 310, it verifies whether the update request is a legitimate request. For example, the monitoring module 230 may verify whether the kernel page update request is a legitimate request from the kernel or an update request from a malicious third party through various conventional verification methods. In the present embodiment, various conventional methods of verifying kernel page update requests can be applied.

감시모듈(230)은 커널 페이지 영역에

Figure 112018120410427-pat00001
정책을 적용하여 커널 페이지 테이블을 위해 사용되는 메모리 영역(340)을 읽기 전용으로 설정하고, 커널이 보안 영역에 대한 메모리 영역(350)에 접근 불가능하도록 만들 수 있다. The monitoring module 230 is in the kernel page area.
Figure 112018120410427-pat00001
By applying a policy, the memory area 340 used for the kernel page table may be set as read-only, and the kernel may make the memory area 350 for the security area inaccessible.

특권 명령어(privileged instruction)(330)는 시스템의 구성(configuration)을 갱신하거나 읽기 위해 수행될 수 있다. 예를 들어, 특권 명령어(330)는 페이지 테이블 베이스 레지스터(page table base register)의 값을 변경하기 위하여 사용될 수 있다. 그러나 공격자가 이러한 특권 명령어(330)를 이용하여 앞서 살핀 감시 모듈을 이용한 분리된 실행 환경(isolated execution environment)이 불가능하게 만들 수 있다. 즉, 공격자는 주소 변환을 위하여 악의적으로 생성한 페이지 테이블을 사용할 수 있으며 또는 주소 변환을 불가능하게 할 수도 있다. Privileged instruction 330 may be performed to read or update the configuration of the system. For example, the privilege command 330 may be used to change a value of a page table base register. However, an attacker may use the privileged command 330 to make an isolated execution environment impossible using the previously salpin monitoring module. In other words, an attacker may use a maliciously created page table for address translation or may disable address translation.

따라서 본 실시 예의 감시모듈(230)은 특권 명령어(330)의 악의적인 실행을 막기 위하여 특권 명령어를 트랩(320)한다. 특권 명령어(330)가 실행되면, 트랩(320)이 생성되고, 감시모듈(230)은 자신이 정상 동작하는데 필요한 설정(setting)이 변경되는지를 확인한다. Accordingly, the monitoring module 230 of the present embodiment traps 320 a privileged instruction to prevent malicious execution of the privileged instruction 330. When the privileged command 330 is executed, the trap 320 is generated, and the monitoring module 230 checks whether a setting required for its normal operation is changed.

커널 무결성(kernel integrity)을 보호하기 위하여 커널 메모리 영역을 감시하는 것이 필요하다. 이를 위해, 종래의 하이퍼바이저 기반의 접근 방법은 도 1과 같이 감시영역을 위한 스테이지-2 페이지 테이블(124)의 엔트리를 읽기 전용(read-only)으로 마크한 중첩 페이지를 이용한다. 만약 감시영역을 갱신하려는 시도 때문에 승인 오류(permission fault)가 발행하면, 하이퍼바이저가 개입하여 메모리 쓰기 이벤트의 타당성을 검증한다. 그러나 이러한 중첩 페이징은 페이지 테이블 작업 오버헤드가 있을 뿐만 아니라, 중첩 페이징을 통한 모니터링은 보호 입자성 갭(protection granularity gap) 문제로 인한 오버헤드가 발생할 수 있다.It is necessary to monitor the kernel memory region to protect kernel integrity. To this end, a conventional hypervisor-based approach uses an overlapping page in which an entry in the stage-2 page table 124 for a surveillance area is marked as read-only as shown in FIG. 1. If a permission fault is issued due to an attempt to update the surveillance area, the hypervisor intervenes to verify the validity of the memory write event. However, such overlapping paging may have overhead for page table work, and monitoring through overlapping paging may incur overhead due to a protection granularity gap problem.

이러한 문제점을 해결하기 위한 일 실시 예로, 도 2와 같이 소프트웨어로 구현되어 보안영역에 상주하는 감시모듈(230) 외에 하드웨어로 구현된 메모리버스감시장치(MBM, Memory Bus Monitor)를 포함한다. 메모리버스감시장치의 주요 기능은 페이지 단위(page-granularity)보다 더 작은 단위의 메모리 영역(fine-grained memory region)을 감시하는 것이다. 그러나 이러한 하드웨어 모듈은 프로세서 내부 정보를 알 수 없다는 문제점이 있다. 예를 들어, 커널 데이터 객체가 능동적으로 할당되는 메모리 주소를 알 수 없기 때문에, 제한된 커널 객체를 감시하는 경우에만 사용될 수 있다. 더구나, 물리 주소와 가상 주소 사이의 맵핑 정보가 메모리버스감시장치에 노출되지 않으므로, 주소 변환 재배치 공격(ATRA, address translation relocation attack)에 취약하다. 이러한 문제점을 해결하기 위하여, 감시모듈(230)은 프로세서의 내부 상태를 메모리버스감시장치에 제공한다. As an example for solving this problem, a memory bus monitoring device (MBM, Memory Bus Monitor) implemented as hardware is included in addition to the monitoring module 230 implemented in software and residing in the security area as shown in FIG. 2. The main function of the memory bus monitoring device is to monitor a fine-grained memory region that is smaller than a page-granularity. However, such a hardware module has a problem that internal information of the processor cannot be known. For example, since the memory address to which the kernel data object is actively allocated cannot be known, it can only be used when monitoring restricted kernel objects. Moreover, since mapping information between physical and virtual addresses is not exposed to the memory bus monitoring device, it is vulnerable to an address translation relocation attack (ATRA). To solve this problem, the monitoring module 230 provides the internal state of the processor to the memory bus monitoring device.

도 4는 본 발명의 실시 예에 따른 커널 보호 방법의 일 예를 도시한 도면이다.4 is a diagram illustrating an example of a kernel protection method according to an embodiment of the present invention.

도 4를 참조하면, 감시모듈(230)과 메모리버스감시장치(240)를 이용하여 커널 메모리를 감시하는 방법이 도시되어 있다. 본 실시 예에서 보안솔루션(250)은 보안영역(220)에 상주하며, 커널 코드에 삽입된 감시 모듈 호출함수를 통해 감시영역(400)을 감시모듈(230)에게 알려준다. Referring to FIG. 4, a method of monitoring kernel memory using the monitoring module 230 and the memory bus monitoring device 240 is shown. In this embodiment, the security solution 250 resides in the security area 220 and informs the monitoring module 230 of the monitoring area 400 through a monitoring module call function inserted in the kernel code.

커널이 감시영역(400) 설정을 위한 호출함수(410)를 실행하면, 감시모듈(230)은 보안 솔루션(250)의 식별자와 감시영역의 베이스 주소와 크기 정보를 수신한다(①). When the kernel executes the call function 410 for setting the monitoring area 400, the monitoring module 230 receives the identifier of the security solution 250 and the base address and size information of the monitoring area (①).

감시모듈(230)은 감시영역(400)의 가상 주소를 물리 주소로 변환하고 이를 메모리버스감시버스장치(240)에 제공한다. 메모리의 일정 크기(예를 들어, 1word(=8 byte))를 1비트로 맵핑하는 비트맵(420)을 통해 감시영역(400)은 워드 단위(word granularity)로 표현된다. 감시모듈(230)은 비트맵(420)에서 감시영역에 해당하는 비트를 설정(예를 들어, '1'로 설정)하고, 메모리버스감시장치(240)는 비트맵(420)을 통해 감시영역(400)을 알 수 있다(②).The monitoring module 230 converts the virtual address of the monitoring area 400 into a physical address and provides it to the memory bus monitoring bus device 240. The surveillance area 400 is expressed in word granularity through a bitmap 420 that maps a certain size of the memory (eg, 1 word (=8 bytes)) to 1 bit. The monitoring module 230 sets a bit corresponding to the monitoring area in the bitmap 420 (for example, set to '1'), and the memory bus monitoring device 240 uses the bitmap 420 to (400) can be seen (②).

메모리버스감시장치(240)가 감시영역(400)에 대한 모든 메모리 이벤트를 감시할 수 있도록, 감시모듈(230)은 감시영역(400)을 포함하는 페이지에 대한 캐시 엔트리가 생성되지 않도록 커널 페이지 테이블(350)을 변경한다. 커널 메모리 영역에 대한 메모리 쓰기 이벤트가 발생할 때마다(③), 메모리버스감시장치(240)는 비트맵(420)에서 메모리 이벤트에 해당하는 메모리 영역의 비트가 설정되어 있는지를 파악한다(④).In order that the memory bus monitoring device 240 can monitor all memory events for the monitoring area 400, the monitoring module 230 is a kernel page table so that a cache entry for a page including the monitoring area 400 is not generated. Change (350). Whenever a memory write event for the kernel memory area occurs (③), the memory bus monitoring device 240 checks whether a bit of a memory area corresponding to a memory event is set in the bitmap 420 (④).

비트가 설정되어 있다면, 메모리버스감시장치(240)는 링 버퍼에 이벤트 정보(예를 들어, 주소, 값)를 저장하고(⑤), 감시모듈(230)에게 감시영역(400)에 대한 메모리 이벤트가 발생하였음을 알리기 위하여 인터럽트를 발생한다(⑥). If the bit is set, the memory bus monitoring device 240 stores event information (e.g., address, value) in the ring buffer (⑤), and sends a memory event to the monitoring area 400 to the monitoring module 230. An interrupt is generated to inform that a has occurred (⑥).

감시모듈(230)은 출력 버퍼로부터 이벤트 정보를 페치(fetch)하고(⑦), 이벤트 정보를 보안 솔루션(250)에 전달한다(⑧). 링 버퍼와 비트맵(420) 등 메모리버스감시장치(240)가 사용하는 모든 메모리 영역은 보안 영역에 위치하므로, 커널이 메모리버스감시장치(240)의 동작을 훼손시킬 수 없다.The monitoring module 230 fetches event information from the output buffer (⑦) and delivers the event information to the security solution 250 (⑧). Since all the memory areas used by the memory bus monitoring device 240 such as the ring buffer and the bitmap 420 are located in the security area, the kernel cannot damage the operation of the memory bus monitoring device 240.

도 5는 본 발명의 실시 예에 따른 메모리버스감시장치의 구성의 일 예를 도시한 도면이다.5 is a diagram illustrating an example of a configuration of a memory bus monitoring apparatus according to an embodiment of the present invention.

도 5를 참조하면, 메모리버스감시장치(240)는 슬레이브인테페이스(500), 트래픽스누퍼(traffic snopper)(510), FIFO(520), 비트맵변환부(530), 결정부(540), 캐시(550), 마스터인터페이스(560) 등을 포함한다. 또한 메모리버스감시장치(240)는 시스템 버스(570)와 연결되어 있다. 메모리버스감시장치(240)를 포함하는 시스템은 프로세서, 메모리 등을 포함하는 컴퓨팅 장치이다. Referring to FIG. 5, the memory bus monitoring device 240 includes a slave interface 500, a traffic snopper 510, a FIFO 520, a bitmap conversion unit 530, a determination unit 540, and It includes a cache 550, a master interface 560, and the like. In addition, the memory bus monitoring device 240 is connected to the system bus 570. A system including the memory bus monitoring device 240 is a computing device including a processor, memory, and the like.

슬레이브인터페이스(500)는 메모리컨트롤러와 시스템 버스(570) 사이에서 송수신되는 메모리 이벤트를 수신한다. 마스터인터페이스(560)는 시스템 버스(570)와 연결되어 메인 메모리부터 비트맵 데이터 등을 수신한다. The slave interface 500 receives memory events transmitted and received between the memory controller and the system bus 570. The master interface 560 is connected to the system bus 570 to receive bitmap data and the like from the main memory.

트래픽스누퍼(510)는 시스템 버스(570)의 트래픽을 감시하고, 메모리 쓰기/값 쌍을 캡쳐한다. FIFO(520)는 트래픽스누퍼(510)가 캡쳐한 메모리 쓰기/값 쌍을 임시 저장한다. The traffic snooper 510 monitors the traffic of the system bus 570 and captures memory write/value pairs. The FIFO 520 temporarily stores a memory write/value pair captured by the traffic snooper 510.

비트맵변환부(530)는 FIFO(520)로부터 데이터를 로딩하고, 로딩한 메모리 이벤트 데이터의 주소에 해당하는 비트맵 주소를 계산한다. 비트맵변환부(530)는 메인 메모리로부터 비트맵 데이터를 읽을 수 있다. 그러나 동일 영역에 대한 쓰기 이벤트가 있을 때마다 메인 메모리에 접근하고 비트맵 데이터를 페치하는 것은 비효율적일 수 있다. 따라서 일 실시 예로, 캐시(550)에 비트맵 데이터를 저장할 수 있다. 캐시(550)는 읽기-할당 캐시 정책을 따르며, 비트맵에 대한 메모리 쓰기 이벤트가 검출될 때 갱신될 수 있다. The bitmap conversion unit 530 loads data from the FIFO 520 and calculates a bitmap address corresponding to the address of the loaded memory event data. The bitmap converter 530 may read bitmap data from the main memory. However, it may be inefficient to access main memory and fetch bitmap data whenever there is a write event for the same area. Therefore, as an example, bitmap data may be stored in the cache 550. The cache 550 follows a read-allocation cache policy and may be updated when a memory write event for a bitmap is detected.

비트맵 데이터가 로딩된 후 비트맵변환부(530)는 이를 결정부(540)에 전달한다. 결정부(540)는 쓰기 이벤트의 메모리 영역에 대한 비트맵 데이터의 비트가 설정되어 있는지 파악한다. 비트맵 데이터의 비트가 감시영역으로 설정되어 있다면, 결정부(540)는 감시영역에 대한 이벤트가 발생하였음을 감시모듈(230)에 알려주기 위하여 프로세서에 인터럽트를 전송한다. 감시모듈(230)은 인터럽트를 가로채어 해당하는 이벤트를 처리한다. After the bitmap data is loaded, the bitmap conversion unit 530 transmits it to the determination unit 540. The determination unit 540 determines whether a bit of the bitmap data for the memory area of the write event is set. If the bit of the bitmap data is set to the monitoring area, the determination unit 540 transmits an interrupt to the processor to inform the monitoring module 230 that an event for the monitoring area has occurred. The monitoring module 230 intercepts the interrupt and processes the corresponding event.

도 6은 본 발명의 실시 예에 따른 감시 모듈을 이용한 커널 보호 방법의 일 예를 도시한 흐름도이다. 본 실시 예를 위하여, 페이지 테이블에 접근하는 커널 코드는 감시모듈 호출을 위한 명령어로 대체되어 있다고 가정한다.6 is a flowchart illustrating an example of a kernel protection method using a monitoring module according to an embodiment of the present invention. For the present embodiment, it is assumed that the kernel code accessing the page table is replaced with a command for calling the monitoring module.

도 6을 참조하면, 감시모듈(230)은 커널로부터 페이지 테이블 갱신 요청을 수신하면(S600), 해당 갱신 요청이 정당한지 검증한다(S610). 갱신 요청이 정당하면, 감시모듈(230)은 커널을 대신하여 페이지 테이블을 갱신한다(S620). 여기서, 감시모듈(230)은 커널의 접근이 불가능한 메모리의 보안영역에 상주한다. Referring to FIG. 6, when the monitoring module 230 receives a page table update request from the kernel (S600), it verifies whether the corresponding update request is valid (S610). If the update request is valid, the monitoring module 230 updates the page table on behalf of the kernel (S620). Here, the monitoring module 230 resides in a secure area of a memory in which the kernel cannot access.

도 7은 본 발명의 실시 예에 따른 감시 모듈을 이용한 커널 보호 방법의 다른 일 예를 도시한 흐름도이다7 is a flowchart showing another example of a kernel protection method using a monitoring module according to an embodiment of the present invention

도 7을 참조하면, 페이지 테이블을 가리키는 시스템 컨트롤 레지스터의 갱신이 발생하면(S700), 감시모듈(230)은 하이퍼바이저 모드의 트랩 기능을 이용하여 갱신이 발생하였음을 파악한다(S710). Referring to FIG. 7, when an update of the system control register indicating a page table occurs (S700), the monitoring module 230 determines that the update has occurred using a trap function in the hypervisor mode (S710).

도 8은 본 발명의 실시 예에 따른 메모리버스감시장치가 수행하는 커널 보호 방법의 일 예를 도시한 흐름도이다.8 is a flowchart illustrating an example of a kernel protection method performed by a memory bus monitoring apparatus according to an embodiment of the present invention.

도 8을 참조하면, 메모리버스감시장치(240)는 감시영역에 대한 메모리 쓰기 이벤트를 모니터링한다(S800). 예를 들어, 메모리버스감시장치(240)는 감시영역에 대한 정보를 비트로 표시하는 비트맵을 통해 감시영역에 대한 쓰기 이벤트가 발생하였는지 파악할 수 있다. Referring to FIG. 8, the memory bus monitoring device 240 monitors a memory write event for the monitoring area (S800). For example, the memory bus monitoring device 240 may determine whether a write event for the monitoring area has occurred through a bitmap displaying information on the monitoring area as bits.

감시영역에 대한 메모리 쓰기 이벤트가 발생하면(S810), 메모리버스감시장치(240)는 쓰기 이벤트의 주소 등을 메모리에 저장하고, 인터럽트를 발생한다(S820). 그러면 감시모듈(230)은 인터럽트를 가로채어 메모리 쓰기 이벤트의 주소 정보 등을 보안 솔루션에 전달하여 적절한 조치가 이루어질 수 있도록 한다.When a memory write event for the monitoring area occurs (S810), the memory bus monitoring device 240 stores the address of the write event in the memory and generates an interrupt (S820). Then, the monitoring module 230 intercepts the interrupt and transmits the address information of the memory write event to the security solution so that appropriate measures can be taken.

본 발명은 또한 컴퓨터로 읽을 수 있는 기록매체에 컴퓨터가 읽을 수 있는 코드로서 구현하는 것이 가능하다. 컴퓨터가 읽을 수 있는 기록매체는 컴퓨터 시스템에 의하여 읽혀질 수 있는 데이터가 저장되는 모든 종류의 기록장치를 포함한다. 컴퓨터가 읽을 수 있는 기록매체의 예로는 ROM, RAM, CD-ROM, 자기 테이프, 플로피디스크, 광데이터 저장장치 등이 있다. 또한 컴퓨터가 읽을 수 있는 기록매체는 네트워크로 연결된 컴퓨터 시스템에 분산되어 분산방식으로 컴퓨터가 읽을 수 있는 코드가 저장되고 실행될 수 있다.The present invention can also be implemented as a computer-readable code on a computer-readable recording medium. The computer-readable recording medium includes all types of recording devices that store data that can be read by a computer system. Examples of computer-readable recording media include ROM, RAM, CD-ROM, magnetic tapes, floppy disks, and optical data storage devices. In addition, the computer-readable recording medium can be distributed over a computer system connected through a network to store and execute computer-readable codes in a distributed manner.

이제까지 본 발명에 대하여 그 바람직한 실시예들을 중심으로 살펴보았다. 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자는 본 발명이 본 발명의 본질적인 특성에서 벗어나지 않는 범위에서 변형된 형태로 구현될 수 있음을 이해할 수 있을 것이다. 그러므로 개시된 실시예들은 한정적인 관점이 아니라 설명적인 관점에서 고려되어야 한다. 본 발명의 범위는 전술한 설명이 아니라 특허청구범위에 나타나 있으며, 그와 동등한 범위 내에 있는 모든 차이점은 본 발명에 포함된 것으로 해석되어야 할 것이다.So far, the present invention has been looked at around its preferred embodiments. Those of ordinary skill in the art to which the present invention pertains will be able to understand that the present invention can be implemented in a modified form without departing from the essential characteristics of the present invention. Therefore, the disclosed embodiments should be considered from an illustrative point of view rather than a limiting point of view. The scope of the present invention is shown in the claims rather than the above description, and all differences within the scope equivalent thereto should be construed as being included in the present invention.

Claims (13)

사용자 애플리케이션 및 커널의 접근이 불가능하고 하이퍼바이저가 접근 가능한 메모리의 보안영역에 상주한 감시모듈을 이용하여 커널을 보호하는 방법에 있어서,
상기 감시모듈은 커널로부터 호출함수를 통해 페이지 테이블의 갱신 요청을 수신하면, 상기 갱신 요청을 검증하고 상기 페이지 테이블을 갱신하는 단계; 및
상기 감시모듈은 상기 페이지 테이블을 가리키는 시스템 컨트롤 레지스터가 갱신될 때 하이퍼바이저 모드의 명령어 트랩 기능을 이용하여 상기 갱신을 모니터링하는 단계;
상기 감시모듈은 커널로부터 메모리 내 감시영역 정보를 수신하는 단계;
상기 감시모듈은 일정 크기 단위로 분할된 메모리의 각 영역을 나타내는 비트맵을 이용하여 상기 감시영역을 표시하는 단계;
메모리버스감시장치는 커널 메모리 영역에 대한 메모리 쓰기 이벤트가 발생하면 상기 비트맵을 이용하여 쓰기 이벤트가 발생한 영역이 상기 감시영역인지 파악하고, 상기 쓰기 이벤트가 발생한 영역이 상기 감시영역이면 상기 쓰기 이벤트의 정보를 상기 보안영역의 버퍼에 저장한 후 상기 감시모듈에 알리는 단계; 및
상기 감시모듈은 상기 버퍼에 저장된 상기 쓰기 이벤트의 정보를 페치하여 상기 보안영역에 상주하는 보안솔루션에게 제공하는 단계;를 포함하고,
상기 커널에서 커널 페이지를 갱신하는 커널 코드는 상기 감시모듈을 호출하는 상기 호출함수로 변경되고, 상기 비트맵은 상기 보안영역에 위치하는 것을 특징으로 하는 커널 보호 방법.
In a method of protecting the kernel by using a monitoring module residing in a secure area of memory that is inaccessible to a user application and kernel and accessible to a hypervisor,
The monitoring module, upon receiving a request to update a page table from a kernel through a call function, verifying the update request and updating the page table; And
The monitoring module monitoring the update using a command trap function of a hypervisor mode when a system control register indicating the page table is updated;
The monitoring module receiving information about the monitoring area in the memory from the kernel;
The monitoring module displaying the monitoring area using a bitmap representing each area of the memory divided by a predetermined size unit;
When a memory write event for the kernel memory area occurs, the memory bus monitor determines whether the area where the write event has occurred is the monitoring area using the bitmap. If the area where the write event occurs is the monitoring area, the write event Storing information in the buffer of the security area and notifying the monitoring module; And
Including, the monitoring module fetches the information on the write event stored in the buffer and provides it to a security solution residing in the security area; and
A kernel code for updating a kernel page in the kernel is changed to the calling function that calls the monitoring module, and the bitmap is located in the security area.
삭제delete 삭제delete 제 1항에 있어서, 상기 감시모듈에 알리는 단계는,
상기 메모리버스감시장치는 시스템 버스를 통해 메모리 쓰기 이벤트를 모니터링하는 단계;
상기 메모리버스감시장치는 일정 크기 단위로 분할된 메모리의 각 영역과 맵핑되는 비트를 이용하여 감시영역을 표시하는 비트맵을 기초로, 감시영역에 대한 쓰기 이벤트가 발생하였는지 파악하는 단계; 및
상기 메모리버스감시장치는 감시영역에 대한 쓰기 이벤트가 발생하면, 쓰기 이벤트의 메모리 주소를 상기 메모리의 보안영역에 저장하고, 인터럽트를 발생하는 단계;를 포함하는 것을 특징으로 하는 커널 보호 방법.
The method of claim 1, wherein the step of notifying the monitoring module,
The memory bus monitor monitoring a memory write event through a system bus;
Determining whether a write event for the monitoring area has occurred, based on a bitmap displaying the monitoring area using bits mapped to each area of the memory divided by a predetermined size unit; And
And generating an interrupt by storing the memory address of the write event in the secure area of the memory when the write event for the monitoring area occurs, and the memory bus monitoring value.
제 4항에 있어서, 상기 쓰기 이벤트가 발생하였는지 파악하는 단계는,
쓰기 이벤트의 메모리 주소에 해당하는 비트맵 주소를 계산하는 단계; 및
상기 비트맵 주소에 해당하는 상기 비트맵의 비트가 감시영역으로 설정되었는지 파악하는 단계;를 포함하는 것을 특징으로 하는 커널 보호 방법.
The method of claim 4, wherein the step of determining whether the write event has occurred,
Calculating a bitmap address corresponding to the memory address of the write event; And
And determining whether a bit of the bitmap corresponding to the bitmap address is set as a surveillance region.
제 5항에 있어서,
상기 메모리의 보안영역에 위치한 비트맵을 읽어 자체 캐시에 저장하는 단계; 및
상기 비트맵에 대한 쓰기 이벤트가 발생하면, 상기 캐시를 갱신하는 단계;를 더 포함하는 것을 특징으로 하는 커널 보호 방법.
The method of claim 5,
Reading a bitmap located in the secure area of the memory and storing it in its own cache; And
And when a write event for the bitmap occurs, updating the cache.
삭제delete 삭제delete 삭제delete 사용자 애플리케이션과 커널의 접근이 불가능하고 하이퍼바이저가 접근 가능한 보안영역을 포함하는 메모리; 및
시스템 버스를 감시하여 상기 메모리 내 감시영역에 대한 쓰기 이벤트를 파악하는 메모리버스감시장치;를 포함하고,
감시모듈은 커널로부터 호출함수를 통해 페이지 테이블의 갱신 요청을 수신하면, 상기 갱신 요청을 검증하고 상기 페이지 테이블을 갱신하고, 상기 페이지 테이블을 가리키는 시스템 컨트롤 레지스터가 갱신될 때 하이퍼바이저 모드의 명령어 트랩 기능을 이용하여 상기 갱신을 모니터링하고,
상기 감시모듈은 커널로부터 메모리 내 감시영역 정보를 수신하면, 일정 크기 단위로 분할된 메모리의 각 영역을 나타내는 비트맵을 이용하여 상기 감시영역을 표시하고,
상기 메모리버스감시장치는 커널 메모리 영역에 대한 메모리 쓰기 이벤트가 발생하면 상기 비트맵을 이용하여 쓰기 이벤트가 발생한 영역이 상기 감시영역인지 파악하고, 상기 쓰기 이벤트가 발생한 영역이 상기 감시영역이면 상기 쓰기 이벤트의 정보를 상기 보안영역의 버퍼에 저장한 후 상기 감시모듈에 알리고,
상기 감시모듈은 상기 버퍼에 저장된 상기 쓰기 이벤트의 정보를 페치하여 상기 보안영역에 상주하는 보안솔루션에게 제공하고,
상기 커널에서 커널 페이지를 갱신하는 커널 코드는 상기 감시모듈을 호출하는 상기 호출함수로 변경되고, 상기 비트맵은 상기 보안영역에 위치하는 것을 특징으로 하는 커널 보호가 가능한 시스템.
A memory including a security area in which the user application and the kernel are inaccessible and accessible to the hypervisor; And
Including; a memory bus monitoring device for monitoring the system bus to determine a write event for the monitoring area in the memory,
When the monitoring module receives a page table update request from the kernel through a call function, it verifies the update request and updates the page table, and when the system control register pointing to the page table is updated, a command trap function in hypervisor mode To monitor the update,
When the monitoring module receives the monitoring area information in the memory from the kernel, the monitoring area is displayed using a bitmap representing each area of the memory divided by a predetermined size unit,
When a memory write event for the kernel memory area occurs, the memory bus monitor determines whether the area where the write event occurs is the monitoring area using the bitmap, and if the area where the write event occurs is the monitoring area, the write event Information is stored in the buffer of the security area and then notified to the monitoring module,
The monitoring module fetches the information of the write event stored in the buffer and provides it to a security solution residing in the security area,
The kernel code for updating a kernel page in the kernel is changed to the calling function that calls the monitoring module, and the bitmap is located in the security area.
삭제delete 삭제delete 제 1항에 기재된 방법을 수행하기 위한 프로그램 코드를 기록한 컴퓨터로 읽을 수 있는 기록매체.
A computer-readable recording medium on which a program code for performing the method according to claim 1 is recorded.
KR1020180153016A 2018-11-30 2018-11-30 Method and apparatus for protecting kernel without nested paging KR102183648B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020180153016A KR102183648B1 (en) 2018-11-30 2018-11-30 Method and apparatus for protecting kernel without nested paging

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020180153016A KR102183648B1 (en) 2018-11-30 2018-11-30 Method and apparatus for protecting kernel without nested paging

Publications (2)

Publication Number Publication Date
KR20200066011A KR20200066011A (en) 2020-06-09
KR102183648B1 true KR102183648B1 (en) 2020-11-26

Family

ID=71082931

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020180153016A KR102183648B1 (en) 2018-11-30 2018-11-30 Method and apparatus for protecting kernel without nested paging

Country Status (1)

Country Link
KR (1) KR102183648B1 (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018167455A1 (en) * 2017-03-16 2018-09-20 Arm Limited Memory access monitoring

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101396831B1 (en) * 2007-03-30 2014-05-21 삼성전자주식회사 Method of Controlling Memory Access
KR102494167B1 (en) * 2015-11-25 2023-02-01 삼성전자주식회사 A Electronic Device And Method For Protecting The Kernel Space of the Memory
KR101883637B1 (en) * 2017-01-03 2018-07-31 한양대학교 산학협력단 Method and appartus for managing cache mapping table

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018167455A1 (en) * 2017-03-16 2018-09-20 Arm Limited Memory access monitoring

Also Published As

Publication number Publication date
KR20200066011A (en) 2020-06-09

Similar Documents

Publication Publication Date Title
EP3201820B1 (en) Protecting application secrets from operating system attacks
CN109002706B (en) In-process data isolation protection method and system based on user-level page table
US11443034B2 (en) Trust zone-based operating system and method
US8209510B1 (en) Secure pool memory management
US9059855B2 (en) System and method for implementing a trusted dynamic launch and trusted platform module (TPM) using secure enclaves
EP3726390B1 (en) Method and device for protecting kernel integrity
US8190914B2 (en) Method and system for designating and handling confidential memory allocations
JPH04247528A (en) Common access device and method into data space
CN105393255A (en) Process evaluation for malware detection in virtual machines
KR102105760B1 (en) Heterogeneous isolated execution for commodity gpus
JP2018538630A (en) Protection key management and prefix translation in a virtual address space legacy emulation system
US20180267880A1 (en) Breakpoint insertion into kernel pages
US8490207B2 (en) Performing zero-copy sends in a networked file system with cryptographic signing
KR20170060815A (en) A Electronic Device And Method For Protecting The Kernel Space of the Memory
KR20190060109A (en) Instruction-level data isolation method and apparatus
KR102183648B1 (en) Method and apparatus for protecting kernel without nested paging
US11301282B2 (en) Information protection method and apparatus
US11200175B2 (en) Memory accessor invailidation
US20230098991A1 (en) Systems, methods, and media for protecting applications from untrusted operating systems
CN117494108A (en) Trusted execution environment implementation method, computer equipment and storage medium
US20090037668A1 (en) Protected portion of partition memory for computer code
WO2019148447A1 (en) Data protection method and data protection device
TW202338618A (en) Method for enhancing memory protection and computing system
CN117708832A (en) Method and system for realizing high-performance heterogeneous trusted execution environment
CN116579030A (en) Memory optimization method for expanding security resources on Internet of things equipment

Legal Events

Date Code Title Description
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right