Dual-source information detection and local remapping defense method against cache side-channel attacks

By assigning labels to processes and training neural networks using hardware performance counter data, efficient detection and local remapping defense against cache side-channel attacks are achieved. This solves the problems of low detection accuracy and high performance overhead in existing methods, and improves system operating efficiency.

CN115146698BActive Publication Date: 2026-01-02BEIJING INST OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210528117.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-16
Publication Date
2026-01-02
Estimated Expiration
2042-05-16

AI Technical Summary

Technical Problem

Existing methods for defending against cache side-channel attacks suffer from low detection accuracy, high performance overhead, resource waste, and high detection error, making them ineffective in protecting processes and data that require protection.

Method used

The method employs dual-source information detection and local remapping defense. It assigns a label to each process through a monitoring module, trains a neural network using hardware performance counter data, detects attacks by combining performance characteristics and access characteristics, and performs local remapping defense, providing precise defense only for protected processes and data.

Benefits of technology

It improves the accuracy of attack detection, reduces the performance overhead of system operation, improves system operating efficiency, and avoids the execution of ineffective defense measures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115146698B_ABST
    Figure CN115146698B_ABST
Patent Text Reader

Abstract

The present application relates to a dual-source information detection and local remapping defense method for cache side channel attacks, and belongs to the technical field of computer and information science. The present application first allocates a tag greater than 0 to each process to be protected; when there is a protected process, a dual-source information detection module is called, which is divided into two sub-modules of performance characteristic detection and access behavior detection. The former determines whether there is an attack through system timing running performance characteristics, and the latter detects whether there is an attack through access behavior in each cache group. When both sub-modules detect an attack, local remapping defense is performed on the cache group where the attack occurs, and the data of the protected process is mapped to the cache group where no attack occurs. Compared with the single-source information detection method, the dual-source information detection module is constructed to mine real-time attack information, improving the detection accuracy of the attacked cache group. Compared with the global remapping method, only the protected process and data are accurately mapped, effectively improving the system running efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application relates to a dual-source information detection and local remapping defense method for cache side channel attacks and belongs to the technical field of computer and information science. BACKGROUND

[0002] A cache side channel attack refers to a non-intrusive attack method for cracking an encryption algorithm by using information leaked by a cache (CPU cache) sharing mechanism. With the application and popularization of cloud services and virtualization technologies, cache resource sharing between virtual machines makes cache side channel attacks more frequent and hidden, seriously threatening the security of an encryption system. Therefore, research on a cache side channel attack defense technology is crucial for protecting sensitive information of an encryption system.

[0003] Existing cache side channel attack defense methods can be divided into two categories: a randomization method and an isolation method. The randomization method is to find an eviction set according to an attack method and rely on a cache-to-memory mapping relationship to change the cache-to-memory mapping. However, global remapping and frequent modification of the mapping relationship increase the system overhead and reduce the program running efficiency. The isolation method usually divides the cache into different areas and then puts different types of processes into different areas to prevent attacks from stealing information. However, the isolation method reduces the cache efficiency, causes the cache to be underutilized, and affects the process execution efficiency due to the size of the isolation domain. Meanwhile, the two methods above cause performance waste when no attack method exists. Existing methods also use detection methods to detect attacks and then take corresponding measures. However, the information acquisition source is single, and only the running performance such as the L1 miss rate and the LLC miss rate is detected. Since the attack process and the victim process are not single running in the actual running process, the load application affects the success rate of detection, the false positive rate is too high, the wrong measures are taken, and the attack occurring in which cache group cannot be located.

[0004] In summary, the existing cache side channel attack defense methods mainly have the following problems: (1) the randomization method causes global remapping and frequent modification of the mapping relationship, which increases the system overhead, and most of the data in the cache does not need to reduce the program running efficiency; (2) the isolation method causes the cache to be underutilized, and the size of the isolation domain affects the process execution efficiency; (3) when no attack process exists, the two methods cause performance waste; and (4) the detection method only acquires information on the single system running performance for detection, and the load application easily affects the detection result. SUMMARY

[0005] The present application aims at the existing cache side channel attack detection method, the single detection information acquisition leads to low accuracy, the existing cache side channel attack defense method cannot effectively defend the process and data to be protected, and the performance overhead is too large, and a double-source information detection and local remapping defense method of cache side channel attack is provided.

