CN117235740A - Firmware starting method and starting device - Google Patents

Firmware starting method and starting device Download PDF

Info

Publication number
CN117235740A
CN117235740A CN202311495457.XA CN202311495457A CN117235740A CN 117235740 A CN117235740 A CN 117235740A CN 202311495457 A CN202311495457 A CN 202311495457A CN 117235740 A CN117235740 A CN 117235740A
Authority
CN
China
Prior art keywords
firmware
authentication
code segment
authentication function
signature
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202311495457.XA
Other languages
Chinese (zh)
Other versions
CN117235740B (en
Inventor
生竹声
刘希
范金晔
钟鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wanbang Digital Energy Co Ltd
Original Assignee
Wanbang Digital Energy Co Ltd
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 Wanbang Digital Energy Co Ltd filed Critical Wanbang Digital Energy Co Ltd
Priority to CN202311495457.XA priority Critical patent/CN117235740B/en
Publication of CN117235740A publication Critical patent/CN117235740A/en
Application granted granted Critical
Publication of CN117235740B publication Critical patent/CN117235740B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention relates to the technical field of communication security, and provides a firmware starting method and a firmware starting device, wherein the method comprises the following steps: dividing firmware into n code segments; assigning a signature data address space and an authentication function address space for each code segment; adding a corresponding signature authentication function at the entrance of the business function of each code segment to generate an authentication function, and correspondingly distributing the authentication function in an authentication function address space; after the firmware is generated, signature data of each code segment is generated by using a signature tool and is embedded into a corresponding signature data address space; when the firmware is started, an authentication function in the firmware communicates with a security module in the chip, and when a business function of the code segment is called, the authentication function corresponding to the code segment performs signature authentication on the corresponding signature data. The invention segments the firmware and triggers the segment identity authentication when the firmware runs, thereby not only improving the safety of the firmware running, but also greatly improving the difficulty of forging the firmware.

Description

Firmware starting method and starting device
Technical Field
The invention relates to the technical field of communication security, in particular to a firmware starting method and a firmware starting device.
Background
The embedded application system comprises firmware and a chip, wherein the firmware is placed in an external storage unit due to the fact that the size of the firmware is large, an attacker can forge the system by reading the content of the firmware in the external storage unit and copying the hardware circuit board, and the purposes of saving development cost and simulating products are achieved.
In order to prevent the attack in the above manner, in the related art, an additional security kernel is provided to authenticate the firmware through the chip platform. Because the process of identity authentication is sensitive to the size of firmware, some systems with larger firmware (for example, systems with firmware sizes larger than 500 KBytes) directly perform the process of identity authentication and have larger starting time, the process of starting the identity authentication is generally placed in a boot program (boot starting program) with smaller size, and only the boot program is subjected to the process of identity authentication, so that the starting time can be reduced. But the method provides an attacker with a method that identity authentication can be bypassed only by replacing the boot program, the boot program and the application program are relatively independent, and the method is easy to imitate the boot program, so that the attacker can imitate the firmware easily, and the security of the system is reduced.
Disclosure of Invention
In order to solve the above technical problems, an embodiment of a first aspect of the present invention provides a method for starting firmware.
An embodiment of the second aspect of the present invention provides a firmware boot device.
Embodiments of a third aspect of the present invention provide a non-transitory computer-readable storage medium.
The technical scheme adopted by the invention is as follows:
an embodiment of a first aspect of the present invention provides a method for starting firmware, including the following steps: dividing the firmware into n code segments, wherein n is a positive integer; assigning a signature data address space and an authentication function address space for each code segment; adding a corresponding signature authentication function at the entrance of the business function of each code segment to generate an authentication function, and correspondingly distributing the authentication function in the authentication function address space; after the firmware is generated, signature data of each code segment is generated by using a signature tool, and the signature data is embedded into a corresponding signature data address space; when the firmware is started, an authentication function in the firmware is communicated with a security module in a chip, and when a business function of the code segment is called, the authentication function corresponding to the code segment performs signature authentication on signature data corresponding to the code segment.
The starting method of the firmware also has the following additional technical characteristics:
according to one embodiment of the invention, each of said authentication functions is performed only once at run-time for signature authentication of the corresponding code segment.
According to one embodiment of the invention, the security module of the chip has a key stored therein.
According to one embodiment of the invention, the firmware is divided into n code segments according to its business function execution address space when the programs are linked.
An embodiment of a second aspect of the present invention provides a firmware boot device, including: the dividing module is used for dividing the firmware into n code segments, wherein n is a positive integer; an allocation module for allocating a signature data address space and an authentication function for each code segment; the first generation module is used for adding a corresponding signature authentication function at the entrance of the business function of each code segment to generate an authentication function, and correspondingly distributing the authentication function in the authentication function address space; the second generation module is used for generating signature data of each code segment by using a signature tool after the firmware is generated, and embedding the signature data into a corresponding signature data address space; and the authentication module is used for communicating an authentication function in the firmware with the security module in the chip when the firmware is started, and carrying out signature authentication on signature data corresponding to the code segment by the authentication function corresponding to the code segment when the business function of the code segment is called.
The starting device of the firmware also has the following additional technical characteristics:
according to one embodiment of the invention, each of the authentication functions is run at a time, the authentication module performs signature authentication of the corresponding code segment only once.
According to one embodiment of the invention, the security module of the chip has a key stored therein.
According to one embodiment of the present invention, the dividing module is specifically configured to: when the program is linked, the firmware is divided into n code segments according to the service function running address space of the firmware.
An embodiment of the third aspect of the present invention proposes a non-transitory computer readable storage medium, on which a computer program is stored, which when executed by a processor implements a method for starting firmware according to an embodiment of the first aspect of the present invention.
The invention has the beneficial effects that:
the invention segments the firmware and triggers the segment identity authentication when the firmware runs, thereby not only improving the safety of the firmware running, but also greatly improving the difficulty of forging the firmware.
Drawings
FIG. 1 is a flow chart of a method of boot-up of firmware according to one embodiment of the invention;
FIG. 2 is a firmware partitioning diagram in accordance with one embodiment of the present invention;
fig. 3 is a block diagram of a boot device of firmware according to one embodiment of the invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
FIG. 1 is a flow chart of a method of starting up firmware according to one embodiment of the invention, as shown in FIG. 1, the method comprising the steps of:
s1, dividing firmware into n code segments, wherein n is a positive integer.
According to one embodiment of the invention, the firmware is divided into n code segments according to its business function execution address space when the programs are linked.
Specifically, as shown in fig. 2, at the time of program linking, firmware is divided into n code sections TEXT1, TEXT2, according to the running address space [ _linker_text1_start ], _linker_text1_end ], [ _linker_text2_start ], -, linker_text2_end ] - [ -linker_textn_start ], and _linker_textn_end ].
S2, distributing a signature data address space and an authentication function address space for each code segment.
Specifically, as shown in fig. 2, for each code segment TEXTi, i is an integer greater than or equal to 1, a signature data address space SIGSi and an authentication function address space VFYSi are allocated correspondingly.
And S3, adding a corresponding signature authentication function at the entrance of the business function of each code segment to generate an authentication function, and correspondingly distributing the authentication function in an authentication function address space.
In particular, TEXT1, TEXT 2..the TEXT code segment program must be called to service functions when running, the invention reforms these service functions, adds signature authentication function to the corresponding code segment at the entry of the function, then places them in the address space of the segments VFYS1, VFYS 2..vfysn, etc. in turn, generates authentication functions, and when they are called, these authentication functions can activate the secure firmware signature authentication function to make identity authentication.
S4, after the firmware is generated, signature data of each code segment is generated by using a signature tool, and the signature data is embedded into a corresponding signature data address space.
Specifically, after the application firmware is generated, the position and the size of each code segment TEXTi are fixed, signature data of each code segment is generated by using a signature tool, and the signature data is embedded into a corresponding signature data address space SIGSi.
S5, when the firmware is started, an authentication function in the firmware is communicated with a security module in the chip, and when a business function of the code segment is called, signature authentication is carried out on signature data corresponding to the code segment by the authentication function corresponding to the code segment.
The security module of the chip stores the secret key.
Specifically, when a chip with a safe start is started, when a function with an authentication function (namely an authentication function) is called, the authentication function is started, the authentication function in the firmware is communicated with the security module, a secret key stored in the security module is obtained to realize signature authentication of the firmware, and the identity authentication function of the authentication function is triggered. Each authentication function in the invention performs identity authentication on the corresponding code segment, for example, the authentication function in the VFS1 performs signature authentication on the firmware of the TEXT 1.
It should be noted that, in the embodiment of the present invention, during the operation of the business function of each code segment, each authentication function is operated, and signature authentication of the corresponding code segment is performed only once. That is, even if the code segment is called a plurality of times, signature authentication may be performed only once for each code segment.
The firmware adopting the starting method of the invention can call the authentication function in operation, and when the pirate circuit board is started, if the security module is started, the starting failure of the pirate circuit board can be caused because the secret key in the main chip of the circuit board is inconsistent with the original edition (the factory chip), and if the security module is not started, the authentication failure can be caused, and the starting failure of the pirate circuit board can be caused. Thus, the present invention can prevent piracy of firmware. If the identity authentication is performed for each code segment, the imitation consumption exceeds the consumption of the redevelopment system, and the imitation difficulty is also great.
In summary, according to the method for starting the firmware in the embodiment of the invention, the firmware is segmented and the segmentation identity authentication is triggered when the firmware runs, so that the safety of the firmware running can be improved, and the difficulty of forging the firmware can be greatly improved.
Compared with the starting method of the firmware, the invention also provides a starting device of the firmware. Since the device embodiment of the present invention corresponds to the above-described method embodiment, for details not disclosed in the device embodiment, reference may be made to the above-described method embodiment, and details are not repeated in the present invention.
FIG. 3 is a block schematic diagram of a boot-up device for firmware according to one embodiment of the invention, as shown in FIG. 3, the device comprising: the system comprises a dividing module 1, an allocating module 2, a first generating module 3, a second generating module 4 and an authenticating module 5.
The division module 1 is used for dividing the firmware into n code segments, wherein n is a positive integer; the allocation module 2 is used for allocating a signature data address space and an authentication function for each code segment; the first generating module 3 is configured to add a corresponding signature authentication function at an entry of the business function of each code segment to generate an authentication function, and correspondingly allocate the authentication function in an authentication function address space; the second generating module 4 is configured to generate signature data of each code segment using a signature tool after firmware generation, and embed the signature data into a corresponding signature data address space; the authentication module 5 is used for communicating an authentication function in the firmware with the security module in the chip when the firmware is started, and performing signature authentication on signature data corresponding to the code segment by the authentication function corresponding to the code segment when the business function of the code segment is called.
According to one embodiment of the invention, each authentication function is run-time, with the authentication module performing only one signed authentication of the corresponding code segment.
According to one embodiment of the invention, the security module of the chip has a key stored therein.
According to one embodiment of the invention, the partitioning module is specifically configured to: when the program is linked, the firmware is divided into n code segments according to the service function running address space of the firmware.
According to the starting device of the firmware, the dividing module divides the firmware into n code segments, n is a positive integer, the distributing module distributes a signature data address space and an authentication function for each code segment, a first generating module adds a corresponding signature authentication function at an entrance of a business function of each code segment to generate an authentication function, the authentication function is correspondingly distributed in the authentication function address space, the second generating module generates signature data of each code segment by using a signature tool after the firmware is generated, the signature data is embedded in the corresponding signature data address space, the authentication function in the firmware is communicated with the security module in the chip when the firmware is started, and the signature data corresponding to the code segment is subjected to signature authentication by the authentication function corresponding to the code segment when the business function of the code segment is called. Therefore, the firmware is segmented and segmented identity authentication is triggered when the firmware runs, so that the safety of the firmware running can be improved, and the difficulty of forging the firmware can be greatly improved.
Furthermore, the present invention also proposes a non-transitory computer-readable storage medium, on which a computer program is stored, which when executed by a processor implements the above-described firmware start-up method.
According to the non-transitory computer readable storage medium of the embodiment of the invention, when a computer program stored on the non-transitory computer readable storage medium is executed by a processor, firmware is divided into n code segments, n is a positive integer, a signature data address space and an authentication function address space are allocated for each code segment, a corresponding signature authentication function is added at an entrance of a business function of each code segment to generate an authentication function, the authentication function is correspondingly allocated in the authentication function address space, after the firmware is generated, signature data of each code segment is generated by using a signature tool, the signature data is embedded in the corresponding signature data address space, when the firmware is started, the authentication function in the firmware is communicated with a security module in a chip, and when the business function of the code segment is called, the authentication function corresponding to the code segment performs signature authentication on the signature data corresponding to the code segment, thereby not only improving the operation security of the firmware, but also greatly improving the difficulty of forging the firmware.
In the description of the present invention, the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more such feature. The meaning of "a plurality of" is two or more, unless specifically defined otherwise.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and additional implementations are included within the scope of the preferred embodiment of the present invention in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order from that shown or discussed, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the embodiments of the present invention.
Logic and/or steps represented in the flowcharts or otherwise described herein, e.g., a ordered listing of executable instructions for implementing logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions.
It is to be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above-described embodiments, the various steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. As with the other embodiments, if implemented in hardware, may be implemented using any one or combination of the following techniques, as is well known in the art: discrete logic circuits having logic gates for implementing logic functions on data signals, application specific integrated circuits having suitable combinational logic gates, programmable Gate Arrays (PGAs), field Programmable Gate Arrays (FPGAs), and the like.
Those of ordinary skill in the art will appreciate that all or a portion of the steps carried out in the method of the above-described embodiments may be implemented by a program to instruct related hardware, where the program may be stored in a computer readable storage medium, and where the program, when executed, includes one or a combination of the steps of the method embodiments.
In addition, each functional unit in the embodiments of the present invention may be integrated in one processing module, or each unit may exist alone physically, or two or more units may be integrated in one module. The integrated modules may be implemented in hardware or in software functional modules. The integrated modules may also be stored in a computer readable storage medium if implemented in the form of software functional modules and sold or used as a stand-alone product.
The above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, or the like.
Although embodiments of the present invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made therein without departing from the principles and spirit of the invention, the scope of which is defined in the appended claims and their equivalents.

