CN111367794A - AFL-oriented adaptive Bitmap table adjusting method and device - Google Patents
AFL-oriented adaptive Bitmap table adjusting method and device Download PDFInfo
- Publication number
- CN111367794A CN111367794A CN202010117203.4A CN202010117203A CN111367794A CN 111367794 A CN111367794 A CN 111367794A CN 202010117203 A CN202010117203 A CN 202010117203A CN 111367794 A CN111367794 A CN 111367794A
- Authority
- CN
- China
- Prior art keywords
- bitmap table
- program
- bitmap
- afl
- executable
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/368—Test management for test version control, e.g. updating test cases to a new software version
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3684—Test management for test design, e.g. generating new test cases
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Test And Diagnosis Of Digital Computers (AREA)
- Debugging And Monitoring (AREA)
Abstract
An adaptive Bitmap table adjusting method and device facing AFL are disclosed, wherein the adjusting method comprises the following steps: respectively inserting target programs in different Bitmap table sizes to form executable programs of multiple versions; and (4) Fuzz is carried out on all executable programs according to the sequence from small to large of the Bitmap table, the density of the Bitmap table is detected, and when the density of the Bitmap table is more than 80%, switching is carried out to the executable program of the next version. The invention also provides an adaptive Bitmap table adjusting device facing the AFL, terminal equipment and a computer readable storage medium.
Description
Technical Field
The invention belongs to the field of software engineering, and particularly relates to an adaptive Bitmap table adjusting method and device for AFL (adaptive markup language).
Background
Fuzz, also known as Fuzz testing, is a method for automatically testing a target program by continuously changing inputs. The full name of AFL is American Fuzzy Lop, a well-known fuzz testing tool. And the AFL adopts a Bitmap table to record the edge coverage rate of the tested program. This Bitmap table is set to a fixed size of 64K in order to fit into the Cache of the computer, thereby improving performance. However, for large programs, the program size can be very large, resulting in a very large number of program edges, much larger than 64K. Thus, for a 64K Bitmap, these large program tests may often result in edge collisions, where information for multiple edges is stored in the same location in the Bitmap. Edge collisions can cause the AFL to miss the opportunity to find a new path, thereby reducing testing efficiency. However, the Bitmap table should not be set too large initially, which may result in the Bitmap table not being placed in the Cache, thereby reducing the Fuzz efficiency. According to the investigation of CollAFL, the AFL bitmap has the problem of side collision. Edge collisions can be reduced by simply increasing bitmap, but the performance of Fuzz is affected. Therefore, the size of the Bitmap can be dynamically increased, a smaller Bitmap is set at the beginning, the density of the Bitmap table is increased along with the advancing of the test process, the probability of edge collision is increased, and the size of the Bitmap can be increased to reduce the collision.
Disclosure of Invention
The invention aims to provide an adaptive Bitmap table adjusting method and device facing AFL (adaptive back mapping) aiming at the problem that in the prior art, a contradiction exists between Bitmap table edge conflict and fuzzy performance, and the dynamic increase of the size of a Bitmap is realized.
In order to achieve the purpose, the invention has the following technical scheme:
an adaptive Bitmap table adjusting method facing AFL comprises the following steps:
respectively inserting target programs in different Bitmap table sizes to form executable programs of multiple versions;
and (3) carrying out Fuzz on all executable programs according to the sequence from small to large of the Bitmap table, detecting the density of the Bitmap table, and switching to the executable program of the next version when the density of the Bitmap table is more than 80%, wherein the switching steps are as follows:
firstly, stopping testing the program V of the current version, and collecting all current seed files;
traversing the seed file queue, taking the seed file as input, operating the program V' of the next version, and generating a new Bitmap;
restarting to test the program V' of the next version on the basis of the new Bitmap;
and circulating the switching steps until the last version of the executable program.
Preferably, in an embodiment of the AFL-oriented adaptive Bitmap table adjusting method of the present invention, the size of the Bitmap table includes 64K, 128K, 256K, and 512K, and the formed executable program is V64k、V128k、V256kAnd V512k。
Preferably, in an embodiment of the AFL-oriented adaptive Bitmap table adjustment method of the present invention, the executable program V of the initial version is first executed64kFuzz is carried out, the density of the Bitmap table is detected at the same time, and when the density of the Bitmap table is more than 80%, the executable program V is switched to128kSequentially performing the same operations until the executable program V512k。
The invention also provides an AFL-oriented adaptive Bitmap table adjusting device, which comprises:
the target program instrumentation module is used for instrumenting the target program in different Bitmap table sizes to form executable programs of multiple versions;
the executable program fuzzing test module is used for conducting Fuzz on all executable programs according to the sequence from small to large of the Bitmap table, detecting the density of the Bitmap table, and switching to the executable program of the next version when the density of the Bitmap table is larger than 80%;
the executable program switching module is used for collecting all the seed files of the current version program V; traversing the seed file queue, taking the seed file as input, operating the program V' of the next version, and generating a new Bitmap; restarting to test the program V' of the next version on the basis of the new Bitmap; and circulating the switching steps until the last version of the executable program.
The invention also provides terminal equipment which comprises a memory, a processor and a computer program stored in the memory and capable of running on the processor, wherein the processor realizes the steps of the AFL-oriented adaptive Bitmap table adjusting method when executing the computer program.
The present invention also provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements the steps of the AFL-oriented adaptive Bitmap table adjusting method.
Compared with the prior art, the invention has the following beneficial effects: when the executable program is switched, firstly, the test of the program V of the current version is stopped, all the current seed files are collected, the seed file queue is traversed, the program V' of the next version is operated by taking the seed files as input, and a new Bitmap is generated. The invention can compile and generate a plurality of programs with different Bitmap versions at the same time, and rebuild the Bitmap table by taking the seed file as a medium when testing programs with different versions is switched, thereby solving the problem that the size of the Bitmap table fixed by AFL can not change along with the increase of the programs and reducing the conflict during the fuzzy test.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic workflow diagram of a conventional AFL;
FIG. 2 is a flow chart of an adaptive Bitmap table adjustment method according to the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention.
Based on the embodiments of the present invention, those skilled in the art can make several simple modifications and decorations without creative efforts, and all other embodiments obtained belong to the protection scope of the present invention.
Reference in the present specification to "an example" means that a particular feature, structure, or characteristic described in connection with the example may be included in at least one embodiment of the invention. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by the person skilled in the art that the described embodiments of the invention can also be combined with other embodiments.
Referring to fig. 1-2, the method and the device for restoring the Bitmap table have the characteristics that a plurality of programs with different Bitmap size versions can be compiled and generated at the same time, the seeds are used as media, the Bitmap table is reconstructed when the test of the programs with different versions is switched, finally, the problem that the size of the Bitmap table fixed by the AFL cannot change along with the increase of the programs is solved, the conflict during the fuzzy test is reduced, and the fuzz performance is ensured.
The invention relates to an AFL-oriented adaptive Bitmap table adjusting method, which comprises the following steps of:
respectively instrumenting target programs with different Bitmap table sizes, wherein the size of each Bitmap table comprises 64K, 128K, 256K and 512K, forming multiple versions of executable programs, and forming the executable programs which are V64K, V128K, V256K and V512K;
and (3) carrying out Fuzz on all executable programs according to the sequence from small to large of the Bitmap table, detecting the density of the Bitmap table, and switching to the executable program of the next version when the density of the Bitmap table is more than 80%, wherein the switching steps are as follows:
firstly, stopping testing the program V of the current version, and collecting all current seed files;
traversing the seed file queue, taking the seed file as input, operating the program V' of the next version, and generating a new Bitmap;
restarting to test the program V' of the next version on the basis of the new Bitmap;
and circulating the switching steps until the last version of the executable program.
In particular, the method comprises the following steps of,
first, the program V can be executed for the initial version64kFuzz is carried out, the density of a Bitmap table is detected at the same time, and when the density of the Bitmap table is more than 80%, switching is carried out to an executable programV128kSequentially performing the same operations until the executable program V512k。
The invention also provides an AFL-oriented adaptive Bitmap table adjusting device, which comprises:
the target program instrumentation module is used for instrumenting the target program in different Bitmap table sizes to form executable programs of multiple versions;
the executable program fuzzing test module is used for conducting Fuzz on all executable programs according to the sequence from small to large of the Bitmap table, detecting the density of the Bitmap table, and switching to the executable program of the next version when the density of the Bitmap table is larger than 80%;
the executable program switching module is used for collecting all the seed files of the current version program V; traversing the seed file queue, taking the seed file as input, operating the program V' of the next version, and generating a new Bitmap; restarting to test the program V' of the next version on the basis of the new Bitmap; and circulating the switching steps until the last version of the executable program.
The invention also provides a terminal device based on the adaptive Bitmap table adjusting method facing the AFL, wherein the terminal device comprises a memory, a processor and a computer program which is stored in the memory and can run on the processor, and the processor realizes the steps of the adaptive Bitmap table adjusting method facing the AFL when executing the computer program.
The present invention also provides a computer-readable storage medium storing a computer program, which when executed by a processor implements the steps of the AFL-oriented adaptive Bitmap table adjusting method.
The above description is only a preferred embodiment of the present invention, and is not intended to limit the technical solution of the present invention, and it should be understood by those skilled in the art that the technical solution can be modified and replaced by a plurality of simple modifications and replacements without departing from the spirit and principle of the present invention, and the simple modifications and replacements also fall into the protection scope of the claims of the present invention.
Claims (6)
1. An adaptive Bitmap table adjusting method facing AFL is characterized by comprising the following steps:
respectively inserting target programs in different Bitmap table sizes to form executable programs of multiple versions;
and (3) carrying out Fuzz on all executable programs according to the sequence from small to large of the Bitmap table, detecting the density of the Bitmap table, and switching to the executable program of the next version when the density of the Bitmap table is more than 80%, wherein the switching steps are as follows:
firstly, stopping testing the program V of the current version, and collecting all current seed files;
traversing the seed file queue, taking the seed file as input, operating the program V' of the next version, and generating a new Bitmap;
restarting to test the program V' of the next version on the basis of the new Bitmap;
and circulating the switching steps until the last version of the executable program.
2. The AFL-oriented adaptive Bitmap table adjusting method as claimed in claim 1, wherein: the size of the Bitmap table comprises 64K, 128K, 256K and 512K, and the formed executable program is V64k、V128k、V256kAnd V512k。
3. The AFL-oriented adaptive Bitmap table adjusting method according to claim 2, wherein: first, for the initial version of the executable program V64kFuzz is carried out, the density of the Bitmap table is detected at the same time, and when the density of the Bitmap table is more than 80%, the executable program V is switched to128kSequentially performing the same operations until the executable program V512k。
4. An adaptive Bitmap table adjusting device facing AFL, comprising:
the target program instrumentation module is used for instrumenting the target program in different Bitmap table sizes to form executable programs of multiple versions;
the executable program fuzzing test module is used for conducting Fuzz on all executable programs according to the sequence from small to large of the Bitmap table, detecting the density of the Bitmap table, and switching to the executable program of the next version when the density of the Bitmap table is larger than 80%;
the executable program switching module is used for collecting all the seed files of the current version program V; traversing the seed file queue, taking the seed file as input, operating the program V' of the next version, and generating a new Bitmap; restarting to test the program V' of the next version on the basis of the new Bitmap; and circulating the switching steps until the last version of the executable program.
5. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the AFL-oriented adaptive Bitmap table adjusting method according to any one of claims 1 to 3 when executing the computer program.
6. A computer-readable storage medium, storing a computer program, wherein the computer program, when being executed by a processor, implements the steps of the AFL-oriented adaptive Bitmap table adjusting method according to any one of claims 1 to 3.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010117203.4A CN111367794B (en) | 2020-02-25 | 2020-02-25 | AFL-oriented self-adaptive Bitmap table adjustment method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010117203.4A CN111367794B (en) | 2020-02-25 | 2020-02-25 | AFL-oriented self-adaptive Bitmap table adjustment method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111367794A true CN111367794A (en) | 2020-07-03 |
CN111367794B CN111367794B (en) | 2023-05-23 |
Family
ID=71206302
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010117203.4A Active CN111367794B (en) | 2020-02-25 | 2020-02-25 | AFL-oriented self-adaptive Bitmap table adjustment method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111367794B (en) |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS5762447A (en) * | 1980-10-01 | 1982-04-15 | Fujitsu Ltd | Control system for execution of program |
US7055146B1 (en) * | 2001-03-08 | 2006-05-30 | Microsoft Corporation | Method and system for dynamically inserting modifications for identified programs |
CN107193731A (en) * | 2017-05-12 | 2017-09-22 | 北京理工大学 | Use the fuzz testing coverage rate improved method of control variation |
CN110362485A (en) * | 2019-07-03 | 2019-10-22 | 杭州安恒信息技术股份有限公司 | A kind of fuzz testing method for excavating Windows core A PI loophole |
CN110442570A (en) * | 2019-06-06 | 2019-11-12 | 北京左江科技股份有限公司 | A kind of BitMap high speed fuzzy search method |
EP3572944A1 (en) * | 2018-05-24 | 2019-11-27 | Fujitsu Limited | Concurrency vulnerability detection |
US20190384697A1 (en) * | 2018-06-18 | 2019-12-19 | Fujitsu Limited | Branch coverage guided symbolic execution for hybrid fuzz testing of software binaries |
-
2020
- 2020-02-25 CN CN202010117203.4A patent/CN111367794B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS5762447A (en) * | 1980-10-01 | 1982-04-15 | Fujitsu Ltd | Control system for execution of program |
US7055146B1 (en) * | 2001-03-08 | 2006-05-30 | Microsoft Corporation | Method and system for dynamically inserting modifications for identified programs |
CN107193731A (en) * | 2017-05-12 | 2017-09-22 | 北京理工大学 | Use the fuzz testing coverage rate improved method of control variation |
EP3572944A1 (en) * | 2018-05-24 | 2019-11-27 | Fujitsu Limited | Concurrency vulnerability detection |
US20190384697A1 (en) * | 2018-06-18 | 2019-12-19 | Fujitsu Limited | Branch coverage guided symbolic execution for hybrid fuzz testing of software binaries |
CN110442570A (en) * | 2019-06-06 | 2019-11-12 | 北京左江科技股份有限公司 | A kind of BitMap high speed fuzzy search method |
CN110362485A (en) * | 2019-07-03 | 2019-10-22 | 杭州安恒信息技术股份有限公司 | A kind of fuzz testing method for excavating Windows core A PI loophole |
Non-Patent Citations (3)
Title |
---|
ZHANG GEN: "PTfuzz: Guided Fuzzing With Processor Trace Feedback" * |
许航: "灰盒模糊测试自适应技术研究" * |
韩;吴波;辛丹;: "一种动静结合的高代码覆盖率模糊测试方法" * |
Also Published As
Publication number | Publication date |
---|---|
CN111367794B (en) | 2023-05-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7784039B2 (en) | Compiler, compilation method, and compilation program | |
US6594678B1 (en) | Methods and apparatus for improving locality of reference through memory management | |
DE10393481T5 (en) | Method and apparatus for performing a cache bypass | |
Hertz et al. | Error-free garbage collection traces: How to cheat and not get caught | |
JP2015528612A (en) | Method and system for monitoring the execution of user requests in a distributed system | |
US8291399B2 (en) | Off-line program analysis and run-time instrumentation | |
CN108132955A (en) | A kind of log storing method and device | |
JPH08241250A (en) | System for decision of actual working set | |
US8732323B2 (en) | Recording medium storing transaction model generation support program, transaction model generation support computer, and transaction model generation support method | |
CN111367794B (en) | AFL-oriented self-adaptive Bitmap table adjustment method and device | |
WO2024217001A1 (en) | Method and apparatus for functional safety testing under transient fault of chip, and device | |
Zhang et al. | A study of relative redundancy in test-suite reduction while retaining or improving fault-localization effectiveness | |
US7100155B1 (en) | Software set-value profiling and code reuse | |
CN112783620A (en) | Optimization method for timing task scheduling, computer equipment and storage medium | |
Sagdeo et al. | Precis: Inferring invariants using program path guided clustering | |
CN114185938B (en) | Project traceability analysis method and system based on digital finance and big data traceability | |
Chen et al. | An approach to determine the optimal k-value of k-means clustering in adaptive random testing | |
Shu et al. | Fault localization using a failed execution slice | |
CN113127694B (en) | Data storage method and device, electronic equipment and storage medium | |
US20210232946A1 (en) | Performance optimization of object grouping schema in a network key-value storage device using adaptive regression | |
US7606989B1 (en) | Method and apparatus for dynamically pre-tenuring objects in a generational garbage collection system | |
CN113282485A (en) | Program automatic restoration method based on self-adaptive search | |
CN113283744A (en) | Design and updating method for lightweight power consumption abnormal characteristic fingerprint database | |
CN116303586B (en) | Metadata cache elimination method based on multi-level b+tree | |
Zhang et al. | Scavenger: Better Space-Time Trade-Offs for Key-Value Separated LSM-trees |
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 |