WO2019237863A1 - 一种非立即数跳转的保护方法及对应计算装置 - Google Patents

一种非立即数跳转的保护方法及对应计算装置 Download PDF

Info

Publication number
WO2019237863A1
WO2019237863A1 PCT/CN2019/086493 CN2019086493W WO2019237863A1 WO 2019237863 A1 WO2019237863 A1 WO 2019237863A1 CN 2019086493 W CN2019086493 W CN 2019086493W WO 2019237863 A1 WO2019237863 A1 WO 2019237863A1
Authority
WO
WIPO (PCT)
Prior art keywords
jump
address
value
immediate
instruction
Prior art date
Application number
PCT/CN2019/086493
Other languages
English (en)
French (fr)
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 杨力祥
Publication of WO2019237863A1 publication Critical patent/WO2019237863A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4482Procedural
    • G06F9/4484Executing subprograms
    • G06F9/4486Formation of subprogram jump address

Definitions

  • the present application relates to the field of information technology, and in particular, to a protection device and method for non-immediate number jumps, and a protection device and method for function pointers.
  • the present invention discloses a non-immediate jump protection method.
  • Hook functions are a representative of non-immediate jumps.
  • the present invention discloses a non-immediate jump
  • the method for protecting number jumps is characterized in that a non-immediate jump instruction is rewritten into an immediate jump instruction, so that the jump address is determined.
  • the manner of the immediate jump instruction refers to a manner of selecting a function to be called through condition judgment.
  • a method for protecting non-immediate jumps is characterized in that by preventing non-immediate jump instructions from being accessed illegally, a non-immediate jump instruction is checked before being executed. address.
  • the checking is performed by adding an instruction corresponding to the "judgment of the jump destination address" logic before the execution of the non-immediate jump instruction to check whether the jumped address is within the specified address set; if the jumped If the transferred address is within the entire set of addresses to which it may jump, non-immediate jump instructions are allowed to be executed; otherwise, the exception processing flow is entered.
  • a random ID value is generated correspondingly for each address in the set of addresses to which the non-immediate jump instruction may jump, and the ID is randomly selected within the entire integer range, and each ID value must be ensured They are not the same as each other, build a comparison table between the ID value and the jump target address, and use the ID value to assign a value to the pointer variable.
  • ID generation is performed when the system is initialized to ensure that the ID value corresponding to the same function is different each time the system is started.
  • the logic of "judging the jump target address” includes finding a matching jump target address value in the "ID value and jump target comparison table" according to the ID value. If the jump target address value cannot be found, Into the exception processing flow, if a matching jump target address value is found, the value is returned as the jump target address value of the jump instruction.
  • a non-immediate jump protection method characterized in that each random address in the set of addresses to which the non-immediate jump instruction may jump is correspondingly generated with a random ID value, and the ID is in the whole integer range. The values are randomly selected within the ID, and each ID value is to be different from each other.
  • a comparison table of the ID value and the jump target address is constructed, and the pointer variable is assigned a value using the ID value.
  • a non-immediate jump protection method is characterized in that a non-immediate jump instruction is added. When the CPU executes this instruction, it automatically recognizes whether the target address is an item in the specified address set. If it is, it is Legal operation, support execution, if not, report exception.
  • the non-immediate jump instruction no longer uses a jump address, but uses an ID value to identify the jump target, and the ID value establishes a one-to-one correspondence relationship with the jump target address and is recorded in a Lookup table.
  • a computing device is characterized by including a non-immediate jump instruction, which can automatically identify whether to jump to a specified address set and perform processing.
  • An improved method for a compiler is characterized in that when compiling a source file, an instruction corresponding to a target address judgment logic before a non-immediate jump instruction is automatically generated to ensure that the jumped address is within a specified address set.
  • the compiler recognizes the grammatical phenomenon of "assigning a function address to a pointer variable” and "calling a hook function"
  • the identifier is identified in the syntax tree, and the identified information is maintained to the target.
  • the compiler recognizes the grammatical phenomenon of "assigning a function address to a pointer variable" and "calling a hook function"
  • the identifier is identified in the syntax tree, and the identified information is maintained to the target.
  • each address in the set of addresses that may be jumped to is calculated, and a corresponding random ID value is generated correspondingly.
  • the ID is randomly selected within the entire integer range.
  • the ID values are different from each other.
  • a comparison table between the ID value and the jump destination address is constructed, and the pointer variable is assigned a value using the ID value. Based on this, the non-immediate jump instruction is automatically added to check the jump address. Logical corresponding instruction.
  • the present invention can have the following technical effects:
  • the attacker In the state of attack, the attacker cannot change the execution order of the program by modifying the target address value of the indirect transfer instruction, thereby gaining authorization beyond.
  • the present invention proposes a method for protecting non-immediate number jumps (including function pointers). Detailed descriptions are given below in conjunction with specific embodiments.
  • the jump address is determined.
  • a specific implementation manner is: rewriting all the hook function calls in the source code into a form of "selecting a function to call through condition judgment".
  • a specific implementation manner In the source program, first manually calculate the set of addresses that each non-immediate jump may correspond to, and the address of the instruction itself that performs the non-immediate jump, and then jump in the non-immediate jump. Add instructions before turning instructions to implement judgment logic. The content of this logic is to judge the address to be jumped to. If the address to be jumped is within the entire set of addresses to which it may jump, the following Non-immediate jump instructions, if not in the set, enter exception processing flow.
  • a preferred method is: by changing the compiler and linker, the target address judgment logic corresponding to the non-immediate jump instruction is automatically generated to ensure that the jumped address is within the specified address set. .
  • the compiler recognizes the syntax phenomenon of “assigning a function address to a pointer variable” and “calling a hook function”, it identifies them in the syntax tree. These The identified information is maintained until the target code generation phase. Based on this information, the address location of the non-immediate jump instruction and the set of addresses that may be jumped to can be identified, and based on this, the non-immediate jump instruction is generated. Before, automatically add the logic corresponding instruction to check the jump address, check whether the specified jump address is in the set of addresses that may be jumped to. If it is, continue to execute the jump instruction, and if it is exceeded, enter exception processing. Process, and finally in the linking phase, backfill the jump target address.
  • a preferred specific implementation method is:
  • each address in the set of addresses that may be jumped to is calculated, and a corresponding random ID value is generated correspondingly.
  • the ID is randomly selected within the entire integer range. It is necessary to ensure that each ID value Not the same, build a comparison table between the ID value and the jump target address, and use the ID value to assign a value to the pointer variable.
  • the automatically added check logic is changed to: call an independent function fun1, the parameter of this function is the ID value, the return value of this function is the destination address of the jump, and the content of this function is, according to the ID value, the "ID value and In the "Jump target comparison table", a matching jump target address value is found. If the jump target address value cannot be found, the exception processing flow is entered. If a matching jump target address value is found, the value is returned.
  • the jump target address value used in the jump instruction uses the address value returned by the fun1 function.
  • a preferred method is: the actual value of the ID is not filled in during the compilation phase, and the ID value is randomly generated each time the system is initialized to ensure that each ID value is different from each other. This method can make the attacker unable to know the specific ID value corresponding to each function.
  • a specific implementation manner is that: in the newly added non-immediate branch instruction, the jump address is no longer used, but an ID value is used to identify the jump target. This ID value has a one-to-one correspondence with the destination address of the jump and is recorded in a lookup table.
  • the generation manner of this comparison table is consistent with the generation manner and meaning of "constructing a comparison table of ID values and jump destination addresses" described in the embodiment 2.
  • the first address of the lookup table is stored in a specific register of the CPU. When the CPU executes the jump instruction, it looks up the corresponding jump address value in the lookup table by the ID value. If a matching jump address value is found, the address is determined according to the address. Value jump, if no matching jump address value is found, an exception is generated.
  • An improved method for a compiler is characterized in that when compiling a source file, an instruction corresponding to a target address judgment logic before a non-immediate jump instruction is automatically generated to ensure that the jumped address is within a specified address set.
  • a specific implementation manner is that during the parsing process, when the compiler recognizes the grammatical phenomenon of "assigning a function address to a pointer variable" and “calling a hook function", it identifies them in the syntax tree. The information is maintained until the target code generation stage. Based on this information, the address location of the non-immediate jump instruction and the set of addresses that may be jumped to can be identified. Based on this, before generating the non-immediate jump instruction, Automatically add a logic corresponding instruction to check the jump address.
  • the compiler recognizes the grammatical phenomenon of "assigning a function address to a pointer variable" and "calling a hook function"
  • the identifier is identified in the syntax tree, and the identified information is maintained to the target.
  • each address in the set of addresses that may be jumped to is calculated, and a corresponding random ID value is generated correspondingly.
  • the ID is randomly selected within the entire integer range.
  • the ID values are different from each other.
  • a comparison table between the ID value and the jump destination address is constructed, and the pointer variable is assigned a value using the ID value. Based on this, the non-immediate jump instruction is automatically added to check the jump address. Logical corresponding instruction.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Storage Device Security (AREA)
  • Devices For Executing Special Programs (AREA)

