Hardware technology that actively defends against buffer overflow attacks

Source: Internet
Author: User

Claim for rights
 
1. The processor instruction encoding can be redefined by replacing the pre-defined instruction encoding definition of the processor with the custom instruction encoding definition so that the processor can decode and execute the instruction, use custom instruction encoding to define decoding and execution instructions.
 
2. The processor instruction encoding redefinition method described in claim 1 is characterized by setting the instruction encoding register with the same number of commands in the system instruction set inside the processor, each instruction encoding register corresponds to one instruction encoding definition, and then all the instruction encoding definitions are customized by the user, then, the loaded instruction encoding command loads the custom instruction encoding definitions to the corresponding instruction encoding registers, the custom instruction encoding definition replaces the pre-defined instruction encoding definition of the processor, so that the processor can use the User-Defined instruction encoding to define decoding and executing instructions during Instruction Decoding and execution.
 
3. The processor instruction encoding redefinition method described in claim 1 is characterized: in the processor, set the number of instruction code registers that are the same as the number of operation codes, address codes, function codes, register codes, and condition codes in the system instruction set. Each instruction code register corresponds to one instruction code definition, then, the user defines all the instruction codes. Then, the loaded instruction code command loads the custom instruction encoding definitions to the corresponding instruction encoding registers, the custom instruction encoding definition replaces the pre-defined instruction encoding definition of the processor, so that the processor can use the User-Defined instruction encoding to define decoding and executing instructions during Instruction Decoding and execution.
 
4. The processor instruction encoding redefinition method described in claim 1 is characterized by the execution of instructions within the processor being interpreted and executed by microinstructions, and several microinstructions forming a microprogram, when a microprogram corresponds to an instruction code, all the instruction codes customized by the user are defined, and then all the Microprograms are re-compiled to explain and execute the instructions defined by the user, then update all the re-compiled Microprograms. The custom instruction encoding definition replaces the pre-defined instruction encoding definition of the processor so that the processor can decode and execute the instruction, use custom instruction encoding to define decoding and execution instructions.
 
5. The processor instruction encoding redefinition method described in claim 2 or 3 is characterized by the addition of an instruction in the instruction set to load the instruction encoding, it is used to load User-Defined instruction codes to all instruction encoding registers.
 
 
 
Manual
 
 
Method for redefinition of processor instruction Encoding
 
Technical Fields
 
The invention relates to a method in which a processor can redefine instruction encoding.
 
Background Technology
 
Currently, the commonly known processor executes commands in the following way: processor from PC (Instruction Address Register) in the memory address to which it is directed, fetch, decode, execute, access to memory, write back, update PC (set the address of the next instruction), and then extract the next instruction, so that the next instruction is executed one by one. The instruction encoding used for decoding and execution is pre-defined by the processor. During execution, if the program segment is vulnerable to buffer overflow attacks or other attacks and modifications, the program will execute unexpected functions, such as viruses or Trojans. The existing processor cannot identify the program segment that has been maliciously modified, so it cannot prevent buffer overflow attacks, virus attacks, and Trojan attacks.
 
Invention content
 
To overcome the inability of the existing processor to distinguish between valid and illegal instruction flows, the invention provides a method for redefinition of instruction codes, this method can block legal and illegal command streams.
 
The invention adopts the following technical solutions to solve technical problems:
 
The processor instruction encoding can be redefined. The custom instruction encoding definition replaces the pre-defined instruction encoding definition of the processor, so that when the processor decodes and executes the instruction, use custom instruction encoding to define decoding and execution instructions.
 
In the processor, set the same number of instruction encoding registers as the number of commands in the system instruction set. Each instruction encoding register corresponds to one instruction encoding definition, and then all the instruction encoding definitions are customized by the user, then, the loaded instruction encoding command loads the custom instruction encoding definitions to the corresponding instruction encoding registers, the custom instruction encoding definition replaces the pre-defined instruction encoding definition of the processor, so that the processor can use the User-Defined instruction encoding to define decoding and executing instructions during Instruction Decoding and execution.
 
In the processor, set the number of instruction code registers that are the same as the number of operation codes, address codes, function codes, register codes, and condition codes in the system instruction set. Each instruction code register corresponds to one instruction code definition, then, the user defines all the instruction codes. Then, the loaded instruction code command loads the custom instruction encoding definitions to the corresponding instruction encoding registers, the custom instruction encoding definition replaces the pre-defined instruction encoding definition of the processor, so that the processor can use the User-Defined instruction encoding to define decoding and executing instructions during Instruction Decoding and execution.
 
In a processor, commands are interpreted and executed by micro-commands. Several Micro-commands constitute a micro-program. When a micro-program corresponds to a single instruction code, all user-defined instruction codes are defined, then rewrite all the Microprograms so that they can interpret and execute the custom instruction encoding definition, and then update all the re-compiled Microprograms, the custom instruction encoding definition replaces the pre-defined instruction encoding definition of the processor, so that the processor can use the User-Defined instruction encoding to define decoding and executing instructions during Instruction Decoding and execution.
 
