[go: up one dir, main page]

KR102817178B1 - Method and Apparatus for protecting caches from side-channel attacks - Google Patents

Method and Apparatus for protecting caches from side-channel attacks Download PDF

Info

Publication number
KR102817178B1
KR102817178B1 KR1020200010037A KR20200010037A KR102817178B1 KR 102817178 B1 KR102817178 B1 KR 102817178B1 KR 1020200010037 A KR1020200010037 A KR 1020200010037A KR 20200010037 A KR20200010037 A KR 20200010037A KR 102817178 B1 KR102817178 B1 KR 102817178B1
Authority
KR
South Korea
Prior art keywords
cache
shared
attack
block
application
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
KR1020200010037A
Other languages
Korean (ko)
Other versions
KR20210096500A (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 KR1020200010037A priority Critical patent/KR102817178B1/en
Publication of KR20210096500A publication Critical patent/KR20210096500A/en
Application granted granted Critical
Publication of KR102817178B1 publication Critical patent/KR102817178B1/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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/55Detecting local intrusion or implementing counter-measures
    • G06F21/56Computer malware detection or handling, e.g. anti-virus arrangements
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0806Multiuser, multiprocessor or multiprocessing cache systems
    • G06F12/084Multiuser, multiprocessor or multiprocessing cache systems with a shared cache
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2207/00Indexing scheme relating to methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F2207/72Indexing scheme relating to groups G06F7/72 - G06F7/729
    • G06F2207/7219Countermeasures against side channel or fault attacks

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Virology (AREA)
  • Memory System Of A Hierarchy Structure (AREA)
  • Storage Device Security (AREA)

Abstract

본 발명의 바람직한 일 실시예로서, 캐시기반 부채널공격을 방어하는 장치는 공유 DRAM L4캐시를 추가하고, L1, L2 및 L4 캐시에 바이패스 비트를 추가하여 플러시재적재 공격의 대상이 되는 캐시 블록에 대해 LLC 우회 정책을 적용하여 공유캐시를 대상으로 한 공격을 무력화 한다. As a preferred embodiment of the present invention, a device for defending against cache-based side-channel attacks adds a shared DRAM L4 cache and adds bypass bits to L1, L2, and L4 caches to apply an LLC bypass policy to cache blocks that are targets of flush-reload attacks, thereby neutralizing attacks targeting the shared cache.

Description

캐시기반 부채널공격 방어 장치 및 방법{Method and Apparatus for protecting caches from side-channel attacks}{Method and Apparatus for protecting caches from side-channel attacks}

본 발명은 캐시기반 부채널공격 방어에 관한 것이다.The present invention relates to cache-based side-channel attack defense.

오늘날의 프로세서는 종종 대용량 메모리에 저장된 데이터 및 명령어의 사본을 저장할 수있는 캐시를 갖추고 있다. 이러한 대용량 메모리의 보편적 인 예는 다이나믹 랜덤 액세스 메모리 (DRAM)이다. 여기서, "메모리"라는 용어는 모든 기존 및 미래의 메모리 구현을 집합적으로 지칭하는데 사용된다. 캐시 메모리(간략하게 "캐시")는 다른 메모리 구현보다 훨씬 작고 훨씬 빠른 메모리로 만들어지며 이후에는 주 메모리 또는 보조 저장 장치에 저장된 데이터의 일부만을 특정 시점에 저장할 수 있다. 오늘날 캐시는 종종 SRAM을 사용하여 구현되며 대용량 캐시는 DRAM을 사용하여 구현 될 수 있다. 여기에 설명 된 캐시는 임의의 기존 및 미래의 메모리 기술을 사용하여 구현 될 수 있다. 프로세서의 아키텍쳐적 정의는 보안 공격으로부터 안전하도록 향상된 보고 기능을 제공하는 것이 포함될 수 있으나, 캐시 구현과 같은 많은 종속된 기능들(예를 들어, 마이크로 아키텍쳐)에는 보호 기능이 포함되지 않아 공격으로부터 취약할 수 있다.Modern processors often have caches that can store copies of data and instructions stored in large memory. A common example of such large memory is dynamic random access memory (DRAM). Here, the term "memory" is used collectively to refer to all existing and future memory implementations. Cache memory (or simply "cache") is a memory that is much smaller and much faster than other memory implementations and can store only a portion of the data that would otherwise be stored in main memory or secondary storage at any given time. Today, caches are often implemented using SRAM, although large caches can be implemented using DRAM. The caches described herein can be implemented using any existing or future memory technology. While the architectural definition of a processor may include providing enhanced reporting capabilities to protect against security attacks, many dependent functions (e.g., microarchitecture) such as cache implementations may not include protections and thus may be vulnerable to attacks.

[1] Liu, Fangfei, et al. "Catalyst: Defeating last-level cache side channel attacks in cloud computing." 2016 IEEE international symposium on high performance computer architecture (HPCA). IEEE, 2016.[1] Liu, Fangfei, et al. “Catalyst: Defeating last-level cache side channel attacks in cloud computing.” 2016 IEEE international symposium on high performance computer architecture (HPCA). IEEE, 2016. [2] Kayaalp, Mehmet, et al. "RIC: relaxed inclusion caches for mitigating LLC side-channel attacks." 2017 54th ACM/EDAC/IEEE Design Automation Conference (DAC). IEEE, 2017.[2] Kayaalp, Mehmet, et al. “RIC: relaxed inclusion caches for mitigating LLC side-channel attacks.” 2017 54th ACM/EDAC/IEEE Design Automation Conference (DAC). IEEE, 2017. [3] Liu, Fangfei, and Ruby B. Lee. "Random fill cache architecture." Proceedings of the 47th Annual IEEE/ACM International Symposium on Microarchitecture. IEEE Computer Society, 2014.[3] Liu, Fangfei, and Ruby B. Lee. “Random fill cache architecture.” Proceedings of the 47th Annual IEEE/ACM International Symposium on Microarchitecture. IEEE Computer Society, 2014.

본 발명의 바람직한 일 실시예에서는 캐시기반 부채널공격의 대상이 될 수 있는 모든 피공격자 어플리케이션에서 이를 방어할 수 있는 방법을 제안하고자 한다. In a preferred embodiment of the present invention, we propose a method for defending against cache-based side-channel attacks in all attacker applications.

본 발명의 바람직한 일 실시예에서는 캐시기반 부채널공격의 대상이 될 수 있는 캐시 블록이 최종레벨캐시(LLC)에 들어가지 못하도록 변형하여 캐시기반 부채널공격을 방어할 수 있는 방법을 제안하고자 한다. In a preferred embodiment of the present invention, a method for defending against cache-based side-channel attacks is proposed by modifying a cache block that may be a target of a cache-based side-channel attack so that it cannot enter a final level cache (LLC).

본 발명의 바람직한 일 실시예에서는 clflush 명령어로 DRAM 캐시 내의 캐시블록을 축출할 수 없도록 제한함으로써 모든 프로세스가 해당 캐시블록에 접근할 때 DRAM캐시에 접근하는 시간을 경험하도록 변형함으로써 캐시기반 부채널공격을 방어할 수 있는 방법을 제안하고자 한다. In a preferred embodiment of the present invention, a method is proposed to defend against cache-based side-channel attacks by modifying the DRAM cache so that all processes experience the time it takes to access the DRAM cache when accessing the cache block by restricting the eviction of cache blocks in the DRAM cache using the clflush command.

본 발명의 바람직한 일 실시예에서는 데이터의 쓰기 가능 여부 및 공유 여부 등과 상관없이 캐시기반 부채널공격을 방어할 수 있는 방법을 제안하고자 한다. In a preferred embodiment of the present invention, a method is proposed to defend against cache-based side-channel attacks regardless of whether data is writable or shared.

본 발명의 바람직한 일 실시예로서, 캐시기반 부채널공격을 방어하는 장치는 또한 공유DRAM 캐시;를 더 포함하도록 메모리 계층구조가 구현되며, 이 경우 상기 공유DRAM 캐시의 각 캐시블록은 바이패스 비트를 포함하여, 공격자 어플리케이션이 피공격자 어플리케이션에 대한 부채널공격여부를 표시하고, 상기 피공격자 어플리케이션은 상기 공유DRAM 캐시에서 적어도 하나의 캐시 블록을 로드할 때, 상기 적어도 하나의 캐시 블록 내의 상기 바이패스 비트 각각을 확인하며,상기 공격자 어플리케이션은 플러시-재적재 공격을 수행한 후 재적재를 수행할 때 플러시-재적재 공격을 수행한 적어도 하나의 캐시 블록들이 모두 상기 공유DRAM캐시에 적재되어 있어, 상기 공격자 어플리케이션에서 플러시-재적재 공격을 수행한 적어도 하나의 캐시 블록에 대한 접근 시간이 상기 피공격자 어플리케이션의 접근 여부와 무관하게 동일한 것을 특징으로 한다.As a preferred embodiment of the present invention, a device for defending against a cache-based side-channel attack further includes a shared DRAM cache; wherein the memory hierarchy is implemented to further include a bypass bit, in which case each cache block of the shared DRAM cache includes a bypass bit to indicate whether an attacker application performs a side-channel attack on a victim application; and when the victim application loads at least one cache block from the shared DRAM cache, each of the bypass bits in the at least one cache block is checked; and when the attacker application performs a flush-reload attack and then performs a reload, all of the cache blocks on which the flush-reload attack was performed are loaded into the shared DRAM cache, so that an access time for at least one cache block on which the flush-reload attack was performed by the attacker application is the same regardless of whether the victim application accesses it.

본 발명의 바람직한 일 실시예로서, 캐시기반 부채널공격을 방어하는 장치는 상기 공유DRAM 캐시에서 적어도 하나의 캐시 블록을 로드할 때 확인한 바이패스 비트 값이 1로서 부채널공격이 확인되는 캐시 블록의 경우 상기 공유 최종레벨캐시를 우회하여 상기 프라이빗 캐시로 로드하고, 바이패스 비트 값이 0으로서 부채널공격이 확인되지 않는 캐시 블록의 경우 상기 공유 최종레벨캐시로 로드하는 것을 특징으로 한다. 이 경우, 프라이빗 캐시는 L1 캐시 또는 L2 캐시이며, 부채널공격이 확인되는 캐시 블록을 로드할 때 바이패스 비트값을 0에서 1로 변경하는 것을 특징으로 한다.As a preferred embodiment of the present invention, a device for defending against a cache-based side-channel attack is characterized in that, when loading at least one cache block from the shared DRAM cache, if the cache block is confirmed to have a bypass bit value of 1 and a side-channel attack is confirmed, the cache block is loaded into the private cache by bypassing the shared final level cache, and if the cache block is not confirmed to have a bypass bit value of 0 and a side-channel attack is not confirmed, the cache block is loaded into the shared final level cache. In this case, the private cache is an L1 cache or an L2 cache, and the device is characterized in that the bypass bit value is changed from 0 to 1 when loading a cache block confirmed to have a side-channel attack.

본 발명의 바람직한 일 실시예로서, 캐시기반 부채널공격을 방어하는 장치는 프라이빗 캐시;및 SRAM 기반의 공유 최종레벨캐시(Last-Level Cache, LLC);를 포함하고, 또한 공유DRAM 캐시;를 더 포함하도록 메모리 계층구조를 구현하며, 상기 프라이빗 캐시 및 상기 공유DRAM 캐시는 바이패스 비트를 포함하고 상기 바이패스 비트값을 이용하여 공격자 어플리케이션이 피공격자 어플리케이션에 대한 부채널공격여부를 판단하며, 상기 공격자 어플리케이션은 플러시-재적재 공격을 수행한 후 재적재를 수행할 때 플러시-재적재 공격을 수행한 적어도 하나의 캐시 블록들이 모두 상기 공유DRAM캐시에 적재되어 있어, 상기 공격자 어플리케이션에서 플러시-재적재 공격을 수행한 적어도 하나의 캐시 블록에 대한 접근 시간이 상기 피공격자 어플리케이션의 접근 여부와 무관하게 동일하여 피공격자 어플리케이션의 접근 패턴 및 실행패턴을 판단할 수 없는 것을 특징으로 한다. 이 경우, 공격자 어플리케이션은 상기 플러시-재적재 공격을 clflush 명령을 이용하여 수행하고, clflush 명령이 실행되면 상기 프라이빗 캐시 및 상기 공유 최종레벨캐시에 있는 캐시 블락은 축출될 수 있으나, 상기 공유DRAM 캐시에 있는 캐시 블락은 축출되지 않고, clflush가 수행되었는지 여부만 바이패스비트를 이용하여 정보를 표시하는 것을 특징으로 한다.As a preferred embodiment of the present invention, a device for defending against a cache-based side-channel attack includes a private cache; and a SRAM-based shared last-level cache (LLC); and implements a memory hierarchy to further include a shared DRAM cache; wherein the private cache and the shared DRAM cache include a bypass bit and determine whether an attacker application performs a side-channel attack on a victim application using the bypass bit value, and when the attacker application performs a flush-reload attack and then performs a reload, at least one of the cache blocks on which the flush-reload attack was performed are all loaded into the shared DRAM cache, so that an access time for at least one cache block on which the flush-reload attack was performed by the attacker application is the same regardless of whether the attacker application accesses it, making it impossible to determine an access pattern and an execution pattern of the victim application. In this case, the attacker application performs the flush-reload attack using the clflush command, and when the clflush command is executed, the cache blocks in the private cache and the shared final level cache can be evicted, but the cache blocks in the shared DRAM cache are not evicted, and only information on whether clflush has been performed is displayed using the bypass bit.

본 발명의 또 다른 바람직한 일 실시예로서, 캐시기반 부채널공격을 방어하는 방법은 프라이빗 캐시, SRAM 기반의 공유 최종레벨캐시 및 공유DRAM 캐시를 포함하는 메모리 계층구조를 이용하는 단계; 상기 공유DRAM 캐시의 캐시 블락에 포함된 바이패스 비트를 이용하여 공격자 어플리케이션에서 피공격자 어플리케이션에 플러시-재적재 공격을 수행하였는지 여부를 표시하는 단계; 상기 피공격자 어플리케이션에서 상기 공유DRAM 캐시로부터 적어도 하나의 캐시 블록을 로드할 때, 상기 적어도 하나의 캐시 블록 내의 상기 바이패스 비트를 각각 확인하는 단계; 및 상기 바이패스 비트를 확인한 결과 플러시-재적재 공격이 수행된 캐시 블록은 상기 SRAM 기반의 공유 최종레벨캐*를 우회하여 상기 피공격자 어플리케이션 코어의 프라이빗 캐시에 로드하고, 플러시-재적재 공격이 검출되지 않는 캐시 블록은 상기 SRAM 기반의 공유 최종레벨캐시로 로드하는 단계;를 포함하는 것을 특징으로 한다. In another preferred embodiment of the present invention, a method for defending against a cache-based side-channel attack is characterized by comprising: a step of using a memory hierarchy including a private cache, an SRAM-based shared final-level cache, and a shared DRAM cache; a step of indicating whether an attacker application has performed a flush-reload attack on a victim application by using a bypass bit included in a cache block of the shared DRAM cache; a step of checking each of the bypass bits in the at least one cache block when the victim application loads at least one cache block from the shared DRAM cache; and a step of loading a cache block on which a flush-reload attack has been performed by bypassing the SRAM-based shared final-level cache as a result of checking the bypass bit into a private cache of the victim application core, and loading a cache block on which a flush-reload attack is not detected into the SRAM-based shared final-level cache.

본 발명의 바람직한 일 실시예로서, 상기 공격자 어플리케이션은 clflush 명령어를 이용하여 상기 플러시 공격을 실행할 수 있으며, 이 경우 상기 피공격자 어플리케이션의 상기 프라이빗 캐시, 상기 SRAM 기반의 공유 최종레벨 캐시에 있는 블락은 축출되나, 상기 공유DRAM캐시에 있는 블락은 축출되지 않고, 상기 공유 DRAM캐시에 있는 캐시 블락 내의 바이패스 비트를 이용하여 상기 플러시-재적재 공격이 실행여부에 대한 정보를 제공하는 것을 특징으로 한다. As a preferred embodiment of the present invention, the attacker application can execute the flush attack using the clflush command, in which case, blocks in the private cache of the attacker application, the SRAM-based shared final level cache, are evicted, but blocks in the shared DRAM cache are not evicted, and information on whether the flush-reload attack is executed is provided using a bypass bit in a cache block in the shared DRAM cache.

본 발명의 바람직한 일 실시예로서, 공유 DRAM캐시에 있는 캐시 블락 내의 바이패스 비트의 값이 "1"인 경우 플러시-재적재 공격이 실행되었음을 나타내고, 이 경우 상기 프라이빗 캐시는 상기 바이패스 비트의 값이 "1"인 상기 공유 DRAM캐시에 있는 캐시 블락을 로드하면서 상기 프라이빗 캐시 내의 바이패스 비트값도 "1"로 표시하는 것을 특징으로 한다. As a preferred embodiment of the present invention, when the value of a bypass bit in a cache block in a shared DRAM cache is "1", it indicates that a flush-reload attack has been executed, and in this case, the private cache is characterized in that the value of the bypass bit in the private cache is also displayed as "1" while loading a cache block in the shared DRAM cache having the value of the bypass bit as "1".

본 발명의 바람직한 일 실시예로서, 상기 공격자 어플리케이션은 플러시-재적재 공격을 수행한 후 재적재를 수행할 때 플러시-재적재 공격을 수행한 적어도 하나의 캐시 블록들이 모두 상기 공유DRAM캐시에 적재되어 있어, 상기 공격자 어플리케이션에서 플러시-재적재 공격을 수행한 적어도 하나의 캐시 블록에 대한 접근 시간이 상기 피공격자 어플리케이션의 접근 여부와 무관하게 동일하여 피공격자 어플리케이션의 접근 패턴 및 실행패턴을 판단할 수 없는 것을 특징으로 한다.As a preferred embodiment of the present invention, the attacker application is characterized in that when performing a flush-reload attack and then performing a reload, at least one cache block on which the flush-reload attack was performed is loaded into the shared DRAM cache, so that an access time for at least one cache block on which the flush-reload attack was performed by the attacker application is the same regardless of whether the victim application accesses it, making it impossible to determine an access pattern and an execution pattern of the victim application.

본 발명의 바람직한 일 실시예에서는 별도의 소프트웨어의 변형없이, 하드웨어만의 변형을 통해 캐시기반 부채널공격의 대상이 될 수 있는 모든 피공격자 어플리케이션에서 이를 방어하는 효과가 있다. In a preferred embodiment of the present invention, there is an effect of defending against all victim applications that may be subject to cache-based side-channel attacks through modification of only hardware, without modification of separate software.

본 발명의 바람직한 일 실시예에서는 캐시기반 부채널공격의 대상이 될 수 있는 캐시 블록이 최종레벨캐시(LLC)에 들어가지 못하도록 변형하여 캐시기반 부채널공격을 방어하는 효과가 있다. In a preferred embodiment of the present invention, there is an effect of defending against cache-based side-channel attacks by modifying cache blocks that may be targets of cache-based side-channel attacks so that they cannot enter the final level cache (LLC).

본 발명의 바람직한 일 실시예에서는 clflush 명령어로 DRAM 캐시 내의 캐시블록을 축출할 수 없도록 제한함으로써 모든 프로세스가 해당 캐시블록에 접근할 때 DRAM캐시에 접근하는 시간을 경험하도록 변형함으로써 캐시기반 부채널공격을 방어할 수 있는 효과가 있다. In a preferred embodiment of the present invention, by restricting the eviction of cache blocks within the DRAM cache by the clflush command, it is possible to defend against cache-based side-channel attacks by modifying the method so that all processes experience the time required to access the DRAM cache when accessing the corresponding cache block.

본 발명의 바람직한 일 실시예에서는 데이터의 쓰기 가능 여부 및 공유 여부 등과 상관없이 캐시기반 부채널공격을 방어할 수 있는 효과가 있다. In a preferred embodiment of the present invention, there is an effect of being able to defend against cache-based side-channel attacks regardless of whether data is writable or shared.

도 1 내지 3은 본 발명의 바람직한 일 실시예로서, 캐시기반 부채널공격을 방어하는 장치에서 플로시재적재 공격을 무력화하는 방법을 도시한다.
도 4 는 본 발명의 바람직한 일 실시예로서, 캐시기반 부채널공격을 방어하는 방법의 흐름도를 도시한다.
FIGS. 1 to 3 illustrate a method for neutralizing a flash reload attack in a device defending against a cache-based side-channel attack, as a preferred embodiment of the present invention.
FIG. 4 is a flowchart illustrating a method for defending against a cache-based side-channel attack, as a preferred embodiment of the present invention.

본 발명은 다양한 변경을 가할 수 있고 여러 가지 실시예를 가질 수 있는 바, 특정 실시예들을 도면에 예시하고, 이를 상세한 설명을 통해 상세히 설명하고자 한다. 그러나, 이는 본 발명을 특정한 실시 형태에 대해 한정하려는 것이 아니며, 본 발명은 본 발명의 사상 및 기술 범위에 포함되는 모든 변경, 균등물 내지 대체물을 포함하는 것으로 이해되어야 한다.The present invention can have various modifications and various embodiments, and specific embodiments are illustrated in the drawings and described in detail through the detailed description. However, this is not intended to limit the present invention to specific embodiments, and it should be understood that the present invention includes all modifications, equivalents, and substitutes included in the spirit and technical scope of the present invention.

컴퓨터 시스템의 메모리 시스템은 메인 메모리에 가까우며, 용량이 크고 느린 캐시 및 프로세서에 가까우며, 용량이 작고 빠른 캐시를 포함할 수 있다. 이러한 캐시의 구성은 일반적으로 캐시 계층, 메모리 계층 또는 메모리 시스템이라고 지칭할 수 있다. 캐시 계층의 각 레벨은 캐시 레벨로 지칭할 수 있다. The memory system of a computer system may include a large, slow cache close to the main memory and a small, fast cache close to the processor. The organization of these caches can be generally referred to as a cache hierarchy, a memory hierarchy, or a memory system. Each level of the cache hierarchy can be referred to as a cache level.

캐시 시스템을 설계할 때, 부채널 공격(side-channel attack)과 같은 보안 공격에 대한 취약점을 회피하는 것이 중요할 수 있다. 부채널 공격의 일 형태인 플러시재적재(Flush+Reload) 공격은 공격자가 피공격자의 명령어 실행 패턴을 알아내어 피공격자의 비밀 암호 키 등을 무단으로 가져오는 공격이다. When designing a cache system, it can be important to avoid vulnerabilities to security attacks such as side-channel attacks. A type of side-channel attack, the flush+reload attack, is an attack in which the attacker learns the victim's command execution pattern and obtains the victim's secret encryption key without authorization.

이러한 플러시재적재 공격을 방어하기 위한 기술의 예로, Liu, Fangfei, et al. "Catalyst: Defeating last-level cache side channel attacks in cloud computing." 2016 IEEE international symposium on high performance computer architecture (HPCA). IEEE, 2016 가 있다. 이 방법에서는 Intel CPU의 기능 중 하나인 CAT를 사용하여 안전하게 보호해야되는 데이터를 캐시 파티셔닝을 통해 물리적으로 격리하는 방법을 사용하여 플러시재적재 공격을 무력화 시키는 방법을 사용하고 있다. 그러나, 이 방법의 경우에는 CAT를 지원하는 일부 프로세서에서만 지원되는 단점이 있다. An example of a technique to defend against such flush-reload attacks is Liu, Fangfei, et al. "Catalyst: Defeating last-level cache side channel attacks in cloud computing." 2016 IEEE international symposium on high performance computer architecture (HPCA). IEEE, 2016. This method uses CAT, a feature of Intel CPUs, to physically isolate data that needs to be safely protected through cache partitioning, thereby neutralizing flush-reload attacks. However, this method has a disadvantage in that it is only supported by some processors that support CAT.

또 다른 기술로 Kayaalp, Mehmet, et al. "RIC: relaxed inclusion caches for mitigating LLC side-channel attacks." 2017 54th ACM/EDAC/IEEE Design Automation Conference (DAC). IEEE, 2017 에서는 읽기 전용 데이터가 LLC에 저장되지 않도록 캐시 정책을 변경함으로써 플러시재적재의 주 공격 대상이 되는 캐시블록들에 공격자 어플리케이션이 접근하는 경우, 피공격자 어플리케이션의 접근 여부와 무관하게 항상 긴 메모리 접근 시간을 겪도록 하는 방법을 이용하고 있다. 이 방법의 경우에는 데이터를 읽기 전용 데이터로 한정하고 있는 단점이 있다. Another technique, Kayaalp, Mehmet, et al. "RIC: relaxed inclusion caches for mitigating LLC side-channel attacks." 2017 54th ACM/EDAC/IEEE Design Automation Conference (DAC). IEEE, 2017, uses a method that changes the cache policy so that read-only data is not stored in LLC, so that when an attacker application accesses cache blocks, which are the main targets of flush-reload attacks, it always experiences a long memory access time regardless of whether the attacker application accesses them. This method has a disadvantage in that it limits the data to read-only data.

본 발명의 일 실시예에서는 별도의 소프트웨어의 변형없이, 하드웨어만의 변형을 통해 가상머신 또는 프로세스를 지정해줄 필요도 없이, 캐시기반 부채널공격의 대상이 될 수 있는 모든 피공격자 어플리케이션에서 이를 방어하고자 한다. 또한 캐시기반 부채널공격의 대상이 될 수 있는 캐시 블록이 최종레벨캐시(LLC)에 들어가지 못하도록 변형하여 캐시기반 부채널공격을 방어하는 방법을 제안하고자 한다.In one embodiment of the present invention, we aim to defend against all victim applications that may be the target of a cache-based side-channel attack without modifying separate software or hardware, without having to designate a virtual machine or process. In addition, we propose a method for defending against a cache-based side-channel attack by modifying a cache block that may be the target of a cache-based side-channel attack so that it does not enter the final level cache (LLC).

도 1 내지 3은 본 발명의 바람직한 일 실시예로서, 캐시기반 부채널공격을 방어하는 장치에서 플로시재적재 공격을 무력화하는 방법을 도시한다. FIGS. 1 to 3 illustrate a method for neutralizing a flash reload attack in a device defending against a cache-based side-channel attack, as a preferred embodiment of the present invention.

본 발명의 바람직한 일 실시예에서 사용되는 clflush 명령어는 L1 내지 L3캐시에 있는 블락은 축출하되, 공유L4 캐시에 있는 블락은 축출하는 않고, clflush 가 되었는지 안되었는지 여부를 바이패스비트를 이용하여 정보를 남기는 명령어를 지칭한다. 바이패스비트가 "1"인 경우에는 clflush가 되었음을 나타내고, 바이패스비트가 "0"인 경우에는 clflush가 되지 않았음을 나타낸다.The clflush command used in a preferred embodiment of the present invention refers to a command that evicts blocks in the L1 to L3 caches, but does not evict blocks in the shared L4 cache, and leaves information on whether clflush has been performed or not using a bypass bit. When the bypass bit is "1", it indicates that clflush has been performed, and when the bypass bit is "0", it indicates that clflush has not been performed.

본 발명의 바람직한 일 실시예로서, 캐시기반 부채널공격을 방어하는 장치는 적어도 하나의 프라이빗 캐시(130), SRAM 기반의 공유캐시(140)를 포함하고,또한 공유DRAM 캐시(150)를 더 포함하도록 메모리 계층구조가 구현된다. 또한,공유DRAM 캐시(150)의 각 캐시블록은 바이패스 비트(151a)를 포함하여, 공격자 어플리케이션이 피공격자 어플리케이션에 대한 부채널공격여부를 표시한다. 바이패스비트가 "1"인 경우에는 부채널공격이 있었음을 나타내고, 바이패스비트가 "0"인 경우에는 부채널공격이 없음을 나타낸다. As a preferred embodiment of the present invention, a device for defending against a cache-based side-channel attack includes at least one private cache (130), an SRAM-based shared cache (140), and a memory hierarchy implemented to further include a shared DRAM cache (150). In addition, each cache block of the shared DRAM cache (150) includes a bypass bit (151a) to indicate whether an attacker application has performed a side-channel attack on a victim application. When the bypass bit is "1", it indicates that a side-channel attack has occurred, and when the bypass bit is "0", it indicates that there has been no side-channel attack.

본 발명의 바람직한 일 실시예로서, 프라이빗 캐시(130)는 L1 캐시 또는 L2 캐시, SRAM 기반의 공유캐시(140)는 L3 캐시, 그리고 공유DRAM 캐시(150)는 L4캐시로 구현될 수 있다. As a preferred embodiment of the present invention, the private cache (130) can be implemented as an L1 cache or an L2 cache, the SRAM-based shared cache (140) can be implemented as an L3 cache, and the shared DRAM cache (150) can be implemented as an L4 cache.

본 발명의 바람직한 일 실시예로서, 피공격자 어플리케이션은 공유DRAM 캐시에서 적어도 하나의 캐시 블록을 로드할 때 적어도 하나의 캐시 블록 내의 상기 바이패스 비트 각각을 확인한다. 그리고, 바이패스비트가 "1"인 경우에는 해당 캐시블록을 최종레벨캐시(140)를 우회하여 프라이빗 캐시(130)에 로드하고, 프라이빗 캐시의 바이패스비트(131b, 131c)를 "0"에서 "1"로 변경한다. 피공격자 어플리케이션은 바이패스비트가 "0"인 경우에는 해당 캐시블록을 최종레벨캐시(140)에 로드하도록 구현될 수 있다. As a preferred embodiment of the present invention, the victim application checks each of the bypass bits in at least one cache block when loading at least one cache block from the shared DRAM cache. Then, if the bypass bit is "1", the corresponding cache block is loaded into the private cache (130) by bypassing the final level cache (140) and changes the bypass bits (131b, 131c) of the private cache from "0" to "1". The victim application can be implemented to load the corresponding cache block into the final level cache (140) if the bypass bit is "0".

도 1 내지 3 을 참고하여, 본 발명의 바람직한 일 실시예로서 캐시기반 부채널공격을 방어하는 장치(100)가 플러시재적재 공격을 방어하는 방법을 기술한다. 본 발명의 바람직한 일 실시예로서, 도 1 은 공격자 어플리케이션에서 "clush"명령어를 통해 축출을 수행하는 과정을 나타내고, 도 2 는 "clflush"명령 이후 기다리는 과정을, 그리고 도 3 은 공격자 어플리케이션에서 재적재를 수행하는 과정을 나타낸다. Referring to FIGS. 1 to 3, a method for defending a cache-based side-channel attack by a device (100) defending against a flush reload attack as a preferred embodiment of the present invention is described. As a preferred embodiment of the present invention, FIG. 1 shows a process of performing an eviction through a "clush" command in an attacker application, FIG. 2 shows a process of waiting after a "clflush" command, and FIG. 3 shows a process of performing a reload in an attacker application.

도 1 을 참고하면, 공격자 어플리케이션(110)은 "Core 0"(111) 그리고 피공격자 어플리케이션(120)은 "Core 1"(121)에 있고, 공격자 어플리케이션(110)이 캐시블록 A 및 B에 대해 플러시재적재 공격을 수행하는 것을 가정한다. Referring to FIG. 1, it is assumed that the attacker application (110) is in “Core 0” (111) and the victim application (120) is in “Core 1” (121), and that the attacker application (110) performs a flush-reload attack on cache blocks A and B.

공격자 어플리케이션(110)은 "clflush" 명령어를 이용하여 캐시블록 A 및 B를 축출하고자 한다(S110). 이 경우, 캐시블록 A 및 B가 기적재된 공유DRAM캐시(150)에서는 캐시블록 A 및 B(151a) 내의 바이패스비트를 "0"에서 "1"로 설정한다. The attacker application (110) attempts to evict cache blocks A and B using the "clflush" command (S110). In this case, in the shared DRAM cache (150) in which cache blocks A and B are stored, the bypass bit in cache blocks A and B (151a) is set from "0" to "1".

도 2 를 참고하면, 피공격자 어플리케이션(120)은 공유DRAM캐시(150)에 있는 캐시블록을 로드할 때(S130) 해당 캐시블록 내의 바이패스 비트(151b)를 각각 확인한다. 확인한 결과 바이패스 비트(151b)가 "1"인 경우에는 clflush의 대상이 된 캐시 블록 A에 대해 최종레벨캐시 우회정책을 적용하여(S140) 플러시재적재 공격을 무력화 한다. 그리고, 캐시 블록 A를 피공격자 코어(121)의 프라이빗캐시에 로드하고, 프라이빗 캐시의 캐시블록A에 포함된 바이패스 비트를 "1"로 설정한다(S131c). 만일, 공유DRAM캐시(150)에 있는 캐시블록 A의 바이패스비트가 "0"인 경우에는, 캐시블록 A를 최종레벨캐시에 로드한다. Referring to FIG. 2, when the victim application (120) loads a cache block in the shared DRAM cache (150) (S130), it checks the bypass bit (151b) in each cache block. If the bypass bit (151b) is "1" as a result of the check, the final level cache bypass policy is applied to the cache block A that is the target of clflush (S140) to neutralize the flush reload attack. Then, the cache block A is loaded into the private cache of the victim core (121), and the bypass bit included in the cache block A of the private cache is set to "1" (S131c). If the bypass bit of the cache block A in the shared DRAM cache (150) is "0", the cache block A is loaded into the final level cache.

도 3은 공격자 어플리케이션에서 "clflush"명령 이후 일정 시간의 기다림 이후에 재적재를 위해, 공유DRAM캐시(150) 내의 캐시블록 A 및 B에 다시 접근하는 과정을 나타낸다. 공격자 어플리케이션(110)은 최종레벨캐시(140)에 캐시블록 A 및 B가 모두 존재하지 않으므로, 공유DRAM캐시(150)까지 접근해야 한다. 최종레벨캐시(140)가 L3캐시로, 공유DRAM캐시(150)가 L4캐시로 구현된 경우 공격자 어플리케이션(110)은 추가적인 접근시간이 요구된다. FIG. 3 shows a process of accessing cache blocks A and B in the shared DRAM cache (150) again for reloading after waiting for a certain period of time following the “clflush” command in the attacker application. Since cache blocks A and B do not exist in the final level cache (140), the attacker application (110) must access the shared DRAM cache (150). If the final level cache (140) is implemented as an L3 cache and the shared DRAM cache (150) is implemented as an L4 cache, the attacker application (110) requires additional access time.

또한 공격자 어플리케이션(110)은 플러시 공격을 수행한 후 재적재를 수행할 때 플러시 공격을 수행한 캐시 블록 A 및 B가 모두 공유DRAM캐시(150)에 적재되어 있으므로, 공격자 어플리케이션(110)에서 플러시 공격을 수행한 캐시 블록 A 및 B에 대한 접근 시간이 피공격자 어플리케이션(120)의 접근 여부와 무관하게 동일해진다. 따라서 공격자 어플리케이션(110)은 피공격자 어플리케이션(120)의 접근 패턴 및 실행패턴을 판단할 수 없게 되어 플러시재적재 공격에 실패한다. In addition, since the cache blocks A and B on which the flush attack was performed are both loaded into the shared DRAM cache (150) when the attacker application (110) performs a reload after performing a flush attack, the access time for the cache blocks A and B on which the flush attack was performed by the attacker application (110) becomes the same regardless of whether the victim application (120) accesses them. Therefore, the attacker application (110) cannot determine the access pattern and execution pattern of the victim application (120), and thus the flush reload attack fails.

도 4 는 본 발명의 바람직한 일 실시예로서, 캐시기반 부채널공격을 방어하는 방법의 흐름도를 도시한다. FIG. 4 is a flowchart illustrating a method for defending against a cache-based side-channel attack, as a preferred embodiment of the present invention.

본 발명의 바람직한 일 실시예로서, 캐시기반 부채널공격을 방어하는 방법은 하드웨어적으로 프라이빗 캐시, SRAM 기반의 공유캐시, 그리고 공유DRAM 캐시를 포함하는 메모리 계층구조를 이용하는 장치를 이용한다(S410). As a preferred embodiment of the present invention, a method for defending against a cache-based side-channel attack uses a device that utilizes a memory hierarchy including a hardware-based private cache, an SRAM-based shared cache, and a shared DRAM cache (S410).

공격자 어플리케이션에서 공유DRAM 캐시 내의 적어도 하나 이상의 캐시 블락을 축출하고자 하는 경우, 공유DRAM캐시는 캐시 블락은 축출하지 않은 채, clflush된 적어도 하나의 캐시 블락 각각의 내부 바이패스비트값을 "1"로 설정한다(S420). 이 후, 공격자 어플리케이션이 쉬고 있는 동안, 피공격자 어플리케이션에서 공유DRAM 캐시로부터 적어도 하나의 캐시 블록을 로드할 때, 캐시 블록 내의 바이패스비트를 각각 확인한다(S430). 피공격자 어플리케이션은 바이패스비트값이 "1"인 경우 clflush된 캐시블락으로 판단하고, 해당 캐시블록을 최종레벨캐시를 우회하여 피공격자 어플리케이션 코어의 프라이빗 캐시로 로드한다. 그 외 플러시 공격이 검출되지 않은 캐시 블록은 최종레벨캐시로 로드한다(S440). When an attacker application attempts to evict at least one cache block in a shared DRAM cache, the shared DRAM cache sets the internal bypass bit value of at least one clflushed cache block to "1" without evicting the cache blocks (S420). Thereafter, while the attacker application is idle, when the victim application loads at least one cache block from the shared DRAM cache, the bypass bit in each cache block is checked (S430). When the bypass bit value is "1", the victim application determines that the cache block is a clflushed cache block and loads the cache block into the private cache of the victim application core, bypassing the final level cache. Other cache blocks for which no flush attack is detected are loaded into the final level cache (S440).

도면들에서 논의되고 제시된 예시적 실시예들을 포함하는 본 개시의 주요 특징은 다양한 아키텍쳐로 구현될 수 있다. 일 실시 예에서, 캐시는 하나 이상의 프로세서상에서 실행되는 스레드 또는 프로세스와 같은 하나 이상의 소프트웨어 구성 요소에 의해 제어되거나 액세스 되거나 저장될 수 있다. 일 실시예에서, 메모리에 저장되는 명령 셋과 같은 소프트웨어 라이브러리는 메모리에 저장되고, 프로세스 및/ 또는 운영 시스템의 스레드 및/또는 어플리케이션에 의해 액세스될 수 있다. 일 실시예에서, 비일시적인 컴퓨터 판독 가능 매체에 저장된 명령 셋은 프로세서에 의해 수행될 수 있다. 일 실시예에서, 캐시는 하나 이상의 하드웨어 장치에 의해 제어되거나 액세스되거나 저장될 수 있다. 일 실시에ㅖ에서, 이러한 하드웨어 장치는, 하나 이상의 프로세서 코어를 각각 갖는 하나 이상의 프로세서와 같으나, 이에 한정되지 않는, 프로세싱 회로를 포함할 수 있다. 이러한 프로세서는 중앙 처리 장치(central processing unit, CPU), 그래픽 처리 장치(graphics processing unit, GPU), 멀티 코어 CPU 또는 멀티 코어 GPU의 코어, 산술 로직 유닛(arithmetic logic unit, ALU), 디지털 신호 프로세서, 마이크로 컨트롤러, 시스템 온 칩(System-on-Chip, SoC), 필드 프로그램어블 게이트 어레이(field programmable gate array, FPGA), 프로그램어블 로직 어레이(programmable logic array, PLA), 주문형 집적 회로(application specific integrated circuit, ASIC), 모듈러 로직 장치, 패키지 로직 칩, 및/또는 정의된 방식으로 명령에 응답하고 명령을 실행할 수 있는 임의의 다른 장치 중 적어도 하나 일 수 있다. 일 실시예에서, 캐시는 동일한 타입 또는 상이한 타입의 구성의 조합의 의해 저장되거나, 액세스 되거나, 저장될 수 있다. 예를 들어, 상기 구성은, 복수의 프로세서들, 단일 프로세서의 프로세싱 코어들, 멀티 프로세서 컴퓨터의 프로세싱 코어들, 직렬로 동작하는 2개 이상의 프로세서(예를 들어, CPU 및 GPU, ASIC를 이용하는 CPU), 및/또는 프로세서에 의해 실행되는 소프트웨어일 수 있다. 예시적 실시예들은 캐시를 저장, 액세스, 및 관리하는 하나 이상의 CPU들을 포함하는 컴퓨터와 같은 단일 장치의 구성을 포함할 수 있다. 일 실시예는 캐시를 액세스 및/또는 관리하기 위해 통신하는 CPU를 포함하는 2개 이상의 장치와 같은 다수의 장치의 구성 요소를 포함할 수 있다. 일 실시예는 서버 컴퓨팅 장치, 서버 컴퓨터, 서버 컴퓨터의 연결, 서버 팜, 클라우드 컴퓨터, 컨텔츠 플랫폼, 모바일 컴퓨팅 장치, 스마트 폰, 태블릭, 또는 셋탑박스를 포함할 수 있다. 일 실시예는 직접적으로 통신하는 구성 요소(예를 들어, 멀티 코어 프로세서의 2개 이상의 코어) 및/또는 간접적으로 통신하는 구성 요소(예를 들어, 버스를 통해, 유선 또는 무선 채널 또는 네트워크를 통해, 마이크로 컨트롤러 또는 아비터(arbiter)와 같은 중간(intermediate) 구성을 통해)을 포함할 수 있다. 일 실시예는 장치 또는 구성에 의해 각각 수행되는 캐시 관리자의 다수의 인스턴스들을 특징으로 할 수 있고, 이러한 인스턴스들은 동시에, 연속적으로, 및/또는 인터리빙된 방식으로 실행될 수 있다. 일 실시예는 2개 이상의 장치 또는 컴포넌트에 대한 캐시 관리자의 인스턴스의 분포를 특징으로 할 수 있다.The key features of the present disclosure, including the exemplary embodiments discussed and presented in the drawings, may be implemented in a variety of architectures. In one embodiment, the cache may be controlled, accessed, or stored by one or more software components, such as threads or processes, running on one or more processors. In one embodiment, a software library, such as a set of instructions stored in a memory, may be stored in the memory and accessed by threads and/or applications of the process and/or operating system. In one embodiment, a set of instructions stored on a non-transitory computer-readable medium may be executed by the processor. In one embodiment, the cache may be controlled, accessed, or stored by one or more hardware devices. In one embodiment, such hardware devices may include processing circuitry, such as, but not limited to, one or more processors, each having one or more processor cores. Such a processor may be at least one of a central processing unit (CPU), a graphics processing unit (GPU), a core of a multi-core CPU or a multi-core GPU, an arithmetic logic unit (ALU), a digital signal processor, a microcontroller, a system-on-chip (SoC), a field programmable gate array (FPGA), a programmable logic array (PLA), an application specific integrated circuit (ASIC), a modular logic device, a packaged logic chip, and/or any other device capable of responding to and executing instructions in a defined manner. In one embodiment, the cache may be stored, accessed, or stored by a combination of the same type or different types of configurations. For example, the configuration may be a plurality of processors, processing cores of a single processor, processing cores of a multiprocessor computer, two or more processors operating in series (e.g., a CPU and a GPU, a CPU utilizing an ASIC), and/or software executed by the processor. Example embodiments may include a configuration of a single device, such as a computer, that includes one or more CPUs that store, access, and manage a cache. An embodiment may include components of multiple devices, such as two or more devices that include CPUs that communicate to access and/or manage a cache. An embodiment may include a server computing device, a server computer, a connection of server computers, a server farm, a cloud computer, a content platform, a mobile computing device, a smart phone, a tablet, or a set-top box. An embodiment may include components that communicate directly (e.g., two or more cores of a multi-core processor) and/or components that communicate indirectly (e.g., via a bus, via a wired or wireless channel or network, via an intermediate component such as a microcontroller or an arbiter). An embodiment may feature multiple instances of a cache manager, each of which is executed by the device or component, which instances may be executed concurrently, sequentially, and/or in an interleaved manner. One embodiment may feature distribution of instances of a cache manager across two or more devices or components.

본 발명의 바람직한 일 실시예로서, 메모리에 저장되는 캐시 및 컴퓨터 판독 가능 명령어들을 포함하는 컴포넌트들을 포함할 수 있다. 이하의 설명에 한정되지는 않으나, 메모리의 비 한정적인 예시는 재기록 가능한 비휘발성 메모리 장치(예를 들어, 플래시 메모리 장치, 소거 가능 프로그램어블 판독 전용 메모리 장치, 또는 마스크 판독 전용 메모리 장치), 휘발성 메모리 장치(예를 들어, 정적 랜덤 액세스 메모리 장치(SRAM), 동적 랜덤 액세스 메모리 장치(DRAM)), 자기 저장 매체(예를 들어, 아날로그 또는 디지털 자기 테이프, 하드 디스크 드라이브) 및 광 저장 매체(예를 들어, CD, DVD, 또는 블루레이 디스크)를 포함할 수 있다. 재기록 가능 비휘발성 메모리 장치가 내장된 메모리의 예로는 메모리 카드, 판독 전용 메모리(read only memory, ROM)가 내장된 매체가 있을 수 있으나, 이에 한정되는 것은 아니다. 일 실시예는 랜덤 액세스 메모리(randoem access memory, RAM), ROM, 영구 대용양 저장 장치(예를 들어, 디스트 드라이브) 및/또는 데이터를 저장하고 기록할 수 있는 임의의 다른 유사한 데이터 저장 메커니즘을 포함할 수 있다. 메모리는 하나 이상의 운영 체제 및/또는 여기에 설명된 예시적인 실시예를 구현하기 위해 컴퓨터 프로그램, 프로그램 코드, 명령 또는 이들의 조합을 저장하도록 구성될 수 있다. 메모리는 USB(universal serial bus) 플래시 드라이브, 메모리 스틱, 블루레이/DVD/CD-ROM 드라이브, 메모리 카드 및/또는 다른 유사한 컴퓨터 판독 가능 저장 매체를 포함할 수 있다. 일 실시예에서, 캐시, 컴퓨터 프로그램, 프로그램 코드, 명령들 및/또는 이들의 조합은 네트워크 인터페이스를 통해 원격 데이터 저장 장치들로부터 하나 이상의 로컬 메모리들 및/또는 하나 이상의 로컬 프로세서들로 로딩될 수 있다. 일 실시예에서, 캐시, 컴퓨터 프로그램, 프로그램 코드, 명령 및/또는 이들의 조합은 다른 로컬 메모리 및/또는 다른 로컬 프로세서 또는 다른 구성 요소로부터 로딩될 수 있다.A preferred embodiment of the present invention may include components that include a cache and computer-readable instructions stored in a memory. Non-limiting examples of memory may include, but are not limited to, a rewritable non-volatile memory device (e.g., a flash memory device, an erasable programmable read-only memory device, or a masked read-only memory device), a volatile memory device (e.g., a static random access memory device (SRAM), a dynamic random access memory device (DRAM)), a magnetic storage medium (e.g., an analog or digital magnetic tape, a hard disk drive), and an optical storage medium (e.g., a CD, a DVD, or a Blu-ray disc). Examples of memory having a rewritable non-volatile memory device embedded therein include, but are not limited to, a memory card, a medium having a read only memory (ROM) embedded therein. One embodiment may include random access memory (RAM), ROM, a persistent mass storage device (e.g., a disk drive), and/or any other similar data storage mechanism capable of storing and recording data. The memory may be configured to store computer programs, program codes, instructions, or a combination thereof for implementing one or more operating systems and/or the exemplary embodiments described herein. The memory may include a universal serial bus (USB) flash drive, a memory stick, a Blu-ray/DVD/CD-ROM drive, a memory card, and/or other similar computer-readable storage media. In one embodiment, the cache, the computer programs, program codes, instructions, and/or a combination thereof may be loaded from remote data storage devices via a network interface into one or more local memories and/or one or more local processors. In one embodiment, the cache, the computer programs, program codes, instructions, and/or a combination thereof may be loaded from another local memory and/or another local processor or other component.

본 발명에서는 특정 예시적인 컴퓨터 아키텍쳐와 관련하여 상술하였으나, 캐싱은 컴퓨터 시스템 내부뿐만 아니라 외부의 많은 다른 설정들에 존재할 수 있고, 상기 실시예뜰은 이러한 다른 상황들에 동등하게 적용될 수 있다. 이러한 용도의 예로는 디스크 또는 플래시 메모리와 같은 저속 대용량 저장 장치의 데이터를, DRAM을 사용하여 구현할 수 있는 더 빠르고 더 작은 대용량 저장 장치로 캐시하는 가상 메모리 시스템이 있다. 컴퓨터 시스템에서 캐싱의 다른 예는, 디스크 캐싱, 웹 캐싱 및 네임 캐싱을 포함할 수 있으나, 이에 한정되지는 않는다. 이러한 캐시의 조직 및 캐싱 메커니즘은 상기 논의된 캐시의 구성 및 캐싱 메커니즘, 예를 들어, 세트의 크기 차이, 세트 및 연관성의 구현 등과 다를 수 있다. 캐싱 메커니즘 그 자체의 구현에 관계없이, 다양한 캐싱 방식을 구현하는 데 동등하게 적용될 수 있다.While the present invention has been described above with respect to a specific exemplary computer architecture, caching may exist in many other settings, both internal and external to a computer system, and the embodiments described herein are equally applicable to such other situations. An example of such a use case is a virtual memory system that caches data from a slower mass storage device, such as a disk or flash memory, to a faster and smaller mass storage device, such as one implemented using DRAM. Other examples of caching in a computer system include, but are not limited to, disk caching, web caching, and name caching. The organization and caching mechanisms of such caches may differ from the organization and caching mechanisms of the caches discussed above, such as differences in the sizes of sets, implementations of sets and associativity, etc. Regardless of the implementation of the caching mechanism itself, it is equally applicable to implementing various caching schemes.

개시된 실시예들은 예를 들어, 다양한 캐시 계층 구조와 관련된 시스템 및 방법을 설명하나, 본 개시의 실시예들은 설명에 한정되지 않으며, 설명된 실시예들은 본 발명의 사상 및 범위에 포함되는 대안, 수정 및 등가물을 포함할 수 있다. 본 실시 예의 특징 및 요소가 실시 예에서 특정 조합으로 기술되었지만, 각 특징 또는 요소는 실시 예의 다른 특징 및 요소없이 단독으로 또는 본원에 개시된 다른 특징 및 요소가 있거나 없는 다양한 조합으로 사용될 수 있다. 본 출원에 제공된 방법 또는 흐름도는 범용 컴퓨터 또는 프로세서에 의한 실행을 위해 컴퓨터 읽기 가능 저장 매체에 유형적으로 구현된 컴퓨터 프로그램, 소프트웨어 또는 펌웨어로 구현 될 수 있다.While the disclosed embodiments describe systems and methods related to, for example, various cache hierarchies, the embodiments of the present disclosure are not limited to the description, and the described embodiments may include alternatives, modifications, and equivalents included within the spirit and scope of the present invention. Although features and elements of the present embodiments are described in particular combinations in the embodiments, each feature or element may be used alone or in various combinations with or without other features and elements of the embodiments disclosed herein. The methods or flowcharts provided in the present application may be implemented as a computer program, software, or firmware tangibly embodied in a computer-readable storage medium for execution by a general purpose computer or processor.

본 발명은 도면에 도시된 실시예를 참고로 설명되었으나 이는 예시적인 것에 불과하며, 본 기술 분야의 통상의 지식을 가진 자라면 이로부터 다양한 변형 및 균등한 다른 실시예가 가능하다는 점을 이해할 것이다. 따라서, 본 발명의 진정한 기술적 보호 범위는 첨부된 특허청구범위의 기술적 사상에 의하여 정해져야 할 것이다.Although the present invention has been described with reference to the embodiments shown in the drawings, these are merely exemplary, and those skilled in the art will understand that various modifications and equivalent other embodiments are possible therefrom. Accordingly, the true technical protection scope of the present invention should be determined by the technical idea of the appended claims.

Claims (15)

캐시기반 부채널공격을 방어하는 장치로서,
프라이빗 캐시;
SRAM 기반의 공유캐시; 및
공유DRAM 캐시;
를 포함하고,
상기 프라이빗 캐시는 L1 캐시 또는 L2 캐시로 구현되고, 상기 SRAM 기반의 공유캐시는 L3 캐시로 구현되고, 상기 공유DRAM 캐시는 L4 캐시로 구현됨으로써 상기 장치의 메모리 계층구조가 구현되고,
상기 공유DRAM 캐시의 각 캐시블록은, 바이패스 비트를 포함하고,
상기 바이패스 비트는 피공격자 어플리케이션에 대한 공격자 어플리케이션의 부채널공격여부를 표시하고,
상기 장치는,
상기 공유DRAM 캐시에서 적어도 하나의 캐시블록을 로드할 때, 상기 캐시블록에 대응되는 바이패스 비트값이 1인 경우, 부채널공격이 확인된 상기 캐시블록을 상기 SRAM 기반의 공유캐시를 우회하여 상기 프라이빗 캐시로 로드하고,
상기 적어도 하나의 캐시블록을 로드할 때, 상기 캐시블록에 대응되는 바이패스 비트값이 0인 경우, 부채널공격이 확인되지 않은 상기 캐시블록을 상기 SRAM 기반의 공유캐시로 로드하는 것을 특징으로 하는, 캐시기반 부채널공격을 방어하는 장치.
As a device to defend against cache-based side-channel attacks,
private cache;
SRAM-based shared cache; and
Shared DRAM cache;
Including,
The above private cache is implemented as an L1 cache or an L2 cache, the above SRAM-based shared cache is implemented as an L3 cache, and the above shared DRAM cache is implemented as an L4 cache, thereby implementing the memory hierarchy of the device.
Each cache block of the above shared DRAM cache includes a bypass bit,
The above bypass bit indicates whether the attacker application is performing a side-channel attack on the victim application.
The above device,
When loading at least one cache block from the shared DRAM cache, if the bypass bit value corresponding to the cache block is 1, the cache block for which a side-channel attack has been confirmed is loaded into the private cache by bypassing the SRAM-based shared cache,
A device for defending against a cache-based side-channel attack, characterized in that when loading at least one cache block, if the bypass bit value corresponding to the cache block is 0, the cache block for which a side-channel attack has not been confirmed is loaded into the SRAM-based shared cache.
삭제delete 제 1 항에 있어서,
상기 프라이빗 캐시의 각 캐시블록은, 바이패스 비트를 포함하고,
상기 적어도 하나의 캐시블록을 로드할 때, 상기 적어도 하나의 캐시블록에 대응되는 상기 공유DRAM 캐시의 바이패스 비트값이 1인 경우, 상기 프라이빗 캐시의 바이패스 비트의 비트값은 0에서 1로 변경되는 것을 특징으로 하는, 캐시기반 부채널공격을 방어하는 장치.
In paragraph 1,
Each cache block of the above private cache includes a bypass bit,
A device for defending against a cache-based side-channel attack, characterized in that when loading at least one cache block, if the bypass bit value of the shared DRAM cache corresponding to the at least one cache block is 1, the bit value of the bypass bit of the private cache changes from 0 to 1.
캐시기반 부채널공격을 방어하는 장치로서,
프라이빗 캐시;
SRAM 기반의 공유캐시; 및
공유DRAM 캐시;
를 포함하고,
상기 프라이빗 캐시는 L1 캐시 또는 L2 캐시로 구현되고, 상기 SRAM 기반의 공유캐시는 L3 캐시로 구현되고, 상기 공유DRAM 캐시는 L4 캐시로 구현됨으로써 상기 장치의 메모리 계층구조가 구현되고,
상기 프라이빗 캐시 및 상기 공유DRAM 캐시의 각 캐시블록은, 바이패스 비트를 포함하고,
상기 장치는,
상기 바이패스 비트의 비트값을 이용하여 피공격자 어플리케이션에 대한 공격자 어플리케이션의 부채널공격여부를 판단하고,
상기 공격자 어플리케이션이 플러시 공격을 수행한 후 재적재를 수행할 때 상기 플러시 공격을 수행한 적어도 하나의 캐시블록이 모두 상기 공유DRAM 캐시에 적재되어 있어, 상기 공격자 어플리케이션에서 상기 플러시 공격을 수행한 적어도 하나의 캐시블록에 대한 접근 시간이 상기 피공격자 어플리케이션의 접근 여부와 무관하게 동일함으로써 상기 피공격자 어플리케이션의 접근 패턴 및 실행 패턴을 판단할 수 없도록 구성되는 것을 특징으로 하는, 캐시기반 부채널공격을 방어하는 장치.
As a device to defend against cache-based side-channel attacks,
private cache;
SRAM-based shared cache; and
Shared DRAM cache;
Including,
The above private cache is implemented as an L1 cache or an L2 cache, the above SRAM-based shared cache is implemented as an L3 cache, and the above shared DRAM cache is implemented as an L4 cache, thereby implementing the memory hierarchy of the device.
Each cache block of the above private cache and the above shared DRAM cache includes a bypass bit,
The above device,
Using the bit value of the above bypass bit, it is determined whether the attacker application is performing a side-channel attack on the victim application.
A device for defending against a cache-based side-channel attack, characterized in that when the attacker application performs a reload after performing a flush attack, at least one cache block on which the flush attack was performed is loaded into the shared DRAM cache, so that an access time for at least one cache block on which the flush attack was performed by the attacker application is the same regardless of whether the victim application accesses it, so that the access pattern and execution pattern of the victim application cannot be determined.
제 4 항에 있어서,
상기 피공격자 어플리케이션은, 상기 공유DRAM 캐시의 적어도 하나의 캐시블록 각각의 바이패스 비트값에 따라 상기 피공격자 어플리케이션의 상기 프라이빗 캐시 또는 상기 SRAM 기반의 공유캐시에 캐시블록 각각을 로드하는 것을 특징으로 하는, 캐시기반 부채널공격을 방어하는 장치.
In paragraph 4,
A device for defending against a cache-based side-channel attack, characterized in that the victim application loads each cache block into the private cache of the victim application or the SRAM-based shared cache according to the bypass bit value of each of at least one cache block of the shared DRAM cache.
제 5 항에 있어서,
상기 공유DRAM 캐시의 적어도 하나의 캐시블록 각각의 바이패스 비트값은, 공격자 어플리케이션이 피공격자 어플리케이션에 상기 플러시 공격을 수행한 경우 1로 표시되고, 그렇지 않은 경우 0으로 표시되는 것을 특징으로 하는, 캐시기반 부채널공격을 방어하는 장치.
In paragraph 5,
A device for defending against a cache-based side-channel attack, characterized in that the bypass bit value of each of at least one cache block of the shared DRAM cache is displayed as 1 if the attacker application performs the flush attack on the victim application, and 0 otherwise.
제 5 항에 있어서,
상기 바이패스 비트값이 1로 표시된 캐시블록은, 상기 SRAM 기반의 공유캐시를 우회하여 상기 피공격자 어플리케이션의 상기 프라이빗 캐시로 로드되고, 상기 프라이빗 캐시의 바이패스 비트의 비트값은 0에서 1로 변경되는 것을 특징으로 하는 캐시기반 부채널공격을 방어하는 장치.
In paragraph 5,
A device for defending against a cache-based side-channel attack, characterized in that a cache block in which the bypass bit value is indicated as 1 is loaded into the private cache of the attacker application by bypassing the SRAM-based shared cache, and the bit value of the bypass bit of the private cache is changed from 0 to 1.
제 5 항에 있어서,
상기 바이패스 비트값이 0으로 표시된 캐시블록은, 상기 피공격자 어플리케이션의 상기 SRAM 기반의 공유캐시에 로드되는 것을 특징으로 하는, 캐시기반 부채널공격을 방어하는 장치.
In paragraph 5,
A device for defending against a cache-based side-channel attack, characterized in that a cache block in which the bypass bit value is marked as 0 is loaded into the SRAM-based shared cache of the attacker application.
제 4 항에 있어서,
상기 공격자 어플리케이션은, clflush 명령을 이용하여 상기 플러시 공격을 수행하고,
상기 clflush 명령의 실행시, 상기 프라이빗 캐시 및 상기 SRAM 기반의 공유캐시의 캐시블럭은 플러시(flush)되나, 상기 공유DRAM 캐시에 있는 캐시블럭은 플러시되지 않고, 상기 clflush 명령이 수행되었는지 여부가 상기 공유DRAM 캐시의 바이패스 비트를 통해 표시되는 것을 특징으로 하는, 캐시기반 부채널공격을 방어하는 장치.
In paragraph 4,
The above attacker application performs the flush attack using the clflush command,
A device for defending against a cache-based side-channel attack, characterized in that when the clflush command is executed, cache blocks of the private cache and the SRAM-based shared cache are flushed, but cache blocks in the shared DRAM cache are not flushed, and whether the clflush command has been executed is indicated through a bypass bit of the shared DRAM cache.
적어도 하나의 프로세서, 프라이빗 캐시, SRAM 기반의 공유캐시 및 공유DRAM 캐시를 포함하는 장치의 동작 방법으로서,
상기 공유DRAM 캐시의 캐시블럭에 포함된 바이패스 비트를 이용하여 피공격자 어플리케이션에 대한 공격자 어플리케이션의 플러시 공격 수행 여부를 표시하는 단계;
상기 피공격자 어플리케이션에서 상기 공유DRAM 캐시로부터 적어도 하나의 캐시블록을 로드할 때, 상기 적어도 하나의 캐시블록 내의 상기 바이패스 비트를 각각 확인하는 단계; 및
상기 바이패스 비트를 확인한 결과 플러시 공격이 수행된 캐시블록은 상기 SRAM 기반의 공유캐시를 우회하여 상기 피공격자 어플리케이션의 프라이빗 캐시에 로드하고, 플러시 공격이 검출되지 않는 캐시블록은 상기 SRAM 기반의 공유캐시로 로드하는 단계;
를 포함하고,
상기 프라이빗 캐시는 L1 캐시 또는 L2 캐시로 구현되고, 상기 SRAM 기반의 공유캐시는 L3 캐시로 구현되고, 상기 공유DRAM 캐시는 L4 캐시로 구현됨으로써 상기 장치의 메모리 계층구조가 구현되는 것을 특징으로 하는, 캐시기반 부채널공격을 방어하는 방법.
A method of operating a device including at least one processor, a private cache, a SRAM-based shared cache and a shared DRAM cache,
A step of indicating whether an attacker application performs a flush attack on a victim application by using a bypass bit included in a cache block of the above shared DRAM cache;
When loading at least one cache block from the shared DRAM cache in the attacker application, a step of checking each of the bypass bits in the at least one cache block; and
A step of loading a cache block on which a flush attack has been performed into the private cache of the victim application by bypassing the SRAM-based shared cache as a result of verifying the above bypass bit, and loading a cache block on which a flush attack has not been detected into the SRAM-based shared cache;
Including,
A method for defending against a cache-based side-channel attack, characterized in that the memory hierarchy of the device is implemented by implementing the private cache as an L1 cache or an L2 cache, the SRAM-based shared cache as an L3 cache, and the shared DRAM cache as an L4 cache.
제 10 항에 있어서,
상기 공격자 어플리케이션은, clflush 명령을 이용하여 상기 플러시 공격을 수행하고,
상기 피공격자 어플리케이션의 상기 프라이빗 캐시 및 상기 SRAM 기반의 공유캐시의 캐시블럭은 플러시(flush)되나, 상기 공유DRAM 캐시의 캐시블럭은 플러시되지 않고,
상기 clflush 명령이 수행되었는지 여부가 상기 공유DRAM 캐시의 바이패스 비트를 통해 표시되는 것을 특징으로 하는, 방법.
In Article 10,
The above attacker application performs the flush attack using the clflush command,
The cache blocks of the private cache and the SRAM-based shared cache of the above-mentioned victim application are flushed, but the cache blocks of the shared DRAM cache are not flushed.
A method characterized in that whether the clflush command has been performed is indicated through a bypass bit of the shared DRAM cache.
제 10 항에 있어서,
상기 공유DRAM 캐시의 캐시블럭의 바이패스 비트값이 1인 경우, 플러시 공격이 수행되었음을 나타내고,
상기 공유DRAM 캐시로부터 적어도 하나의 캐시블록을 로드할 때, 상기 적어도 하나의 캐시블록에 대응되는 상기 공유DRAM 캐시의 바이패스 비트값이 1인 경우, 상기 프라이빗 캐시의 바이패스 비트의 비트값은 0에서 1로 변경되는 것을 특징으로 하는, 방법.
In Article 10,
If the bypass bit value of the cache block of the above shared DRAM cache is 1, it indicates that a flush attack has been performed.
A method characterized in that when loading at least one cache block from the shared DRAM cache, if the bypass bit value of the shared DRAM cache corresponding to the at least one cache block is 1, the bit value of the bypass bit of the private cache is changed from 0 to 1.
제 11항에 있어서,
상기 장치는,
상기 공격자 어플리케이션이 플러시 공격을 수행한 후 재적재를 수행할 때 상기 플러시 공격을 수행한 적어도 하나의 캐시블록이 모두 상기 공유DRAM 캐시에 적재되어 있어, 상기 공격자 어플리케이션에서 상기 플러시 공격을 수행한 적어도 하나의 캐시블록에 대한 접근 시간이 상기 피공격자 어플리케이션의 접근 여부와 무관하게 동일함으로써 상기 피공격자 어플리케이션의 접근 패턴 및 실행 패턴을 판단할 수 없도록 구성되는 것을 특징으로 하는, 방법.
In Article 11,
The above device,
A method characterized in that, when the attacker application performs a flush attack and then performs a reload, at least one cache block on which the flush attack was performed is loaded into the shared DRAM cache, so that the access time for at least one cache block on which the flush attack was performed by the attacker application is the same regardless of whether the victim application accesses it, so that the access pattern and execution pattern of the victim application cannot be determined.
삭제delete 청구항 제 10 항 내지 청구항 제 13 항 중 어느 한 항에 기재된 캐시기반 부채널공격을 방어하는 방법을 실행하기 위한 프로그램을 기록한 것을 특징으로 하는, 컴퓨터 판독 가능 저장매체.A computer-readable storage medium characterized by recording a program for executing a method for defending against a cache-based side-channel attack as claimed in any one of claims 10 to 13.
KR1020200010037A 2020-01-28 2020-01-28 Method and Apparatus for protecting caches from side-channel attacks Active KR102817178B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020200010037A KR102817178B1 (en) 2020-01-28 2020-01-28 Method and Apparatus for protecting caches from side-channel attacks

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020200010037A KR102817178B1 (en) 2020-01-28 2020-01-28 Method and Apparatus for protecting caches from side-channel attacks

Publications (2)

Publication Number Publication Date
KR20210096500A KR20210096500A (en) 2021-08-05
KR102817178B1 true KR102817178B1 (en) 2025-06-05

Family

ID=77316454

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020200010037A Active KR102817178B1 (en) 2020-01-28 2020-01-28 Method and Apparatus for protecting caches from side-channel attacks

Country Status (1)

Country Link
KR (1) KR102817178B1 (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190042799A1 (en) * 2018-06-29 2019-02-07 Intel Corporation Memory tagging for side-channel defense, memory safety, and sandboxing

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102287758B1 (en) * 2018-03-05 2021-08-09 삼성전자주식회사 System protecting caches from side-channel attacks

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190042799A1 (en) * 2018-06-29 2019-02-07 Intel Corporation Memory tagging for side-channel defense, memory safety, and sandboxing

Also Published As

Publication number Publication date
KR20210096500A (en) 2021-08-05

Similar Documents

Publication Publication Date Title
TWI798370B (en) Non-transitory computer-readable storage medium and system and method for accessing data in device
EP3591565A1 (en) Computing device with increased resistance against rowhammer attacks
US11777705B2 (en) Techniques for preventing memory timing attacks
US10810309B2 (en) Method and system for detecting kernel corruption exploits
US7870336B2 (en) Operating system protection against side-channel attacks on secrecy
RU2510074C2 (en) System and method of checking executable code before execution thereof
KR102856659B1 (en) Device and method for storing bounded pointers
JP7801251B2 (en) Tag checking device and method
WO2020007813A1 (en) Computing device with increased resistance against rowhammer attacks
EP4390708B1 (en) Selective memory duplication control
US11500785B2 (en) Systems and methods for memory safety with random embedded secret tokens
Zhang et al. SoK: Rowhammer on commodity operating systems
Lou et al. Understanding Rowhammer attacks through the lens of a unified reference framework
CN111373405B (en) Computer-implemented method for preventing bit flipping attacks in computing devices
KR102815771B1 (en) Method and Apparatus for protecting caches from side-channel attacks
KR102817178B1 (en) Method and Apparatus for protecting caches from side-channel attacks
US20250068732A1 (en) Mechanism to prevent leakage through side channels in cache memory
CN113111391A (en) Method for memory integrity protection and memory controller
CN113536364A (en) Construction method of secure key-value storage system based on IntelSGX
US10884953B2 (en) Capability enforcement processors
CN116635855A (en) Apparatus and method for managing access of executable code to data memory based on execution context
Zhou et al. PointerLock: Protecting Function Pointers with Access Control on Page
Khoshavi et al. A Survey on Side Channel Attacks in Processor-Memory Chip Stack
Awad Towards Efficient Integration of Emerging NVM Technologies in Future Systems
WO2016204770A1 (en) Protected loading of a module

Legal Events

Date Code Title Description
PA0109 Patent application

Patent event code: PA01091R01D

Comment text: Patent Application

Patent event date: 20200128

PG1501 Laying open of application
E902 Notification of reason for refusal
PE0902 Notice of grounds for rejection

Comment text: Notification of reason for refusal

Patent event date: 20241215

Patent event code: PE09021S01D

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

Patent event code: PE07011S01D

Comment text: Decision to Grant Registration

Patent event date: 20250528

PG1601 Publication of registration