Abstract

一种非立即数跳转的保护方法,涉及信息技术,特别是信息安全领域,可以采用将非立即数跳转指令改写为立即数跳转指令的方式,或通过在非立即数跳转指令执行前进行检查的方式,或增设一种非立即数跳转指令的方式来实现。应用本方法,攻击状态下,攻击程序无法通过修改间接转移指令目标地址值的方式,改变程序的执行序。

Description

一种非立即数跳转的保护方法及对应计算装置 技术领域
本申请涉及信息技术领域,特别涉及一种非立即数跳转的保护装置和方法,以及一种函数指针的保护装置和方法。
背景技术
现有技术中,计算机软件由指令和数据组成,所有的计算、操作都是执行指令来实现,一条指令只能执行一个极小的动作单元,如:加、减、乘、除,移动数据,中断……,这些动作太小。若要完成一个对人有意义的任务,就需要连续执行一系列指令,以下称为指令执行序列,简称执行序。显然一个确定的执行序能够实现一个确定的功能。包括操作系统在内的所有软件,都是由许许多多有着确定功能的执行序组成。
基于现代的CPU架构和操作系统架构,以及对代码段使用只读保护等技术手段,已经杜绝了诸如用户态的攻击代码企图直接执行内核态代码、直接修改内核态代码、数据获得超越授权等操作。进一步的,由于硬件特权级以及门机制对于目标地址的严格保护,用户态的程序也无法直接从内核中选择对攻击有利的目标地址形成攻击者希望的执行序。
从信息安全角度看,数据不是指令,本身不具有执行能力,无法直接形成执行序,所以不具有攻击力。但是,攻击者仍然能够采用间接的方式实现攻击。例如,可以利用超越范围的数组拷贝,数组下标操作导致的数组越界等方法用 攻击者准备好的数据修改指向函数的指针,即钩子函数(hook),或者将钩子修改为原设计的几个可能的之中的某一个值,但该值不是当时合理的值,而是在当时条件下有利于攻击的一个值。对于信息安全领域来说,攻击者就能够从可能的分支中选择有利于攻击的分支。
在此基础上,攻击者就可以修改授权信息、改变授权状态,从而获得超越授权的状态。进而可以进行诸如以下操作:
1、超越授权读取用户数据(包括内存和外设的数据)。
2、超越授权写入(包括篡改、删除)用户数据。
3、超越授权执行系统调用。
4、超越授权执行应用程序。
发明内容
为解决攻击者能够从可能分支中选择有利于攻击的分支,进而获得超越授权的状态的技术问题,本发明公开了非立即数跳转的保护方法。
钩子函数是非立即数跳转的一种代表。
在本发明的一种具体实现方式中,针对非立即数跳转在受到攻击的情况下,能够使得攻击者从可能的分支中选择有利于攻击的分支的问题,本发明公开了一种非立即数跳转的保护方法,其特征在于:将非立即数跳转指令改写为立即数跳转指令的方式,使跳转地址确定。
所述立即数跳转指令的方式是指通过条件判断,选择函数进行调用的方式。
在本发明的一种具体实现方式中,一种非立即数跳转的保护方法,其特征在于:通过在非立即数跳转指令执行前进行检查的方式,防止非立即数跳转指 令访问非法地址。
优选的,所述进行检查是通过在非立即数跳转指令执行前添加“对跳转目标地址进行判断”逻辑对应的指令,检查跳转的地址是否在指定的地址集合内;如果所述跳转的地址处于其可能跳转到的全部地址集合内,则允许执行非立即数跳转指令,否则,则进入异常处理流程。
优选的,将所述非立即数跳转指令可能跳转到的地址集合中的每一个地址,对应的生成一个随机ID值,ID在整个整数范围内随机取值,且要确保每个ID值彼此不相同,构建一个ID值与跳转目标地址的对照表,并用ID值给指针变量赋值。
优选的,ID的生成,在系统初始化的时候进行,确保每次开机运行,同一个函数对应的ID值都不同。
所述“对跳转目标地址进行判断”的逻辑包括根据ID值,在“ID值与跳转目标对照表”中,找到匹配的跳转目标地址值,如果找不到跳转目标地址值,进入异常处理流程,如果找到匹配的跳转目标地址值,就返回该值作为跳转指令的跳转目标地址值。
一种非立即数跳转的保护方法,其特征在于:将所述非立即数跳转指令可能跳转到的地址集合中的每一个地址,对应的生成一个随机ID值,ID在整个整数范围内随机取值,且要确保每个ID值彼此不相同,构建一个ID值与跳转目标地址的对照表,并用ID值给指针变量赋值。
一种非立即数跳转的保护方法,其特征在于:增设一种非立即数跳转指令,CPU执行此指令时,自动识别目标地址是否为指定地址集合中的一项,如果是,则为合法操作,支持执行,如不是,报异常。
优选的,所述非立即数跳转指令不再用跳转地址,而是用ID值来标识跳转目标,且所述ID值与跳转的目标地址建立一一对应关系,并记录于一个对照表内。
一种计算装置,其特征在于:包括一种非立即数跳转指令,所述指令能够自动识别是否跳转到指定的地址集合内,并作出处理。
一种编译器的改进方法,其特征在于:在编译源文件时,自动生成非立即数跳转指令前的目标地址判断逻辑对应的指令,以确保跳转的地址在指定的地址集合内。
优选的,在语法分析过程中,编译器在识别到具有“将函数地址赋值给指针变量”以及“调用钩子函数”的语法现象时,在语法树中进行标识,这些标识的信息一直保持到目标代码生成阶段,根据这些信息,就可以识别出非立即数跳转指令的地址位置,以及可能跳转到的地址集合,并据此,在生成非立即数跳转指令前,自动添加对跳转地址进行检查的逻辑对应的指令。
优选的,在语法分析过程中,编译器在识别到具有“将函数地址赋值给指针变量”以及“调用钩子函数”的语法现象时,在语法树中进行标识,这些标识的信息一直保持到目标代码生成阶段,在目标代码生成阶段,将统计出来的可能跳转到的地址集合中每一个地址,对应的生成一个对应的随机ID值,ID在整个整数范围内随机取值,要确保每个ID值彼此不相同,构建一个ID值与跳转目标地址的对照表,并用ID值给指针变量赋值,并据此,在生成非立即数跳转指令前,自动添加对跳转地址进行检查的逻辑对应的指令。
通过上述技术方案,本发明能够具备以下技术效果:
攻击状态下,攻击程序无法通过修改间接转移指令目标地址值的方式,改 变程序的执行序,进而获得超越授权。
具体实施方式
下面将结合实施例,对本发明中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
针对现有技术的问题,本发明提出了一种非立即数跳转(包括函数指针)的保护方法。以下结合具体实施例进行详细说明。
实施例1:
通过把非立即数跳转指令改写为立即数跳转指令的方式,确定跳转的地址。
一个具体的实施方式是:将源代码中所有钩子函数的调用,改写为“通过条件判断,选择函数进行调用”的形式。
在现有编译、链接体系下,钩子函数的调用最终会生成非立即数跳转指令,经过这样的改动,最终会生成立即数跳转指令。
实施例2:
通过在非立即数跳转指令执行前添加“对跳转目标地址进行判断”逻辑对应的指令的方式,检查跳转的地址是否在指定的地址集合内,并作出相应处理。
一种具体的实施方式:在源程序中,先人工统计出每一个非立即数的跳转可能对应的地址集合,以及进行非立即数跳转的指令本身所在的地址,之后在 非立即数跳转指令前添加指令,实现判断逻辑,此逻辑的内容是:对将要跳转到的地址进行判断,如果将要跳转到的地址处于其可能跳转到的全部地址集合内,则允许执行后面的非立即数跳转指令,如果不在集合内,则进入异常处理流程。
为了提高工作效率,一种优选的方式是:通过更改编译器和链接器,自动生成非立即数跳转指令前的目标地址判断逻辑对应的指令,以确保跳转的地址在指定的地址集合内。
进一步的,一种具体的实施方式:在语法分析过程中,编译器在识别到具有“将函数地址赋值给指针变量”以及“调用钩子函数”的语法现象时,在语法树中进行标识,这些标识的信息一直保持到目标代码生成阶段,根据这些信息,就可以识别出非立即数跳转指令的地址位置,以及可能跳转到的地址集合,并据此,在生成非立即数跳转指令前,自动添加对跳转地址进行检查的逻辑对应的指令,检查内容为指定的跳转地址是否在可能跳转到的地址集合内,如果在,继续执行跳转指令,如果超出,进入异常处理流程,最后在链接阶段,将跳转目标地址回填。
为了加大在攻击状态下目标跳转地址被更改的难度,一种优选的具体的实施方式是:
在语法分析过程中,编译器在识别到具有“将函数地址赋值给指针变量”以及“调用钩子函数”的语法现象时,在语法树中进行标识,这些标识的信息一直保持到目标代码生成阶段,在目标代码生成阶段,将统计出来的可能跳转到的地址集合中每一个地址,对应的生成一个对应的随机ID值,ID在整个整数范围内随机取值,要确保每个ID值彼此不相同,构建一个ID值与跳转目标地址的对照表,并用ID值给指针变量赋值。自动添加的检查逻辑改为:调用一个 独立的函数fun1,此函数的参数为ID值,此函数的返回值为跳转的目标地址,此函数的内容为,根据ID值,在“ID值与跳转目标对照表”中,找到匹配的跳转目标地址值,如果找不到跳转目标地址值,进入异常处理流程,如果找到匹配的跳转目标地址值,就返回该值。跳转指令中用到的跳转目标地址值,就使用fun1函数返回的地址值。
一种优选的方式为:不在编译阶段填写ID的实际值,在系统每次初始化时,随机生成ID值,确保每个ID值彼此不相同。这种方式可以使攻击程序无法固定的获知每个函数所对应的具体ID值。
实施例3:
增设新的非立即数转移指令,CPU执行此指令时,自动识别是否跳转到指定的地址集合内,并作出硬件处理。
一个具体的实施方式是:在增设的非立即数的转移指令中,不再用跳转地址,而是用ID值来标识跳转目标。此ID值与跳转的目标地址建立一一对应关系,并记录于一个对照表内。此对照表的生成方式与实施例2中所述“构建一个ID值与跳转目标地址的对照表”的生成方式及含义一致。把对照表的首地址存储在CPU的特定寄存器中,CPU在执行跳转指令时,通过ID值,在对照表中查找对应的跳转地址值,如果找到匹配的跳转地址值,就按照地址值进行跳转,如果没有找到匹配的跳转地址值,就产生异常。
实施例4:
一种编译器的改进方法,其特征在于:在编译源文件时,自动生成非立即数跳转指令前的目标地址判断逻辑对应的指令,以确保跳转的地址在指定的地址集合内。
一种具体的实施方式是,在语法分析过程中,编译器在识别到具有“将函 数地址赋值给指针变量”以及“调用钩子函数”的语法现象时,在语法树中进行标识,这些标识的信息一直保持到目标代码生成阶段,根据这些信息,就可以识别出非立即数跳转指令的地址位置,以及可能跳转到的地址集合,并据此,在生成非立即数跳转指令前,自动添加对跳转地址进行检查的逻辑对应的指令。
优选的,在语法分析过程中,编译器在识别到具有“将函数地址赋值给指针变量”以及“调用钩子函数”的语法现象时,在语法树中进行标识,这些标识的信息一直保持到目标代码生成阶段,在目标代码生成阶段,将统计出来的可能跳转到的地址集合中每一个地址,对应的生成一个对应的随机ID值,ID在整个整数范围内随机取值,要确保每个ID值彼此不相同,构建一个ID值与跳转目标地址的对照表,并用ID值给指针变量赋值,并据此,在生成非立即数跳转指令前,自动添加对跳转地址进行检查的逻辑对应的指令。
以上所述仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。凡在本发明的精神和原则之内所作的任何修改、等同替换、改进等,均包含在本发明的保护范围内。

