Method and system for safely using cross-bus-domain virtual equipment, terminal and medium
By controlling the bridge's identity authentication and data encryption and decryption methods, the problem of insufficient security of virtual devices across PC Ie bus domains is solved, and the safe use of virtual devices in multiple computing tasks is realized.
Patent Information
- Application Number
- CN202410548989.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-06
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2044-05-06
AI Technical Summary
It is difficult to ensure security when using virtual devices across PC Ie bus domains. In particular, borrowed devices cannot be used for secure computing, leading to data leakage.
By controlling the bridge, it enters the initialization state after power-on, and enters the available state after completing the initialization. After receiving the instruction to start the security task, it enters the authentication state for identity authentication, obtains the communication key, and pairs the output and input data based on the key. Encrypt and decrypt to ensure data security.
The security status management of virtual devices is implemented, so that the virtual devices can be used for ordinary computing tasks and secure computing tasks, ensuring the security of computing tasks.
Smart Images

Figure CN118673496A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of device virtualization technology, and in particular to a method, system, terminal and medium for securely using a virtual device across bus domains. Background Art
[0002] PCIe device virtualization is usually the process of emulating and managing physical PCIe devices in a virtual machine environment under only one PCIe bus domain. Virtualizing PCIe devices allows virtual machines to access and use these devices as if they were directly connected to the virtual machine.
[0003] Currently, PCIe devices across PCIe bus domains (two or more host systems) can expose access interfaces to each other through PCIe NTB (Non-Transparent Bridge), such as interrupts, BARs, and DMA execution. However, it is difficult to ensure the security of virtual PCIe devices across bus domains, especially borrowed devices cannot be used for secure computing, resulting in data leakage.
[0004] Therefore, the prior art still needs to be improved and enhanced. Summary of the invention
[0005] The technical problem to be solved by the present invention is to provide a method, system, terminal and medium for securely using a virtual device across bus domains in view of the above-mentioned defects of the prior art. The technical solution adopted by the present invention is as follows:
[0006] In a first aspect, the present invention provides a method for securely using a virtual device across bus domains, wherein the method comprises:
[0007] When the control bridge is powered on, it enters the initialization state, and after completing the initialization, the control bridge enters the usable state;
[0008] After receiving the instruction to start the safety task, the control bridge enters the authentication state, performs identity authentication of the control bridge in the authentication state, and obtains the communication key;
[0009] Entering the running security task state, based on the communication key, the control bridge encrypts all data output to the device lender bus and decrypts all data input from the device lender bus.
[0010] In one implementation, the method further includes:
[0011] After receiving the command to start the non-safety task, it enters the running non-safety task state;
[0012] When in the running non-safety task state, the control bridge stops using any safety functions.
[0013] In one implementation, when the control bridge is powered on, it enters an initialization state, and after the initialization is completed, the control bridge enters an available state, including:
[0014] Complete the trusted boot, wherein the trusted boot includes: checking necessary parameters, and if firmware or software exists, measuring the firmware and software;
[0015] After the trusted boot is successful, the boot flag is established and the connected virtual device is ensured to be reset normally;
[0016] The connection bridge obtains the authentication public key from the control bridge, and after the startup flag is valid and the initialization completion instruction is received, the control bridge enters an available state.
[0017] In one implementation, performing identity authentication of the control bridge in the authentication state and obtaining a communication key includes:
[0018] The equipment borrower completes the identity authentication of the control bridge by remote authentication or identity authentication through the connection bridge;
[0019] The equipment borrower requests a safety status report from the control bridge through the connection bridge;
[0020] After receiving the request for the security status report, the control bridge locks the security-related configuration parameters, and uses the locked parameters as part of the security status report. The security status report is signed using the authentication private key and then sent to the device borrower.
[0021] In one implementation, performing identity authentication of the control bridge in the authentication state and obtaining a communication key includes:
[0022] After receiving the security status report, the equipment borrower uses the control bridge's authentication public key to verify the signature;
[0023] After the signature verification is passed, the safety status report is evaluated to determine whether the control bridge is in a safe state;
[0024] Obtain the communication key based on the request of the device borrower.
[0025] In one implementation, obtaining the communication key according to the request of the device borrower includes:
[0026] The device borrower and the control bridge jointly negotiate the communication key;
[0027] or,
[0028] The communication key is directly distributed by the device borrower, and the device borrower encrypts the communication key using the authentication public key of the control bridge.
[0029] In one implementation, the method further includes:
[0030] If an error occurs in any state except the initialization state, the control bridge enters the error handling state;
[0031] Collecting error information in the error processing state and updating error state information in the control bridge;
[0032] After completing the collection and update of the error status information, the control bridge returns to the initialization state.
[0033] In a second aspect, an embodiment of the present invention further provides a system for the safe use of virtual devices across bus domains, wherein the system is applied to the method for the safe use of virtual devices across bus domains described in the above technical solution, and the system comprises: a device borrower, a device lender, a connection bridge and a control bridge, wherein the device borrower comprises a virtual device, the device lender comprises a virtualized device, the connection bridge is used to connect the buses corresponding to the device borrower and the device lender respectively, and the control bridge is used to connect the bus of the virtualized device and the bus of the device lender, wherein the control bridge comprises:
[0034] The initialization module is used to enter the initialization state when the control bridge is powered on, and after the initialization is completed, the control bridge enters the usable state;
[0035] The identity authentication module is used to control the bridge to enter an authentication state after receiving an instruction to start a safety task, perform identity authentication of the control bridge in the authentication state, and obtain a communication key;
[0036] The data encryption and decryption module is used to enter the running safety task state, and based on the communication key, the control bridge encrypts all data output to the device lender bus and decrypts all data input from the device lender bus.
[0037] In the third aspect, an embodiment of the present invention further provides a terminal, wherein the terminal includes a memory, a processor, and a cross-bus domain virtual device security use program stored in the memory and executable on the processor, and when the processor executes the cross-bus domain virtual device security use program, the steps of the cross-bus domain virtual device security use method of any one of the above-mentioned schemes are implemented.
[0038] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein a program for safely using a virtual device across bus domains is stored on the computer-readable storage medium, and when the program for safely using a virtual device across bus domains is executed by a processor, the steps of the method for safely using a virtual device across bus domains described in any one of the above-mentioned schemes are implemented.
[0039] Beneficial effects: Compared with the prior art, the present invention provides a method for safely using virtual devices across bus domains. The present invention first enters an initialization state after the control bridge is powered on, and after completing the initialization, the control bridge enters an available state. Then, after receiving the instruction to start the safety task, the control bridge enters an authentication state, in which the identity of the control bridge is authenticated and a communication key is obtained. Entering the running safety task state, based on the communication key, the control bridge encrypts all data output to the device lender bus and decrypts all data input from the device lender bus. The present invention implements security state management through the control bridge, so that the virtual device can be used for ordinary computing tasks as well as secure computing tasks, thereby ensuring the security of computing tasks. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 A flowchart of a preferred embodiment of a method for securely using a virtual device across bus domains provided in an embodiment of the present invention.
[0041] Figure 2 A structural diagram of a system for securely using virtual devices across bus domains provided by an embodiment of the present invention.
[0042] Figure 3 A finite state model diagram of a method for securely using a virtual device across bus domains provided by an embodiment of the present invention.
[0043] Figure 4 A functional block diagram of a terminal provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solution and effect of the present invention clearer and more specific, the present invention is further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0045] It will be understood by those skilled in the art that, unless expressly stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present invention refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be intermediate elements. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.
[0046] It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as generally understood by those skilled in the art in the art to which the present invention belongs. It should also be understood that terms such as those defined in general dictionaries should be understood to have meanings consistent with the meanings in the context of the prior art, and will not be interpreted with idealized or overly formal meanings unless specifically defined as herein.
[0047] This embodiment provides a method for secure use of virtual devices across bus domains. Based on the method of this embodiment, security status management is implemented through a control bridge, so that the virtualized devices can be used for ordinary computing tasks as well as secure computing tasks, thereby ensuring the security of computing tasks.
[0048] like Figure 1 As shown in , the cross-bus domain virtual device safe use method of this embodiment can be applied to a terminal or a server. Specifically, the cross-bus domain virtual device safe use method of this embodiment includes the following steps:
[0049] Step S100: When the control bridge is powered on, it enters an initialization state, and after the initialization is completed, the control bridge enters an available state;
[0050] Step S200: after receiving the instruction to start the safety task, the control bridge enters the authentication state, performs identity authentication of the control bridge in the authentication state, and obtains the communication key;
[0051] Step S300, entering the running safety task state, based on the communication key, the control bridge encrypts all data output to the device lender bus and decrypts all data input from the device lender bus.
[0052] In specific implementation, this embodiment provides a virtual device security use system across bus domains, such as Figure 2 As shown in , the system includes: a device borrower, a device lender, a connection bridge and a control bridge, the device borrower includes a virtual device, the device lender includes a virtualized device, the connection bridge is used to connect the buses corresponding to the device borrower and the device lender respectively, and the control bridge is used to connect the bus of the virtualized device and the bus of the device lender. In this embodiment, the connection bridge is a PCIe non-transparent bridge (Non-transparent Bridge), which is represented as a PCIe EP (Endpoint) in the PCIe bus of the device borrower and the device lender. In this embodiment, the EP of the device borrower is called EP0, and the EP of the device lender is called EP1. One end of the control bridge of this embodiment is connected to the PCIe bus of the device lender, and the other end is connected to the virtualized device, and it has the functions of a PCIe transparent bridge and a non-transparent bridge. As a transparent bridge, the PCIe bus topology of the device lender is not changed, and the normal use of the virtualized device in the device lender is guaranteed. As a non-transparent bridge, when the device borrower uses the virtualized device, the PCIe data entering and leaving the virtualized device can be further processed and controlled, such as implementing security status management in this embodiment.
[0053] Combination Figure 3 As shown, when the control bridge is powered on, it automatically enters the initialization state. The trusted startup is completed, including: checking the necessary parameters, and if firmware or software exists, measuring the firmware and software. Then, after the trusted startup is successful, a startup flag is established, and it is ensured that the connected virtual device is reset normally. Specifically, the reset can be achieved through a hard reset, a logical reset of the PCIe, or a power on and off of the control device. The connection bridge obtains the authentication public key from the control bridge, and after the startup flag is valid and the initialization completion instruction is received, the control bridge enters the available state.
[0054] Furthermore, after the control bridge enters the available state, if it receives an instruction to start a non-safe task, it enters the running non-safe task state, at which time the control bridge cannot use any safety functions, such as identity authentication, data encryption and decryption, flow control, etc. After receiving an instruction to stop a non-safe task, it enters the initialization state. If it receives an instruction to start a safe task, the control bridge enters the authentication state, performs identity authentication of the control bridge in the authentication state, and obtains the communication key. Specifically, the identity authentication is completed by the device borrower, and if the connection bridge is integrated in the device borrower, it can also be completed automatically by the connection bridge. The identity authentication of this embodiment includes a remote authentication method or an identity identification method. Therefore, the device borrower can choose a remote authentication method to determine whether the identity of the control bridge is legal; the device borrower can also choose an industry-recognized identity identification method to complete it, such as the national standard GB / T 15843.3-2016. Of course, in some implementations, the two methods of remote authentication and identity identification can also be used in combination to more accurately implement the identity authentication of the control bridge.
[0055] Next, the device borrower requests a security status report from the control bridge through the connection bridge; after receiving the request for the security status report, the control bridge locks the security-related configuration parameters, including but not limited to: virtual device information, connection bridge EP1 address information, control registers, etc. Then, the locked parameters are used as part of the security status report, and the security status report is signed with the authentication private key and sent to the device borrower. After receiving the security status report, the device borrower uses the authentication public key of the control bridge to verify the signature. After the signature is verified, the security status report is evaluated to determine whether the control bridge is in a secure state.
[0056] Furthermore, the control bridge obtains the communication key according to the request of the device borrower. Specifically, the device borrower and the control bridge can jointly negotiate to obtain the communication key, such as using the DH algorithm, SM2 key exchange protocol, etc.; or the device borrower directly distributes the communication key, and the device borrower uses the control bridge's authentication public key to encrypt the communication key. After successfully obtaining the communication key, the control bridge enters the running safety task state. Based on the communication key, the control bridge encrypts all data output to the device lender bus and decrypts all data input from the device lender bus. The encryption and decryption algorithm in this embodiment can use an authenticated encryption working mode (such as GCM) to achieve control of the data flow. After receiving the stop safety task instruction, the control bridge enters the initialization state.
[0057] Furthermore, if an error occurs in any state except the initialization state, the control bridge enters an error handling state; error information is collected in the error handling state, and error state information in the control bridge is updated; after completing the collection and update of the error state information, the control bridge returns to the initialization state.
[0058] It can be seen that this embodiment adds security measures by connecting the bridge and the control bridge, so that the borrowed device can also be used for secure computing, and through security status management, the borrowed device can also be used for ordinary computing.
[0059] Based on the above embodiments, the present invention also provides a cross-bus domain virtual device safe use system, such as Figure 2 As shown in , the system includes: a device borrower, a device lender, a connection bridge and a control bridge, the device borrower includes a virtual device, the device lender includes a virtualized device, the connection bridge is used to connect the buses corresponding to the device borrower and the device lender respectively, and the control bridge is used to connect the bus of the virtualized device and the device lender. Specifically, the control bridge includes at least: an initialization module, an identity authentication module and a data encryption and decryption module. The initialization module is used to enter the initialization state when the control bridge is powered on, and after the initialization is completed, the control bridge enters the available state. The identity authentication module is used to enter the authentication state after receiving the instruction to start the safety task, perform identity authentication of the control bridge in the authentication state, and obtain the communication key. The data encryption and decryption module is used to enter the running safety task state, and based on the communication key, the control bridge encrypts all data output to the device lender bus and decrypts all data input from the device lender bus.
[0060] The functional principles of each module in the cross-bus domain virtual device secure use system of this embodiment are the same as the functions to be implemented in the method steps in the above-mentioned embodiments, and will not be repeated here.
[0061] Based on the above embodiment, the present invention further provides a terminal, the principle block diagram of the terminal can be as follows: Figure 4 The terminal may include one or more processors 100 ( Figure 4 Only one is shown), a memory 101 and a computer program 102 stored in the memory 101 and executable on one or more processors 100, for example, a program for secure use of a virtual device across bus domains. When one or more processors 100 execute the computer program 102, the various steps in the embodiment of the method for secure use of a virtual device across bus domains can be implemented. Alternatively, when one or more processors 100 execute the computer program 102, the functions of the various modules / units in the embodiment of the method for secure use of a virtual device across bus domains can be implemented, which is not limited here.
[0062] In one embodiment, the processor 100 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0063] In one embodiment, the memory 101 may be an internal storage unit of an electronic device, such as a hard disk or memory of the electronic device. The memory 101 may also be an external storage device of the electronic device, such as a plug-in hard disk, a smart memory card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device. Further, the memory 101 may also include both an internal storage unit of the electronic device and an external storage device. The memory 101 is used to store computer programs and other programs and data required by the terminal. The memory 101 may also be used to temporarily store data that has been output or is to be output.
[0064] Those skilled in the art will understand that Figure 4 The principle block diagram shown in the figure is only a block diagram of a partial structure related to the scheme of the present invention, and does not constitute a limitation on the terminal to which the scheme of the present invention is applied. The specific terminal may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0065] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, operating database or other media used in the embodiments provided by the present invention may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct RAMbus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.
[0066] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for securely using a virtual device across bus domains, characterized in that: The method comprises: When the control bridge is powered on, it enters the initialization state, and after completing the initialization, the control bridge enters the usable state; After receiving the instruction to start the safety task, the control bridge enters the authentication state, performs identity authentication of the control bridge in the authentication state, and obtains the communication key; Entering the running security task state, based on the communication key, the control bridge encrypts all data output to the device lender bus and decrypts all data input from the device lender bus.
2. The method for securely using a virtual device across bus domains according to claim 1, characterized in that: The method further comprises: After receiving the command to start the non-safety task, it enters the running non-safety task state; When in the running non-safety task state, the control bridge stops using any safety functions.
3. The method for securely using a virtual device across bus domains according to claim 1, characterized in that: When the control bridge is powered on, it enters the initialization state, and after the initialization is completed, the control bridge enters the usable state, including: Complete the trusted boot, wherein the trusted boot includes: checking necessary parameters, and if firmware or software exists, measuring the firmware and software; After the trusted boot is successful, the boot flag is established and the connected virtual device is ensured to be reset normally; The connection bridge obtains the authentication public key from the control bridge, and after the startup flag is valid and the initialization completion instruction is received, the control bridge enters an available state.
4. The method for securely using a virtual device across bus domains according to claim 1, characterized in that: The step of performing identity authentication of the control bridge in the authentication state and obtaining a communication key includes: The equipment borrower completes the identity authentication of the control bridge by remote authentication or identity authentication through the connection bridge; The equipment borrower requests a safety status report from the control bridge through the connection bridge; After receiving the request for the security status report, the control bridge locks the security-related configuration parameters, and uses the locked parameters as part of the security status report. The security status report is signed using the authentication private key and then sent to the device borrower.
5. The method for securely using a virtual device across bus domains according to claim 4 is characterized in that: The step of performing identity authentication of the control bridge in the authentication state and obtaining a communication key includes: After receiving the security status report, the equipment borrower uses the control bridge's authentication public key to verify the signature; After the signature verification is passed, the safety status report is evaluated to determine whether the control bridge is in a safe state; Obtain the communication key based on the request of the device borrower.
6. The method for securely using a virtual device across bus domains according to claim 5, characterized in that: The obtaining of the communication key according to the request of the device borrower includes: The device borrower and the control bridge jointly negotiate the communication key; or, The communication key is directly distributed by the device borrower, and the device borrower encrypts the communication key using the authentication public key of the control bridge.
7. The method for securely using a virtual device across bus domains according to claim 1, characterized in that: The method further comprises: If an error occurs in any state except the initialization state, the control bridge enters the error handling state; Collecting error information in the error processing state and updating error state information in the control bridge; After completing the collection and update of the error status information, the control bridge returns to the initialization state.
8. A cross-bus domain virtual device secure use system, characterized in that: The system is applied to the method for securely using a virtual device across bus domains as described in any one of claims 1 to 7 above, and the system comprises: a device borrower, a device lender, a connection bridge and a control bridge, the device borrower comprises a virtual device, the device lender comprises a virtualized device, the connection bridge is used to connect the buses corresponding to the device borrower and the device lender respectively, and the control bridge is used to connect the bus of the virtualized device and the bus of the device lender, wherein the control bridge comprises: The initialization module is used to enter the initialization state when the control bridge is powered on, and after the initialization is completed, the control bridge enters the usable state; The identity authentication module is used to control the bridge to enter an authentication state after receiving an instruction to start a safety task, perform identity authentication of the control bridge in the authentication state, and obtain a communication key; The data encryption and decryption module is used to enter the running safety task state, and based on the communication key, the control bridge encrypts all data output to the device lender bus and decrypts all data input from the device lender bus.
9. A terminal, characterized in that: The terminal includes a memory, a processor, and a cross-bus domain virtual device security usage program stored in the memory and executable on the processor. When the processor executes the cross-bus domain virtual device security usage program, the steps of the cross-bus domain virtual device security usage method as described in any one of claims 1-7 are implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program for safely using a virtual device across bus domains. When the program for safely using a virtual device across bus domains is executed by a processor, the steps of the method for safely using a virtual device across bus domains as described in any one of claims 1-7 are implemented.
Citation Information
Patent Citations
Security encryption mobile hard disk based on USBKEY authentication and data transmission method thereof
CN106169041A
A network information security protection unit and a network information security protection method for an industrial embedded system
CN109842585A
Ad-hoc sensing switched data circuit for connecting network hosts and peripherals
CN110168512A
Secure element, data processing device, and data processing method
CN111699467A
LPC bus security access method and system, terminal and storage medium
CN115221549A
Cited By
Method and system for using cross-domain virtual NVMe device, terminal and medium
CN119150379A
Method for performing RDMA (Remote Direct Memory Access) operation by safely using inter-bus domain RNIC (Radio Network Interface Controller) equipment
CN119675892A
Method for safely using cross-bus domain RNIC devices for RDMA operations
CN119675892B
Secure communication method suitable for confidential virtual machine and PCIe device, computing device and medium
CN120301713A
TEE cluster implementation method and system, terminal and storage medium
CN122268684A