As can be seen from the above scheme, the invention replaces the pre-defined instruction encoding definition of the processor with the User-Defined instruction encoding definition, and the user-defined instruction encoding can have many combinations, when the program segment is modified by malicious code, the external instruction code is inconsistent with the instruction code executed by the processor, resulting in the abnormal execution of the external instruction code stream, this effectively prevents buffer overflow attacks, viruses, and Trojans.
 
Implementation Method
 
Existing computer systems use the "one-time compilation and run everywhere" method. All processors on the same platform only execute one predefined fixed instruction code, the invention introduces the processor instruction code redefinition method into the computer system, thus breaking the preceding method.
 
The invention is further described in the following examples.
 
Example 1
 
In the www.2cto.com processor, set the same number of instruction encoding registers as the number of commands in the system instruction set. Each instruction encoding register corresponds to one instruction encoding definition, and then all the instruction encoding definitions are customized by the user, then, the loaded instruction encoding command loads the custom instruction encoding definitions to the corresponding instruction encoding registers, the custom instruction encoding definition replaces the pre-defined instruction encoding definition of the processor, so that the processor can use the User-Defined instruction encoding to define decoding and executing instructions during Instruction Decoding and execution. In this way, the processor runs on the user-defined machine language (instruction code). Then, the original machine commands of the computer program are translated into machine commands of the User-Defined encoding, run the program that translates machine commands translated into user-defined codes. In this way, the entire computer system runs on a completely new set of user-defined machine languages (Instruction encoding.
 
For example, when the encoding of a command in a command set is defined as 01010101, the encoding of the command is defined as 11111111, then, the loaded instruction encoding command loads the custom instruction encoding definition to the corresponding instruction encoding register, the custom instruction code definition replaces the pre-defined instruction code definition of the processor.
 
Example 2
 
In the processor, set the number of instruction code registers that are the same as the number of operation codes, address codes, function codes, register codes, and condition codes in the system instruction set. Each instruction code register corresponds to one instruction code definition, then, the user defines all the instruction codes. Then, the loaded instruction code command loads the custom instruction encoding definitions to the corresponding instruction encoding registers, the custom instruction encoding definition replaces the pre-defined instruction encoding definition of the processor, so that the processor can use the User-Defined instruction encoding to define decoding and executing instructions during Instruction Decoding and execution. In this way, the processor runs on the user-defined machine language (instruction code). Then, the original machine commands of the computer program are translated into machine commands of the User-Defined encoding, run the program that translates machine commands translated into user-defined codes. In this way, the entire computer system runs on a completely new set of user-defined machine languages (Instruction encoding.
 
For example, in a processor, when the original operation code of a command in a command set is 0101 and the address code is 0101, corresponding to the operation code and address code, the User-Defined operation code is 1111 and the address code is 1111, the user-defined operation code and address code are loaded from the loaded instruction encoding command to the corresponding instruction encoding register. The user-defined encoding instruction definition replaces the original instruction encoding definition of the processor,
 
Example 3
 
In a processor, commands are interpreted and executed by micro-commands. Several Micro-commands constitute a micro-program. When a micro-program corresponds to a single instruction code, all user-defined instruction codes are defined, then rewrite all the Microprograms so that they can interpret and execute the custom instruction encoding definition, and then update all the re-compiled Microprograms, replace the pre-defined instruction encoding definition of the processor with the custom instruction encoding definition. Enable the processor to define decoding and executing commands using user-defined instruction encoding when decoding and executing commands. In this way, the processor runs on the user-defined machine language (instruction code). Then, the original machine commands of the computer program are translated into machine commands of the User-Defined encoding, run the program that translates machine commands translated into user-defined codes. In this way, the entire computer system runs on a completely new set of user-defined machine languages (Instruction encoding.
 
For example, in a processor, when the original operation code of a command in a command set is 0101 and the address code is 0101, corresponding to the operation code and address code, the User-Defined operation code is 1111 and the address code is 1111, re-compile the microprogram so that it can interpret and execute the operation code and address code customized by the user, and then update the microprogram of the operation code and address code customized by the user, the operation code and address Code defined by the user replaces the original operation code and address code definition of the processor.
 
As shown in the preceding example, when the computer system is under buffer overflow attacks, virus attacks, and Trojan attacks) it is inconsistent with the machine language (Instruction Code) of the local computer system, so that external program segments cannot be normally executed, effectively protecting the local computer system.
 
 
Postscript
 
 
 
 
 
On a system with segment-based memory management, you can also specify to run different instruction codes in different segments and pages, so that each program segment can be isolated and run, in addition, different instruction codes can be run on each page. After implementation, the system segments and program segments are isolated for operation, effectively protecting the system from buffer overflow attacks.
 
I am involved in the Processor field for the first time. Please laugh at the joke.
 
You are welcome to make a brick.
 
Email: aeec-mark@163.com
QQ: 499186231

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.