Claims (15)

  1. 一种非立即数跳转的保护方法,其特征在于:将非立即数跳转指令改写为立即数跳转指令的方式,使跳转地址确定。
  2. 根据权利要求1所述的方法,其特征在于:所述立即数跳转指令的方式是指通过条件判断,选择函数进行调用的方式。
  3. 一种非立即数跳转的保护方法,其特征在于:通过在非立即数跳转指令执行前进行检查的方式,防止非立即数跳转指令访问非法地址。
  4. 根据权利要求3所述的方法,其特征在于:所述进行检查是通过在非立即数跳转指令执行前添加用于完成“对跳转目标地址进行判断”这一逻辑的指令,检查跳转的地址是否在指定的地址集合内。
  5. 根据权利要求4所述的方法,其特征在于:如果所述跳转的地址处于其可能跳转到的全部地址集合内,则允许执行非立即数跳转指令,否则,则进入异常处理流程。
  6. 根据权利要求3-5之一所述的方法,其特征在于:将所述非立即数跳转指令可能跳转到的地址集合中的每一个地址,对应的生成一个对应的随机ID值,ID在整个整数范围内随机取值,且要确保每个ID值彼此不相同,构建一个ID值与跳转目标地址的对照表,并用ID值给指针变量赋值。
  7. 根据权利要求6所述的方法,其特征在于:所述“对跳转目标地址进行判断”的逻辑包括根据ID值,在“ID值与跳转目标对照表”中,找到匹配的跳转目标地址值,如果找不到跳转目标地址值,进入异常处理流程,如果找到匹配的跳转目标地址值,就返回该值作为跳转指令的跳转目标地址值。
  8. 一种非立即数跳转的保护方法,其特征在于:将所述非立即数跳转指令可能跳转到的地址集合中的每一个地址,对应的生成一个随机ID值,ID在整个整数范围内随机取值,且要确保每个ID值彼此不相同,构建一个ID值与跳转 目标地址的对照表,并用ID值给指针变量赋值。
  9. 一种非立即数跳转的保护方法,其特征在于:增设一种非立即数跳转指令,CPU执行此指令时,自动识别是否跳转到指定的地址集合内,并作出处理。
  10. 根据权利要求9所述的方法,其特征在于:所述非立即数跳转指令不再用跳转地址,而是用ID值来标识跳转目标,且所述ID值与跳转的目标地址建立一一对应关系,并记录于一个对照表内。
  11. 一种计算装置,其特征在于:包括一种非立即数跳转指令,所述指令能够自动识别是否跳转到指定的地址集合内,并作出处理。
  12. 一种计算装置,其特征在于:使用权利要求1-10之一所述的方法。
  13. 一种编译器的改进方法,其特征在于:在编译源文件时,自动生成非立即数跳转指令前的目标地址判断指令,以确保跳转的地址在指定的地址集合内。
  14. 根据权利要求13所述的方法,其特征在于:在语法分析过程中,编译器在识别到具有“将函数地址赋值给指针变量”以及“调用钩子函数”的语法现象时,在语法树中进行标识,这些标识的信息一直保持到目标代码生成阶段,根据这些信息,就可以识别出非立即数跳转指令的地址位置,以及可能跳转到的地址集合,并据此,在生成非立即数跳转指令前,自动添加对跳转地址进行检查的逻辑对应的指令。
  15. 根据权利要求13所述的方法,其特征在于:在语法分析过程中,编译器在识别到具有“将函数地址赋值给指针变量”以及“调用钩子函数”的语法现象时,在语法树中进行标识,这些标识的信息一直保持到目标代码生成阶段,在目标代码生成阶段,将统计出来的可能跳转到的地址集合中每一个地址,对应的生成一个对应的随机ID值,ID在整个整数范围内随机取值,要确保每个 ID值彼此不相同,构建一个ID值与跳转目标地址的对照表,并用ID值给指针变量赋值,并据此,在生成非立即数跳转指令前,自动添加对跳转地址进行检查的逻辑对应的指令。
