Software protection method and apparatus, electronic device, and storage medium
Abstract
The present disclosure provides a software protection method and apparatus, an electronic device and a storage medium. By identifying the sensitive data in the software source code and determining the point of use of the sensitive data; setting the sensitive data in the read-only section of the compilation product of the software source code so that the sensitive data is stored in the read-only area when the software is running; inserting the check code into the above point of use of the sensitive data, where the check code is used to check whether the sensitive data read is in the read-only area while the software is running, and determine whether to continue running the software according to the check result, embodiments of the present disclosure realize the integrity verification of the sensitive data, and thereby prevent the sensitive data from being corrupted with low performance overheads.
Interactive Citation Constellation Global Citation Ranking
Interactive SVG Citation Constellation renders in Rust/WebAssembly. Prior art cited: 23 · Forward citations: 0.
Claims (8)
- Claim 1Independent Claim
A software protection method, executed by a compiler in an electronic device during a compilation process, comprising: identifying sensitive data created by the compiler during the compilation process and determining a point of use of the sensitive data, wherein the sensitive data is operands of sensitive operations recognized by the compiler, the sensitive operations comprise program counter update, a sensitive application programming interface (API) call, a security check and a business-critical operation, wherein the business-critical operation comprises transferring and password decryption; setting the sensitive data in a read-only section of a compilation product of a software source code, so that the sensitive data is stored in a read-only area when a software is running; and inserting a check code at the point of use of the sensitive data, wherein the check code is used to check whether sensitive data read is in the read-only area while the software is running, and determine whe
- Claim 2Depends on #1
The method according to claim 1, wherein before the identifying the data with the special marker as the sensitive data, the method further comprises: identifying an instruction containing the sensitive operations according to a preset rule, and marking data used by the instruction using the special marker; and associating the data with the memory read instruction.
- Claim 3Depends on #2
The method according to claim 2, wherein the method further comprises: marking the memory read instruction using the special marker; the inserting the check code at the point of use of the sensitive data comprises: inserting the check code before the marked memory read instruction; or modifying the marked memory read instruction to the memory read code containing the check code.
- Claim 4Depends on #3
The method according to claim 3, wherein the setting the sensitive data in the read-only section of the compilation product of the software source code comprises: identifying a collection of legitimate values of the sensitive data, constituting an allowlist, and setting data in the allowlist in the read-only section of the compilation product of the software source code; and setting the sensitive data as the data in the allowlist.
- Claim 5Depends on #2
The method according to claim 2, wherein the setting the sensitive data in the read-only section of the compilation product of the software source code comprises: identifying a collection of legitimate values of the sensitive data, constituting an allowlist, and setting data in the allowlist in the read-only section of the compilation product of the software source code; and setting the sensitive data as the data in the allowlist.
- Claim 6Depends on #1
The method according to claim 1, wherein the setting the sensitive data in the read-only section of the compilation product of the software source code comprises: identifying a collection of legitimate values of the sensitive data, constituting an allowlist, and setting data in the allowlist in the read-only section of the compilation product of the software source code; and setting the sensitive data as the data in the allowlist.
- Claim 7Depends on #6
The method according to claim 6, wherein the determining whether to continue running the software according to the check result comprises: continuing running the software if the sensitive data read is in the read-only area; and blocking the software from running if the sensitive data read is not in the read-only area.
- Claim 8Depends on #1
The method according to claim 1, wherein the setting the sensitive data in the read-only section of the compilation product of the software source code comprises: identifying a collection of legitimate values of the sensitive data, constituting an allowlist, and setting data in the allowlist in the read-only section of the compilation product of the software source code; and setting the sensitive data as the data in the allowlist.
Technical Overview & Description
CROSS-REFERENCE TO RELATED APPLICATION The present application is a continuation of the International Application No. PCT/CN2021/123329, filed on Oct. 12, 2021, which claims priority to Chinese Patent Application No. 202110289668.2, titled “ SOFTWARE PROTECTION METHOD AND APPARATUS, ELECTRONIC DEVICE, AND STORAGE MEDIUM ” , filed to China National Intellectual Property Administration on Mar. 15, 2021. Both of the aforementioned applications are hereby incorporated by reference in their entireties. TECHNICAL FIELD The present disclosure relates to computer technology, in particular, to a software protection method and apparatus, an electronic device and a storage medium. BACKGROUND Computer software has been facing serious security threats, among which memory corruption vulnerability is the most widespread security threat. These vulnerabilities are often exploited by attackers to compromise sensitive data used by sensitive operations, thereby hijacking or compromising the sensitive operations. In the related art, the most fundamental defense scheme against the above threats is to ensure the integrity of the sensitive data, and a common mechanism is to achieve integrity verification of the sensitive data based on a block cipher algorithm, but this method has a high performance overhead. SUMMARY In response to the above problems, the present disclosure provides a software protection method and apparatus, an electronic device and a storage medium. In a first aspect, the present disclosure provides a software protection method, including: identifying sensitive data in a software source code and determining a point of use of the sensitive data; setting the sensitive data in a read-only section of a compilation product of the software source code so that the sensitive data is stored in a read-only area when the software is running; and inserting a check code at the point of use of the sensitive data, where the check code is used to check whether the sensitive data read is
Cited By — Indexed Forward Citations (0 of 0 total)
No indexed citing patents in this generation yet. Ingest USPTO/PatentsView bulk citation tables via patents-ingest to expand the local forward citation graph.
References Cited — Backward Prior Art (23)
| Patent | Title | Year | Citations |
|---|
Non-Patent Literature (10)
- Office Action and Supplementary European Search Report of corresponding European Patent Application No. 21931204.8, dated Jun. 26, 2024, 10 pages.
- Chao Zhang et al.,
- “
- VTint: Protecting Virtual Function Tables' Integrity
- ”
- , Proceedings 2015 Network and Distributed System Security Symposium, Feb. 11, 2015, Retrieved from the Internet: URL: https://people.eecs.berkeley.edu/
- ˜
- dawnsong/papers/VTint-%20Protecting%20Virtual%20Function%20Tables'%20Integrity_feb%202015.pdf, 15 pages.
- Robert Gawlik et al.,
- “