[0006] The design principle of the present application is that: first, the monitoring module assigns a label label to each process, which is 0 by default, and the protected process (i.e., the potential victim process) is label>0; then, the monitoring module detects whether there is a process with label>0, and if so, calls the double-source information detection module, which uses the timing performance of the entire system and the access mode in the cache group to determine whether an attack exists and locates the cache group where the attack occurs; when both sub-modules detect an attack, the cache group where the attack occurs is subjected to targeted remapping defense to destroy the attack implementation conditions.

[0007] The technical scheme of the present application is realized by the following steps:

[0008] Step 1, training process, collect hardware performance counter (Hardware Performance Counter, HPC) data, build a data set containing HPC timing changes, and train a neural network.

[0009] Step 1.1, run the attack process, victim process, and each time match 0, 3, 6 load processes to simulate the real running environment, i.e., run 2, 5, 8 processes including the attack process and the victim process each time, and collect HPC data f every τ time. τ .

[0010] Step 1.2, build a training data every τ time, and each training data contains HPC data of the previous i+1 time, i.e., data τ ={f τ-i ,……,f τ-1 ,f τ}, build a data set containing HPC timing changes.

[0011] Step 1.3, K-fold cross-validation is performed on the training data, and then the neural network model of the detection module is trained.

[0012] Step 2, in the actual running process, the monitoring module assigns a label label to each process, and the protected process (i.e., the potential victim process) label>0, and the data read into the cache by each process also saves a label label equal to the label label of the process.

[0013] Step 3, during the running process, the monitoring module can detect whether there is a process with label>0 in real time, and when there is a process with label>0, the monitoring module can call the dual-source information detection module.

[0014] Step 4, the dual-source information detection module includes a performance feature detection submodule and an access feature detection submodule, if the two submodules detect an attack at the same time, it is determined that there is an attack, and the cache group where the attack occurs is located, and the remapping defense module is called.

[0015] Step 4.1, the performance feature detection submodule can collect HPC data f every τ time. τ At the same time, a test set data τ Then, the pre-trained neural network model is used for detection to determine whether there is an attack.

[0016] Step 4.2, the access feature detection submodule can monitor each cache group, and determine whether there is an attack in each cache group according to the access mode in each cache group.

[0017] Step 4.3, if the performance feature detection submodule and the access feature detection submodule both determine that there is an attack, it is determined that there is an attack, and the cache group where the attack occurs is located, and the remapping defense module is called.

[0018] Step 5, when the detection module detects an attack, according to the positioning information, the label>0 data in the cache group where the attack occurs is mapped to the cache group where the attack does not occur.

[0019] Advantages

[0020] Compared with the existing detection method, the dual-source information detection module is constructed by using the system running performance and the access mode in the cache group, real-time attack information is mined, and the detection accuracy of the attacked cache group is improved.

[0021] Compared with the existing global remapping defense method, the cache group where the attack occurs can be located, and only the protected processes and data are accurately remapped, so that the system running efficiency is effectively improved. DETAILED DESCRIPTION

[0022] Figure 1 The principle diagram of the dual-source information detection and local remapping defense method for cache side channel attacks of the application. DETAILED DESCRIPTION

[0023] In order to better illustrate the purpose and advantages of the application, the embodiments of the method of the application will be further described in detail below with examples.

[0024] The specific process is as follows:

[0025] Step 1, collect hardware performance counter (HPC) data, construct a data set containing HPC time series changes, and train a neural network.

[0026] Step 1.1, run the attack process, victim process, and each time match 0, 3, 6 load processes to simulate the real running environment, that is, each time run 2, 5, 8 processes including the attack process and the victim process, and collect HPC data f every τ time τ The implementation of the attack process includes Prime+Probe, Flush+Reload and Flush+Flush three attack methods, and each time the collected HPC data contains four hardware events f τ ={Miss L1 ,Miss LLC ,TOT CYC ,BR MSP} , respectively: L1 miss ratio (Miss L1 ), LLC miss ratio (Miss LLC ), total execution period (TOT CYC ) and branch error prediction data (BR MSP ).

[0027] Step 1.2, compared with the victim process, the cache miss ratio and other values of the attack process have great differences, thereby having the basis for detection. Because the load application has an impact on the single-time HPC value and the repeatability and regularity of the cache side channel attack, a data set containing HPC time series changes is constructed, and a training data is constructed every τ time. Each training data contains HPC data of the previous i+1 time, that is, data τ ={f τ-i ,……,f τ-1 ,f τ} , a data set containing HPC time series changes data is constructed.