PCT/CN2019/086493 2018-06-12 2019-05-11 一种非立即数跳转的保护方法及对应计算装置 WO2019237863A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810597845.1A CN110597571A (zh) 2018-06-12 2018-06-12 一种非立即数跳转的保护方法及对应计算装置
CN201810597845.1 2018-06-12

Publications (1)

Publication Number Publication Date
WO2019237863A1 true WO2019237863A1 (zh) 2019-12-19

Family

ID=68842778

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/086493 WO2019237863A1 (zh) 2018-06-12 2019-05-11 一种非立即数跳转的保护方法及对应计算装置

Country Status (2)

Country Link
CN (1) CN110597571A (zh)
WO (1) WO2019237863A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20230099751A1 (en) 2020-03-17 2023-03-30 Nec Corporation Processing apparatus, security control method, and non-transitory computerreadable medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101373501A (zh) * 2008-05-12 2009-02-25 公安部第三研究所 针对计算机病毒的动态行为捕获方法
CN104573484A (zh) * 2014-12-31 2015-04-29 上海动联信息技术股份有限公司 一种高安全性密码口令框

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101309149B (zh) * 2008-06-30 2012-05-23 成都市华为赛门铁克科技有限公司 一种地址处理方法和装置
US20100095281A1 (en) * 2008-10-14 2010-04-15 Riverside Research Institute Internal Function Debugger
CN102651060B (zh) * 2012-03-31 2015-05-06 北京奇虎科技有限公司 一种漏洞检测的方法和系统
CN106095416B (zh) * 2016-06-01 2020-10-09 腾讯科技(深圳)有限公司 一种在应用程序中的跳转处理方法、装置及智能终端
CN107943517A (zh) * 2017-10-26 2018-04-20 北京奇虎科技有限公司 终端应用的挂钩方法及装置

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101373501A (zh) * 2008-05-12 2009-02-25 公安部第三研究所 针对计算机病毒的动态行为捕获方法
CN104573484A (zh) * 2014-12-31 2015-04-29 上海动联信息技术股份有限公司 一种高安全性密码口令框

