An information security test method and system for automotive embedded system compilation optimization
By automating the parsing of configuration and binary file content, and comparing the development and production versions, the problem of low efficiency and accuracy in information security testing of production version binary files of in-vehicle software is solved, meeting the regulatory requirements of GB 44495-2024 and improving the information security protection of the whole vehicle.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHONGTONG BUS HLDG
- Filing Date
- 2026-03-26
- Publication Date
- 2026-07-31
AI Technical Summary
In the existing technology, the binary files of the production version of vehicle software are not properly processed, which allows attackers to easily obtain the internal logic and data structure. Traditional manual inspection is inefficient and prone to overlooking information security risks, and cannot meet the testing requirements of GB 44495-2024.
By parsing the build configuration, analyzing the binary file header, scanning string content, verifying compiler optimizations and stripping status, and comparing the development and production versions, automated information security testing of the production version binary files of in-vehicle software is achieved to ensure that compilation options and symbols have been stripped and meet the security baseline.
It enables automated and accurate testing of binary files of production versions of in-vehicle software, improving testing efficiency and accuracy, ensuring that in-vehicle software complies with the regulatory requirements of GB 44495-2024, and enhancing the overall vehicle information security protection level.
Smart Images

Figure CN122489413A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of automotive information security technology, and in particular to an information security testing method and system for compiling and optimizing automotive embedded systems. Background Technology
[0002] The statements in this section are merely background information related to the present invention and do not necessarily constitute prior art.
[0003] With the rapid development of the intelligent connected vehicle industry, automobiles have evolved into complex mobile intelligent terminals, facing increasingly severe information security threats.
[0004] In the automotive software development lifecycle, firmware developed during the development phase typically contains rich debugging information (such as .debug_* sections, source code paths, and unstripped symbol tables) to facilitate problem localization. If the production version's binary files are not properly processed (e.g., incorrect compiler optimization options -O2 / -Os are not used, symbols are not stripped using the strip command, or source code paths remain), attackers can easily obtain the software's internal logic, key algorithms, and data structures using tools such as strings and disassemblers, thereby launching reverse engineering attacks and seriously threatening the vehicle's information security.
[0005] In related technologies, manual inspection methods (such as randomly using readelf to check) are used to check whether there are information security risks in the production version binary files of vehicle software. This is inefficient and it is easy to miss string information hidden deep in the binary files, leading to misjudgments. Summary of the Invention
[0006] To address the aforementioned issues, this invention proposes an information security testing method and system for compiling and optimizing automotive embedded systems, which enables automatic testing of whether the production version binary files of in-vehicle software contain information security vulnerabilities.
[0007] To achieve the above objectives, the present invention adopts the following technical solution: Firstly, a method for information security testing of automotive embedded system compilation optimization is proposed, including: Obtain the production version binary file of the in-vehicle software; Extract build configuration information, header segments, printable strings, and compiler optimization option levels from the production version binary file; Based on the build configuration information, determine whether the compilation options include parameters for generating debug symbols and whether the NDEBUG macro is defined; Determine if a pre-defined debugging segment exists in the segment header; Determine if a printable string contains debug content; Determine whether symbols have been stripped in the compiler based on the symbol stripping strategy corresponding to the compiler optimization option level. The information security test of the production version binary file is considered passed when the compiler options do not include parameters for generating debug symbols, the NDEBUG macro is defined, there is no preset debug-specific segment in the segment header, the printable string does not contain debug content, and the symbols in the compiler have been stripped.
[0008] Furthermore, if the compiler options include parameters for generating debug symbols, the NDEBUG macro is not defined, a pre-defined debug-specific segment exists in the segment header, the printable string contains debug content, and / or the symbols in the compiler are not stripped, the information security test of the production version binary file is deemed to have failed.
[0009] Furthermore, a test report is generated based on the information security test results of the production version binary file. Among them, the test report generated based on the information security test results of the production version binary file that failed the information security test includes the reasons for the failure of the information security test of the production version binary file and the corresponding remediation suggestions.
[0010] Furthermore, this also includes: obtaining the development version binary file of the in-vehicle software; Compare the development version binary file and the production version binary file of the in-vehicle software; The information security test of the production binary file is deemed to have passed when the compiler options do not include parameters for generating debug symbols, the NDEBUG macro is defined, there is no preset debug-specific segment in the segment header, the printable string does not contain debug content, the symbols in the compiler have been stripped, and the production version binary file does not contain the debugging information found in the development version binary file.
[0011] Furthermore, based on the assembly code pattern of functions in the production version binary file, the level of compilation optimization options is determined by reverse engineering.
[0012] Furthermore, regular expression matching is used to determine whether the printable string contains debug content.
[0013] Secondly, a compilation optimization information security testing system for automotive embedded systems is proposed, including: The file acquisition unit is used to acquire the production version binary file of the in-vehicle software. The information extraction unit is used to extract build configuration information, segment headers, printable strings, and compiler optimization option levels from the production version binary file. The information judgment unit is used to determine, based on the build configuration information, whether the compilation options contain parameters for generating debug symbols and whether the NDEBUG macro is defined; to determine whether there is a preset debug-specific segment in the segment header; to determine whether the printable string contains debug content; and to determine whether the symbols in the compiler have been stripped according to the symbol stripping strategy corresponding to the compiler optimization option level. The test result determination unit is used to determine that the information security test of the production version binary file has passed when the compilation options do not include parameters for generating debug symbols, the NDEBUG macro is defined, there is no preset debug-specific segment in the segment header, the printable string does not contain debug content, and the symbols in the compiler have been stripped.
[0014] Thirdly, a computer device is proposed, the device comprising: A processor, adapted to execute computer programs; A computer-readable storage medium storing a computer program, which, when executed by the processor, implements the information security testing method for compilation optimization of an automotive embedded system proposed in the first aspect.
[0015] Fourthly, a computer-readable storage medium is proposed, which stores a computer program adapted for loading and execution by a processor of an information security testing method for compiling and optimizing an automotive embedded system, as proposed in the first aspect.
[0016] Fifthly, a computer program product is proposed, which includes a computer program. When the computer program is executed by a processor, it implements the information security testing method for compilation optimization of automotive embedded systems proposed in the first aspect.
[0017] Compared with the prior art, the beneficial effects of the present invention are as follows: This invention proposes a method and system for information security testing of automotive embedded system compilation optimization. The method extracts build configuration information, segment headers, printable strings, and compiler optimization option levels from the production version binary file. Based on the build configuration information, it determines whether the compilation options include parameters for generating debug symbols and whether the NDEBUG macro is defined; it checks whether a preset debug-specific segment exists in the segment header; it determines whether the printable string contains debug content; and it determines whether symbols in the compiler have been stripped according to the symbol stripping strategy corresponding to the compiler optimization option level. This achieves automatic testing of the information security of the production version binary file of automotive software. It limits the information security test of the production version binary file to passing only when the compilation options do not include parameters for generating debug symbols, the NDEBUG macro is defined, a preset debug-specific segment does not exist in the segment header, debug content is not contained in the printable string, and symbols in the compiler have been stripped. This improves the efficiency and accuracy of information security testing of the production version binary file of automotive software.
[0018] Advantages of additional aspects of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description
[0019] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments of this application and their descriptions are used to explain this application and do not constitute an undue limitation of this application.
[0020] Figure 1 This is a flowchart of an information security testing method for compiling and optimizing an automotive embedded system, as proposed in an embodiment of the present invention. Figure 2 This is an example of a test report obtained in an embodiment of the present invention. Detailed Implementation
[0021] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0022] It should be noted that the following detailed descriptions are illustrative and intended to provide further explanation of this application. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains.
[0023] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the exemplary embodiments according to this application. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.
[0024] For researchers or technicians in the field, the specific meaning of the above terms in this invention can be determined according to the specific circumstances, and they should not be construed as limitations on this invention.
[0025] Where there is no conflict, the embodiments and features in the embodiments of the present invention can be combined with each other.
[0026] It should be noted that all data acquisition is conducted in accordance with laws and regulations and with user consent, and the data is used legally.
[0027] First, the application scenarios of the information security testing method for automotive embedded system compilation optimization proposed in the embodiments of the present invention will be described.
[0028] The present invention proposes an information security testing method for automotive embedded system compilation optimization, which is applied to the application scenario of security information testing of production version binary files of in-vehicle software.
[0029] Among them, the production version binary file of vehicle software refers to the official binary file that has been compiled by the compiler, tested, stabilized, and can be mass-produced and installed in vehicles.
[0030] With the rapid development of the intelligent connected vehicle industry, automobiles have evolved into complex mobile intelligent terminals, facing increasingly severe information security threats. To address this, the state has issued the mandatory standard GB 44495-2024, "Technical Requirements for Information Security of Automobiles," which will officially come into effect on January 1, 2026. This standard clearly stipulates the technical requirements for automobiles in terms of external connection security, communication security, software upgrade security, and data security.
[0031] In the automotive software development lifecycle, firmware developed during the development phase typically contains rich debugging information (such as .debug_* sections, source code paths, and unstripped symbol tables) to facilitate problem localization. However, according to the data security requirements in GB 44495-2024, the leakage of sensitive information must be prevented. If the production version's binary files are not properly processed (e.g., the correct compiler optimization options -O2 / -Os are not used, symbols are not stripped using the strip command, and source code paths remain), attackers can easily obtain the software's internal logic, key algorithms, and data structures using tools such as strings and disassemblers, thereby launching reverse engineering attacks and seriously threatening the information security of the entire vehicle.
[0032] Currently, while some developers are aware of the need to process production versions, the industry lacks a standardized and automated testing method to rigorously verify the security status of compilation optimizations. Traditional manual inspection methods (such as randomly using readelf to check) are inefficient and prone to overlooking string information hidden deep within binary files, leading to misjudgments in the information security testing of production version binary files and failing to meet the comprehensive and traceable testing and verification requirements of GB 44495.
[0033] To achieve automated testing of the information security of production version binary files of automotive software, this invention proposes an information security testing method for automotive embedded system compilation optimization. By parsing the build configuration, analyzing the binary file header, scanning string content, verifying compiler optimization and stripping status, and combining comparative analysis between the development and production versions, this method comprehensively and deeply detects residual debugging information. It achieves automated and accurate testing of the information security of production version binary files of automotive software, solving the problems of low efficiency and easy omissions caused by reliance on manual inspection in existing technologies. This effectively ensures that automotive software meets the security baseline of "minimum debugging information" in production conditions, thereby supporting enterprises in meeting the requirements of GB 44495-2024 regulations and improving the overall information security protection level of automotive products.
[0034] like Figure 1 , Figure 2 As shown in the embodiment of the present invention, an information security testing method for compilation optimization of automotive embedded systems includes: Obtain the production version binary file of the in-vehicle software; Extract build configuration information, header segments, printable strings, and compiler optimization option levels from the production version binary file; Based on the build configuration information, determine whether the compilation options include parameters for generating debug symbols and whether the NDEBUG macro is defined; Determine if a pre-defined debugging segment exists in the segment header; Determine if a printable string contains debug content; Determine whether symbols have been stripped in the compiler based on the symbol stripping strategy corresponding to the compiler optimization option level. The information security test of the production version binary file is considered passed when the compiler options do not include parameters for generating debug symbols, the NDEBUG macro is defined, there is no preset debug-specific segment in the segment header, the printable string does not contain debug content, and the symbols in the compiler have been stripped.
[0035] The information security test of the production version binary file is deemed to have failed when the compiler options include parameters for generating debug symbols, the NDEBUG macro is not defined, a pre-defined debug-specific segment exists in the segment header, the printable string contains debug content, and / or the symbols in the compiler are not stripped.
[0036] In some embodiments, the production version binary file of the in-vehicle software can be the build log or build script of the in-vehicle software.
[0037] For example, a Python script can be used to read the build log file build_log.txt of the vehicle software output by the continuous integration (CI) system.
[0038] This invention employs a sequence of steps for information security testing of the production version binary file of the in-vehicle software: configuration information checking, header scanning, string scanning, compiler optimization and stripping verification, and comparison between the production version binary file and the development version binary file. Only when one test passes is the next test performed; if any test fails, the information security test of the production version binary file is deemed failed. Only when all tests pass is the information security test of the production version binary file of the in-vehicle software considered successful. This approach improves testing efficiency while ensuring accuracy.
[0039] Extract the compilation command-line parameters from the production version binary file of the vehicle software to obtain the build configuration information; based on the build configuration information, determine whether the compilation options include parameters for generating debug symbols and whether the NDEBUG macro is defined.
[0040] The parameters for generating debug symbols include -g, etc. When the compiler options do not use parameters such as -g to generate debug symbols, and the -DNDEBUG macro is defined to disable assertions in the code and prevent assertion information string residue, the information security test of the build configuration information is deemed to have passed. When the compiler options use parameters such as -g to generate debug symbols, and / or the -DNDEBUG macro is not defined, the information security test of the build configuration information is deemed to have failed.
[0041] For example: If the compilation command contains `arm-none-eabi-gcc -O2 -DNDEBUG -mcpu=cortex-m4...`, confirming that `-O2` optimization is used, `-DNDEBUG` is defined, and `-g` is not used, then the information security test of the build configuration information passes.
[0042] By testing the information security of the build configuration information, the aim is to confirm from the source whether the build configuration complies with security specifications.
[0043] In some embodiments, the preset debug-specific segment includes, but is not limited to: .debug_info, .debug_abbrev, .debug_loc, .debug_line, .debug_str, .stab, .stabstr, and .comment (which may contain compiler version and path information).
[0044] This invention embodiment performs a deep scan of the section header of the production version binary file: it calls tools such as readelf -S or objdump -h to analyze the production version binary file, outputs the section header of the production version binary file, and matches the section header with a preset debug-specific section. If any section of the debug-specific section is matched, it is determined that there is residual debugging information and the information security test of the section header fails. Only when no section of the debug-specific section is matched in the section header is the information security test of the section header considered to have passed.
[0045] For example: call the system command readelf -S TBOX_V1.0_Release.bin>section_headers.txt; A Python script parses section_headers.txt and iterates through all section names; If the header only contains regular sections such as .text, .data, .bss, and .rodata, and no sections related to .debug_ or .stab are found, then the information security test of the header is passed.
[0046] In some embodiments, regular expression matching is used to determine whether a printable string contains debug content.
[0047] This invention performs static detection on string content: It calls `strings -n` (with a minimum string length that can be set, such as `-n 6`) to extract all printable strings from the production version binary file. Then, it uses a regular expression library to perform debugging content matching on the extracted set of printable strings. The debugging content includes the following characteristics: Source code path characteristics: such as / home / , / workspace / , / jenkins / , \\.c$, \\.h$, \\.cpp$.
[0048] Debug macro features: such as assert_failed, DEBUG_MSG, TRACE_%d.
[0049] Function name characteristics: User-defined function names excluding standard library functions (this can be achieved by comparing with a whitelist).
[0050] If a printable string exists that matches any of the characteristics of the debug content, it is considered a leak of source code path or debug information, and the information security test for the printable string is deemed to have failed. Only when none of the printable strings match any of the characteristics of the debug content is the information security test for the printable string deemed to have passed.
[0051] For example: Execute `strings -tx -n 6 TBOX_V1.0_Release.bin>strings_output.txt`; The script reads strings_output.txt and uses the regular expressions r'( / [a-zA-Z0-9_\-]+)+(\.c|\.h|\.cpp)' and r'assert|DEBUG|TRACE' for matching; Although no obvious absolute path was found, the script captured a suspicious string "src / network / tcp_handler.c" (a relative path). This path information exposed the organizational structure of the software modules, indicating that the information security test for printable strings failed.
[0052] In some embodiments, the level of compilation optimization options is determined by inversely based on the assembly code pattern of functions in the production binary file.
[0053] This invention indirectly infers the optimization level by disassembling a small amount of code (such as startup code or typical functions) and analyzing its assembly pattern (such as instruction reordering, loop unrolling, inlining, etc.). Alternatively, it can be confirmed directly through parameters such as -O2 and -Os recorded in the build log.
[0054] Symbol stripping verification: Execute `readelf -s` to view the symbol table. If `.symtab` (static symbol table) no longer exists, or only the necessary `.dynsym` (dynamic symbol table) is retained, and it is identified by the `file` command as having been stripped, then the compiler information security test is considered passed. Otherwise, if a large number of undefined local symbols exist, it is determined that the stripping was incomplete, and the compiler information security test fails.
[0055] For example, execute `readelf -s TBOX_V1.0_Release.bin | grep FUNC`; View the function symbols in the symbol table; The symbol table retains only a small number of dynamic symbols from .dynsym; the static symbol table .symtab no longer exists, confirming it has been stripped. Disassembling the main function reveals that instruction scheduling conforms to the -O2 characteristic, indicating the compiler's information security test has passed.
[0056] In some embodiments, for vehicle software with a development version binary file, when performing information security testing on the production version binary file of the vehicle software, the method further includes: obtaining the development version binary file of the vehicle software. Compare the development version binary file and the production version binary file of the in-vehicle software; The information security test of the production binary file is deemed to have passed when the compiler options do not include parameters for generating debug symbols, the NDEBUG macro is defined, there is no preset debug-specific segment in the segment header, the printable string does not contain debug content, the symbols in the compiler have been stripped, and the production version binary file does not contain the debugging information found in the development version binary file.
[0057] The development version binary file and the production version binary file of the in-vehicle software were compiled from the same source code. Differences in segment tables and string tables were compared between the two using tools. All debugging information present in the development version should have been removed in the production version. If the comparison revealed that the production version still retained certain strings or segment information from the development version's debugging information, it could be accurately identified as remnant, and the comparative analysis test between the development and production versions failed. Further improvements are needed to enhance the accuracy of information security testing for the production version binary file.
[0058] In some embodiments, a test report is generated based on the information security test results of the production version binary file. The test report generated based on the information security test failure results of the production version binary file includes the reasons for the failure of the information security test of the production version binary file and the corresponding remediation suggestions.
[0059] This invention integrates the information security test results of all the above-mentioned projects. Only when no violations are found in any project, i.e., all projects pass the information security test, is the output "Test Passed"; if any test fails, "Test Failed" is output, and a detailed test report is generated, clearly indicating the type of residual information (e.g., "Source code path found: / home / builder / src / main.c"), the offset address of the binary file where it is located, providing developers with a basis for remediation. Figure 2 As shown.
[0060] If a printable string matching the source code path is detected, the information security test for the production version binary file will ultimately fail, even if all other tests pass. The system will automatically generate a report stating, "Security risk detected due to compilation optimization: The source code path 'src / network / tcp_handler.c' remains in the binary file, potentially exposing the internal structure of the network module and violating GB 44495-2024 data security requirements." The report also provides the offset address of this string within the file for developers to locate.
[0061] It can also be seen that the embodiments of the present invention can effectively identify source code path information that remains in the read-only data area of the binary file even after the segment header has been cleared, thereby providing a deep security guarantee that far exceeds traditional manual inspection, ensuring that the vehicle software truly meets the stringent requirements of GB 44495-2024.
[0062] The information security testing method for compiling and optimizing automotive embedded systems proposed in this invention has the following advantages: (1) Meets regulatory compliance: This invention directly addresses the requirements for data security and software upgrade security in GB 44495-2024, providing a standardized compliance verification method for vehicle manufacturers and component suppliers.
[0063] (2) Deep automated detection: It abandons the traditional manual sampling method and realizes deep and automated scanning from the construction configuration to the binary content, which greatly improves the comprehensiveness and efficiency of the test.
[0064] (3) Accurately locate risks: By combining string feature matching and dual version difference comparison, it can not only find the problem of "existence" or "absence", but also accurately locate the specific content and location of residual information, which is convenient for quick repair.
[0065] (4) Build a secure left shift: This test method can be integrated into the CI / CD pipeline. Security verification is performed after the firmware is built to achieve "secure left shift" and prevent software with information leakage risks from being deployed to real vehicles from the source.
[0066] This invention also proposes an information security testing system for compiling and optimizing automotive embedded systems, comprising: The file acquisition unit is used to acquire the production version binary file of the in-vehicle software. The information extraction unit is used to extract build configuration information, segment headers, printable strings, and compiler optimization option levels from the production version binary file. The information judgment unit is used to determine, based on the build configuration information, whether the compilation options contain parameters for generating debug symbols and whether the NDEBUG macro is defined; to determine whether there is a preset debug-specific segment in the segment header; to determine whether the printable string contains debug content; and to determine whether the symbols in the compiler have been stripped according to the symbol stripping strategy corresponding to the compiler optimization option level. The test result determination unit is used to determine that the information security test of the production version binary file has passed when the compilation options do not include parameters for generating debug symbols, the NDEBUG macro is defined, there is no preset debug-specific segment in the segment header, the printable string does not contain debug content, and the symbols in the compiler have been stripped.
[0067] It should be noted that the above-described information security testing system for automotive embedded system compilation optimization is only illustrated by the division of the functional modules described above. In practical applications, the functions described can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. Furthermore, the above-described information security testing system for automotive embedded system compilation optimization and the embodiment of the information security testing method for automotive embedded system compilation optimization belong to the same concept, and their specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0068] The present invention also discloses a computer device, the device comprising: A processor, adapted to execute computer programs; A computer-readable storage medium storing a computer program, which, when executed by the processor, implements an information security testing method for compilation optimization of an automotive embedded system disclosed in an embodiment of the present invention.
[0069] The computer device can be a portable mobile terminal, such as a smartphone, tablet, laptop, or desktop computer. Typically, a computer device includes a processor and memory.
[0070] A processor may include one or more processing cores, such as a core processor or a core processor. The processor may be implemented using at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), or PLA (Programmable Logic Array). The processor may also include a main processor and coprocessors. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content required to be displayed on the screen. In some embodiments, the processor may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.
[0071] The memory may include one or more computer-readable storage media, which may be non-transitory. The memory may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory are used to store at least one computer program, which is executed by a processor to implement the intelligent vehicle control method provided in the method embodiments of this application.
[0072] In some embodiments, the computer device may also optionally include: a peripheral device interface and at least one peripheral device. The processor, memory, and peripheral device interface can be connected via a bus or signal line. Each peripheral device can be connected to the peripheral device interface via a bus, signal line, or circuit board. Specifically, the peripheral device includes at least one of: radio frequency circuitry, a display screen, a camera assembly, audio circuitry, and a power supply.
[0073] Peripheral device interfaces can be used to connect at least one I / O (Input / Output) related peripheral device to the processor and memory. In some embodiments, the processor, memory, and peripheral device interface are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor, memory, and peripheral device interface can be implemented on separate chips or circuit boards, which is not limited in this embodiment.
[0074] Radio frequency (RF) circuits are used to receive and transmit RF signals, also known as electromagnetic signals. RF circuits communicate with communication networks and other communication devices via electromagnetic signals. RF circuits convert electrical signals into electromagnetic signals for transmission, or convert received electromagnetic signals back into electrical signals. In some embodiments, the RF circuit includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, etc. The RF circuit can communicate with other terminals through at least one wireless communication protocol. These wireless communication protocols include, but are not limited to: the World Wide Web, metropolitan area networks, intranets, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and / or WiFi (Wireless Fidelity) networks. In some embodiments, the RF circuit may also include circuitry related to NFC (Near Field Communication), which is not limited in this application.
[0075] The present invention also discloses a computer-readable storage medium storing a computer program adapted for loading and execution by a processor of an information security testing method for compiling and optimizing an automotive embedded system, as disclosed in the embodiments of the present invention.
[0076] The present invention also discloses a computer program product, which includes a computer program. When the computer program is executed by a processor, it implements an information security testing method for compilation optimization of an automotive embedded system disclosed in the embodiments of the present invention.
[0077] The method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor. The software modules can reside in readily available storage media in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method. To avoid repetition, detailed descriptions are omitted here.
[0078] Those skilled in the art will recognize that the units and algorithm steps described in conjunction with the embodiments herein can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0079] While the specific embodiments of the present invention have been described above in conjunction with the accompanying drawings, this is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art without creative effort based on the technical solutions of the present invention are still within the scope of protection of the present invention.
Claims
1. A method for information security testing of compilation optimization for automotive embedded systems, characterized in that, include: Obtain the production version binary file of the in-vehicle software; Extract build configuration information, header segments, printable strings, and compiler optimization option levels from the production version binary file; Based on the build configuration information, determine whether the compilation options include parameters for generating debug symbols and whether the NDEBUG macro is defined; Determine if a pre-defined debugging segment exists in the segment header; Determine if a printable string contains debug content; Determine whether symbols have been stripped in the compiler based on the symbol stripping strategy corresponding to the compiler optimization option level. The information security test of the production version binary file is considered passed when the compiler options do not include parameters for generating debug symbols, the NDEBUG macro is defined, there is no preset debug-specific segment in the segment header, the printable string does not contain debug content, and the symbols in the compiler have been stripped.
2. The information security testing method for compiling and optimizing an automotive embedded system as described in claim 1, characterized in that, The information security test of the production version binary file is deemed to have failed when the compiler options include parameters for generating debug symbols, the NDEBUG macro is not defined, a pre-defined debug-specific segment exists in the segment header, the printable string contains debug content, and / or the symbols in the compiler are not stripped.
3. The information security testing method for compiling and optimizing an automotive embedded system as described in claim 1, characterized in that, A test report is generated based on the information security test results of the production version binary file. In the test report generated based on the information security test results of the production version binary file that failed, the reasons for the failure of the information security test of the production version binary file and the corresponding remediation suggestions are included.
4. The information security testing method for compiling and optimizing an automotive embedded system as described in claim 1, characterized in that, Also includes: Obtain the development version binary file of the in-vehicle software; Compare the development version binary file and the production version binary file of the in-vehicle software; The information security test of the production binary file is deemed to have passed when the compiler options do not include parameters for generating debug symbols, the NDEBUG macro is defined, there is no preset debug-specific segment in the segment header, the printable string does not contain debug content, the symbols in the compiler have been stripped, and the production version binary file does not contain the debugging information found in the development version binary file.
5. The information security testing method for compilation optimization of an automotive embedded system as described in claim 1, characterized in that, Based on the assembly code pattern of functions in the production version binary file, the level of compilation optimization options is determined by reverse engineering.
6. The information security testing method for compiling and optimizing an automotive embedded system as described in claim 1, characterized in that, Use regular expression matching to determine whether a printable string contains debug content.
7. An information security testing system for compiling and optimizing automotive embedded systems, characterized in that, include: The file acquisition unit is used to acquire the production version binary file of the in-vehicle software. The information extraction unit is used to extract build configuration information, segment headers, printable strings, and compiler optimization option levels from the production version binary file. The information judgment unit is used to determine, based on the build configuration information, whether the compilation options include parameters for generating debug symbols and whether the NDEBUG macro is defined; to determine whether there is a preset debug-specific segment in the segment header; and to determine whether the printable string contains debug content. Determine whether symbols have been stripped in the compiler based on the symbol stripping strategy corresponding to the compiler optimization option level. The test result determination unit is used to determine that the information security test of the production version binary file has passed when the compilation options do not include parameters for generating debug symbols, the NDEBUG macro is defined, there is no preset debug-specific segment in the segment header, the printable string does not contain debug content, and the symbols in the compiler have been stripped.
8. An electronic device, characterized in that, The device includes: A processor, adapted to execute computer programs; A computer-readable storage medium storing a computer program, which, when executed by the processor, implements the information security testing method for compilation optimization of an automotive embedded system as described in any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program adapted to be loaded by a processor and executed by a processor as described in any one of claims 1-6, which is a method for compiling and optimizing information security testing for automotive embedded systems.
10. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the information security testing method for compilation optimization of an automotive embedded system as described in any one of claims 1-6.