[0028] Step 1.3, perform K-fold cross-validation on the data set data, and then train the neural network model of the detection module.

[0029] Step 2, in actual operation, the monitoring module assigns a label to each process, which is 0 by default; when the process is a protected process (i.e., a potential victim process), the label is greater than 0, and the labels of each protected process are different, and the data in the cache also saves a label, which is the label of the process that reads the data into the cache; when the process accesses the data in the cache, if the process label and the data label are not equal, the process cannot access the data, thereby resisting Flush+Reload and Flush+Flush type attacks.

[0030] Step 3, in actual operation, the monitoring module detects whether there is a process with a label greater than 0 in real time, and when there is a process with a label greater than 0, the monitoring module calls the dual-source information detection module.

[0031] Step 4, the dual-source information detection module includes a performance feature detection submodule and an access feature detection submodule; if both submodules detect an attack at the same time, it is determined that there is an attack, and the cache set where the attack occurs is located, and the remapping defense module is called.

[0032] Step 4.1, the performance feature detection submodule first collects HPC data f τ every τ time, and constructs a test set data τ ={f τ-i ,……,f τ-1 ,f τ}, and then uses a pre-trained neural network model to detect whether there is an attack.

[0033] Step 4.2, if a Prime+Probe type attack is needed, the attack process must evict the data from the victim process from the cache and ensure that one or more cache sets are completely occupied, so the attack process must access at least way times (way is the associativity of the cache), therefore, the access feature detection submodule monitors each cache set, and for each cache set, the label of the process that last accessed the cache set is recorded as label access , and the number of consecutive accesses of the process is recorded as num access ; when num access is greater than or equal to the associativity way of the cache, it is determined that there is an attack in the cache set.

[0034] Step 4.3, if both the performance feature detection submodule and the access feature detection submodule determine that there is an attack, it is determined that there is an attack, and the cache set where the attack occurs is located, and the cache set where the attack occurs is set attack, the attack process label is marked as label attack = label access , and the remapping defense module is called simultaneously; the dual-source information detection module can effectively improve the detection accuracy, and the accuracy is defined as

[0035]

[0036] Among them, TP is true positive, that is, how many of the attacks are correct, and FP is false positive, that is, how many of the attacks are wrong. Because a single HPC (L1 miss rate, LLC miss rate, etc.) detection, the existence of load application will affect the value of HPC, resulting in the increase of FP, thereby reducing the accuracy Precision. Therefore, the dual-source information detection module also detects from the access pattern in the cache group to improve the detection accuracy.

[0037] Step 5, when the detection module detects the attack, the remapping defense module performs targeted local remapping defense according to the positioning of the access feature detection sub-module; if all memory to cache mapping relationships are modified, the running overhead will be increased, and it is unnecessary for most processes that do not attack or data in the cache. Only the cache group set that detects the attack needs to take defense measures, and the undetected one does not need to take defense measures. When the cache group set that attacks is located attack , according to the definition of label value, when label>0 and label≠label attack , it is possible to be attacked data, therefore, the new mapping relationship map′ is changed and encrypted by using the PRINCE encryption function, and the data of label>0 and label≠label attack in the set attack is mapped to the cache group that does not attack. For label=0 data, it does not need to be processed. The local remapping is defined as:

[0038] map′=PRINCE(set attack , address, label limit )

[0039] s.t.label limit >0 and label limit ≠label attack

[0040] Among them, map′ is the new mapping relationship, PRINCE is the encryption function, set attack is the cache group that attacks, address is the data address that needs to change the mapping, and label limitis the label of data, label attack is the label of attack process; when remapping occurs, the query time of cache will be increased because of locating to new cache group when querying data in cache; compared with global remapping which increases the query time of all data, local remapping only increases the query time of part of data, which can effectively improve the system running efficiency; performance overhead is defined as the instruction per CPU cycle (IPC), that is:

[0041]

[0042] Wherein, cycles is the executed CPU cycle, num inst is the executed instruction in cycles; after changing the mapping relationship, these data will be mapped to other cache groups, and the attack process cannot obtain the access information of the protected process, so that the Prime+Probe type attack is resisted.