Also Published As

Publication number Publication date
CN110597571A (zh) 2019-12-20

Similar Documents

Publication Publication Date Title
Kornau Return oriented programming for the ARM architecture
Wang et al. Undefined behavior: what happened to my code?
CN108027737B (zh) 通过二进制和存储器多样性进行混淆的系统和方法
US9483635B2 (en) Methods, systems, and computer readable medium for active monitoring, memory protection and integrity verification of target devices
US6694457B2 (en) System and method for monitoring execution of privileged instructions
KR20130036189A (ko) 하드웨어 모드와 보안 플래그에 의존하여 판독된 명령어에 대한 메모리 영역의 제한
US10528729B2 (en) Methods and systems for defending against cyber-attacks
JP7432586B2 (ja) スタック・ポインタを検証すること
CN108154032A (zh) 一种基于可信执行环境的具有内存完整性保障功能的计算机系统信任根构建方法
US9536084B1 (en) Systems and methods for delivering event-filtered introspection notifications
CN104715202A (zh) 一种虚拟机中的隐藏进程检测方法和装置
Denis-Courmont et al. Camouflage: Hardware-assisted CFI for the ARM Linux kernel
CN115510430A (zh) 一种函数指针及其数据依赖的识别与保护方法、装置
CN116150739A (zh) 一种基于关键地址动态保护的栈溢出自动防御方法
Grossklags et al. τcfi: Type-assisted control flow integrity for x86-64 binaries
Wheeler Countering trusting trust through diverse double-compiling
WO2019237863A1 (zh) 一种非立即数跳转的保护方法及对应计算装置
US11868466B2 (en) Apparatus and method for enforcing hardware-assisted memory safety
US9531735B1 (en) Systems and methods for delivering introspection notifications from a virtual machine
Shapiro et al. {“Weird}{Machines”} in {ELF}: A Spotlight on the Underappreciated Metadata
WO2018235858A1 (ja) 情報処理監視装置、情報処理監視方法、プログラム、記録媒体及び情報処理装置
WO2019237864A1 (zh) 一种安全用户架构及权限控制方法
US11216280B2 (en) Exception interception
Geden et al. RegGuard: Leveraging CPU registers for mitigation of control-and data-oriented attacks
CN109388948A (zh) 一种基于虚拟化技术的潜在恶意软件分析方法及相关装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19819183

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19819183

Country of ref document: EP

Kind code of ref document: A1