Claims (9)

1. A method for starting firmware, comprising the steps of:
dividing the firmware into n code segments, wherein n is a positive integer;
assigning a signature data address space and an authentication function address space for each code segment;
adding a corresponding signature authentication function at the entrance of the business function of each code segment to generate an authentication function, and correspondingly distributing the authentication function in the authentication function address space;
after the firmware is generated, signature data of each code segment is generated by using a signature tool, and the signature data is embedded into a corresponding signature data address space;
when the firmware is started, an authentication function in the firmware is communicated with a security module in a chip, and when a business function of the code segment is called, the authentication function corresponding to the code segment performs signature authentication on signature data corresponding to the code segment.
2. A method of booting firmware according to claim 1, wherein each of the authentication functions is run-time with signature authentication of the corresponding code segment only once.
3. The method of starting up firmware of claim 1, wherein a key is stored in a security module of the chip.
4. The method for starting up firmware according to claim 1, wherein the firmware is divided into n code segments according to a service function running address space of the firmware when programs are linked.
5. A firmware boot-up device, comprising:
the dividing module is used for dividing the firmware into n code segments, wherein n is a positive integer;
an allocation module for allocating a signature data address space and an authentication function for each code segment;
the first generation module is used for adding a corresponding signature authentication function at the entrance of the business function of each code segment to generate an authentication function, and correspondingly distributing the authentication function in the authentication function address space;
the second generation module is used for generating signature data of each code segment by using a signature tool after the firmware is generated, and embedding the signature data into a corresponding signature data address space;
and the authentication module is used for communicating an authentication function in the firmware with the security module in the chip when the firmware is started, and carrying out signature authentication on signature data corresponding to the code segment by the authentication function corresponding to the code segment when the business function of the code segment is called.
6. The firmware boot-up apparatus of claim 5, wherein each of the authentication functions, when executed, the authentication module performs signature authentication of the corresponding code segment only once.
7. The firmware boot-strap apparatus of claim 5, wherein a key is stored in a security module of the chip.
8. The firmware start-up device of claim 5, wherein the partitioning module is specifically configured to: when the program is linked, the firmware is divided into n code segments according to the service function running address space of the firmware.
9. A non-transitory computer-readable storage medium, having stored thereon a computer program which, when executed by a processor, implements a method of starting firmware according to any of claims 1-4.
CN202311495457.XA 2023-11-10 2023-11-10 Firmware starting method and starting device Active CN117235740B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311495457.XA CN117235740B (en) 2023-11-10 2023-11-10 Firmware starting method and starting device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311495457.XA CN117235740B (en) 2023-11-10 2023-11-10 Firmware starting method and starting device