[0043] Test results: the double-source information detection and local remapping defense method of cache side channel attack is realized by using Gem5 simulator, the detection effect is tested by using Prime+Probe, Flush+Reload and Flush+Flush three attack methods, the performance overhead of defense is tested by using splash2, and good experimental results are obtained. Compared with the existing detection method, the double-source information detection module is constructed to mine real-time attack information, and the attack detection accuracy Precision is improved; compared with the existing defense method, according to the positioning information, only the protected process and data are accurately mapped, and the system running efficiency IPC is effectively improved.

[0044] The above specific description further details the purpose, technical scheme and beneficial effects of the application, and it should be understood that the above description is only a specific embodiment of the application and is not used to limit the protection scope of the application, and any modification, equivalent replacement, improvement, etc. within the spirit and principle of the application should be included in the protection scope of the application.

Claims

1. A dual-source information detection and local remapping defense method for cache side-channel attacks, characterized in that The method comprises the following steps: Step 1, training process, collecting data of hardware performance counter, constructing data set containing HPC timing change, training neural network; Step 1.1, run attack process, victim process, and every time with 0, 3, 6 load process to simulate the real running environment, and collect HPC data f every τ time τ ; Step 1.2, construct a training data every τ time interval, and each training data contains HPC data data of the previous i+1 time intervals τ = {f τ-i ,..., f τ-1 , f τ}, construct a dataset containing HPC time series changes; Step 1.3, the training data is subjected to K-fold cross validation, and then the neural network model of the detection module is trained; Step 2, in the actual running process, the monitoring module assigns a label to each running process, and the process to be protected is applied, label>0, and the data read into the cache of each process also saves a label, equal to the label of the process; Step 3, in the running process, the monitoring module will detect whether there is a process with label>0 in real time, and when there is a process with label>0, the monitoring module will call the dual-source information detection module; Step 4, the dual-source information detection module comprises a performance feature detection submodule and an access feature detection submodule, if both submodules detect an attack at the same time, it is determined that an attack exists, and the cache group where the attack occurs is located, and the remapping defense module is called; Step 4.1, the performance feature detection submodule will collect HPC data f every τ time τ At the same time, a test set data τ Then use the pre-trained neural network model for detection to determine whether there is an attack; Step 4.2, the access feature detection submodule will monitor each cache group, and determine whether an attack exists in each cache group according to the defense mode in each cache group; Step 4.3, if both the performance feature detection submodule and the access feature detection submodule determine that an attack exists, it is determined that an attack exists, and the cache group where the attack occurs is located, and the remapping defense module is called; Step 5, when the detection module detects an attack, according to the positioning information, the label>0 data in the cache group where the attack occurs is mapped to the cache group where no attack occurs.

2. The method of double-source information detection and local remapping defense against Cache side-channel attacks according to claim 1, characterized in that: The double-source information detection module in step 4 judges whether an attack exists by using performance feature detection and access feature detection, the performance feature detection submodule collects HPC data f every τ time interval τ At the same time, a test set data τ ={f τ-i ,......f τ-1 , f τ} is constructed in the cache, and then a pre-trained neural network model is used for detection to determine whether an attack exists; The access feature detection sub-module monitors each cache group, and records the label that has most recently accessed the cache group access , and records the number of consecutive accesses num of the label access . If num access is greater than or equal to the associativity way of the cache, it is determined that the cache group is under attack. When both sub-modules determine that the cache group is under attack, it is determined that the cache group is under attack, and the cache groups set where the attack occurs are located attack , and the label of the attack process label attack = label access .

3. The method for dual-source information detection and local remapping defense against cache side-channel attacks according to claim 1, characterized in that: In step 5, local remapping defense is applied to the data in the attacked cache group that needs protection, instead of applying defense measures to the data in all cache groups. This is based on the attacking cache group located by the dual-source information detection module. attack and the label of the attack process attack A new mapping map′ is generated using the PRINCE encryption function, and this set is then... attack Within a group, label > 0 and label ≠ label attack The data is mapped to cache groups that have not been attacked, i.e., map′ = PRINCE(set attack address, label limit )stlabel limit >0 and label limit ≠label attack Where map′ is the new mapping relationship, PRINCE is the encryption function, and set attack This refers to the cache group where the attack occurred; address is the data address whose mapping needs to be changed; label... limit It is the label of the data, label attack It is a tag for attacking processes, preventing them from obtaining access information about protected processes and protected data, thus achieving a targeted defense against attacks.

Citation Information

Patent Citations

  • Processor vulnerability utilization threat detection method and device

    CN112464248A

  • Cache side channel attack detection method and device and electronic equipment

    CN113221118A