Publications (2)

Publication Number Publication Date
CN117235740A true CN117235740A (en) 2023-12-15
CN117235740B CN117235740B (en) 2024-03-22

Family

ID=89098618

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311495457.XA Active CN117235740B (en) 2023-11-10 2023-11-10 Firmware starting method and starting device

Country Status (1)

Country Link
CN (1) CN117235740B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030056115A1 (en) * 2001-09-20 2003-03-20 Andreas Falkenberg System for and method of protecting data in firmware modules of embedded systems
CN101261664A (en) * 2008-04-10 2008-09-10 北京深思洛克数据保护中心 A method for realizing software protection based on the program code stored in the software protection device
US20140137264A1 (en) * 2012-11-09 2014-05-15 Nokia Corporation Method and apparatus for privacy-oriented code optimization
CN104102860A (en) * 2014-08-11 2014-10-15 北京奇虎科技有限公司 Protecting method and running method and device and system for Android platform application program
US20180060561A1 (en) * 2016-08-24 2018-03-01 Altera Corporation Systems and methods for authenticating firmware stored on an integrated circuit
CN108491289A (en) * 2018-03-22 2018-09-04 北京顶象技术有限公司 Firmware guard method and device
CN111832012A (en) * 2020-07-15 2020-10-27 北京经纬恒润科技有限公司 ECU and starting method thereof
CN113468485A (en) * 2021-07-05 2021-10-01 桂林电子科技大学 Digital signature and certificate verification program protection method based on Linux operating system
CN114462050A (en) * 2022-02-11 2022-05-10 北京工业大学 Trusted starting method for multi-core BMC (baseboard management controller) firmware system
US20220318431A1 (en) * 2021-03-31 2022-10-06 Seagate Technology Llc Code-based signatures for secure programs

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030056115A1 (en) * 2001-09-20 2003-03-20 Andreas Falkenberg System for and method of protecting data in firmware modules of embedded systems
CN101261664A (en) * 2008-04-10 2008-09-10 北京深思洛克数据保护中心 A method for realizing software protection based on the program code stored in the software protection device
US20140137264A1 (en) * 2012-11-09 2014-05-15 Nokia Corporation Method and apparatus for privacy-oriented code optimization
CN104102860A (en) * 2014-08-11 2014-10-15 北京奇虎科技有限公司 Protecting method and running method and device and system for Android platform application program
US20180060561A1 (en) * 2016-08-24 2018-03-01 Altera Corporation Systems and methods for authenticating firmware stored on an integrated circuit
CN108491289A (en) * 2018-03-22 2018-09-04 北京顶象技术有限公司 Firmware guard method and device
CN111832012A (en) * 2020-07-15 2020-10-27 北京经纬恒润科技有限公司 ECU and starting method thereof
US20220318431A1 (en) * 2021-03-31 2022-10-06 Seagate Technology Llc Code-based signatures for secure programs
CN113468485A (en) * 2021-07-05 2021-10-01 桂林电子科技大学 Digital signature and certificate verification program protection method based on Linux operating system
CN114462050A (en) * 2022-02-11 2022-05-10 北京工业大学 Trusted starting method for multi-core BMC (baseboard management controller) firmware system

Also Published As

Publication number Publication date
CN117235740B (en) 2024-03-22

Similar Documents

Publication Publication Date Title
US7364087B2 (en) Virtual firmware smart card
US9721101B2 (en) System wide root of trust chaining via signed applications
US8881290B2 (en) Method and apparatus for computer code obfuscation and deobfuscation using boot installation
CN108960830B (en) Intelligent contract deployment method, device, equipment and storage medium
JP5647360B2 (en) System and method for supporting JIT in a secure system with randomly allocated memory ranges
US8327415B2 (en) Enabling byte-code based image isolation
US20190114401A1 (en) On device structure layout randomization for binary code to enhance security through increased entropy
JP7100201B2 (en) Trusted computing methods and servers
CN105579955A (en) Application control flow models
JP2010182196A (en) Information processing apparatus and file verification system
WO2016119548A1 (en) Method for preventing software decompilation, and method and apparatus for preventing decompilation software from starting
US10303885B2 (en) Methods and systems for securely executing untrusted software
CN112000382B (en) Linux system starting method and device and readable storage medium
CN114969713A (en) Equipment verification method, equipment and system
EP3785149B1 (en) Memory assignment for guest operating systems
CN113946854B (en) File access control method and device and computer readable storage medium
CN117235740B (en) Firmware starting method and starting device
CN108304158B (en) Dynamic library proxy method and device
CN110263532B (en) Trusted computing method, device and system
CN114077739A (en) Method and device for starting rapid Peripheral Component Interconnect (PCI) equipment and storage medium
CN111209572A (en) Encryption and decryption-based safe startup method and system for Linux system
US10200401B1 (en) Evaluating results of multiple virtual machines that use application randomization mechanism
CN113448682B (en) Virtual machine monitor loading method and device and electronic equipment
CN113239347B (en) Starting method and device suitable for TEE security application example
JP6564549B1 (en) Validity authentication activation management system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant